- , as a player of both Bedrock and Java versions of the game, have noticed that command functionality is significantly more limited in Bedrock compared to Java. I propose adding one new command for Bedrock users.
- (/getnbt): This command would allow players to retrieve any NBT data from an entity or block and convert it to text, scoreboard, or
nbt:save. Thenbt:saveargument type would work as a replacement for selectors, values, or identifiers in commands. For example, the item data in a player’s hand could be saved asnbt:save{"item":"saveid":"test"}. Usingnbt:savewould let the game pull information directly from this saved NBT data and apply it in commands as if it were an entity or value.
Example of using nbt:save
/give @a {"nbt:save":"test"} 1
This will give the item saved as nbt_save
item test. -
-
Example of the command syntax:
getnbt (entity/block) (position/entity) (data type and settings) (text/scoreboard/nbt_save) (settings).Example of using the getnbt command:
/summon zombie ~~~ facing ~~~ b "Boss"
/scoreboard objectives add HPdisplay dummy
/scoreboard objectives setdisplay sidebar HPdisplay
/getnbt entity @e[type=zombie,c=1] {"Entity_healpoint":"count"} scoreboard{"name":{"@e[type=zombie,c=1]","objective":"HPdisplay"}}.As a result, the boss's health will be shown on the right of the screen for all players. This is just an example, as you can add other settings like position, tags, type, Game_mode, item NBT, inventory NBT, vector, scores, effects, impulse, events, nbt_tags.
-
Please sign in to leave a comment.
0 Comments