Published Dec 27th, 2013, 12/27/13 10:59 am
- 7,045 views, 0 today
- 9
- 8
- 8
384
Minecraft | Command Blogs
By Pepijn
Data tags
What are they?
Data tags are Minecraft's in game representation of NBT. But what does this mean? First of all, NBT is how Minecraft stores a bunch of information about the game so when you close the world and open it again everything is still the same. NBT has always been used by Minecraft, but only since 1.7.2 have we been able to manipulate NBT this directly using data tags in commands. A lot has changed since then, especially in 1.13, but this idea behind data tags is still the same as ever.
How to use them?
Data tags are used by commands in two different ways: reading and writing. Reading is probably better understood by calling it "testing", you can use the nbt argument selector to further narrow down your search:
This is just a quick example. I will get into more detail about the format later.
The other way, writing, is also not that hard to understand. Instead of testing for something, we're setting it. Multiple commands are able to do this, but we will take /summon as an example:
WIP
By Pepijn
Data tags
What are they?
Data tags are Minecraft's in game representation of NBT. But what does this mean? First of all, NBT is how Minecraft stores a bunch of information about the game so when you close the world and open it again everything is still the same. NBT has always been used by Minecraft, but only since 1.7.2 have we been able to manipulate NBT this directly using data tags in commands. A lot has changed since then, especially in 1.13, but this idea behind data tags is still the same as ever.
How to use them?
Data tags are used by commands in two different ways: reading and writing. Reading is probably better understood by calling it "testing", you can use the nbt argument selector to further narrow down your search:
/execute as @e run say hello world
will make every loaded entity in the world say "hello world"/execute as @e[nbt="{OnGround:1b}"] run say hello world
will only make every loaded entity touching the ground say "hello world"This is just a quick example. I will get into more detail about the format later.
The other way, writing, is also not that hard to understand. Instead of testing for something, we're setting it. Multiple commands are able to do this, but we will take /summon as an example:
/summon zombie ~ ~ ~
will summon a regular zombie./summon zombie ~ ~ ~ {Invulnerable:1b}
will summon an invulnerable zombie.WIP
Tags |
2655528
6
Create an account or sign in to comment.
blockdata ~ ~1 ~ {Items:[{id:stone,Count:1,Slot:0}]}
If you want to see a list of all/most datatags you can use, I suggest you take a look at these:
http://minecraft.gamepedia.com/Player.dat_format (For players, can't be used with /summon or anything, they are just for /testfor. For example /testfor @p {foodLevel:6}. You can also find the datatags for Items (enchantments, fireworks etc.)
http://minecraft.gamepedia.com/Chunk_format (for mobs and other entities, in 1.7 you can only use them with /summon, but because of @e in 1.8, you can use these for /testfor as well (in 1.8))