How can I have data be different for three identical blocks?

How can I have data be different for three identical blocks? - Group of multiracial businesspeople speaking and sharing data about project and analyzing reports in notebooks at table in office

How can I differentiate three different blocks that look exactly the same from each other? I want to have command blocks be able to tell them apart because they have different data, and I cannot use their location as the different data factor, because I need the command blocks to find them no matter where they are in the world. I want them all to look exactly the same. I am also open to suggestions of things that don't necessarily get this accomplished, but still allows command blocks to tell them apart without changing the appearance of the blocks. Overall, I want command blocks to be able to tell three different blocks apart from each other that are all Yellow Wool blocks. I do not want the appearance of any of the blocks to be changed in any way.



Best Answer

You can visually simulate a block using FallingSand, as well as a Shulker to simulate the bounding box of the block. The host entity would have the unique identifiers while there still appears to be a block.

Unfortunately if the FallingSand is too close to the ground, it will land. But in the latest 1.10 snapshot (16w21b), the NoGravity tag has been extended to all entities, and allows the FallingSand to be above the ground without landing.

For example, given the following arrangement of an armor stand host that has a Shulker and FallingSand as its passengers:

/summon ArmorStand ~ ~1 ~ {Tags:["wool1"],Passengers:[{id:"FallingSand",Block:"minecraft:wool",Data:4,Time:-2147483648,NoGravity:1b},{id:"Shulker",NoAI:1b,Silent:1b,Invulnerable:1b,ActiveEffects:[{Id:14b,Duration:2147483647,ShowParticles:0b}]}],Invisible:1b,Marker:1b}

The "wool1" tag indicates that this host is the first yellow wool. You would create copies of this entity while changing that tag to be different:

/summon ArmorStand ~ ~1 ~ {Tags:["wool2"],Passengers:[{id:"FallingSand",Block:"minecraft:wool",Data:4,Time:-2147483648,NoGravity:1b},{id:"Shulker",NoAI:1b,Silent:1b,Invulnerable:1b,ActiveEffects:[{Id:14b,Duration:2147483647,ShowParticles:0b}]}],Invisible:1b,Marker:1b}
/summon ArmorStand ~ ~1 ~ {Tags:["wool3"],Passengers:[{id:"FallingSand",Block:"minecraft:wool",Data:4,Time:-2147483648,NoGravity:1b},{id:"Shulker",NoAI:1b,Silent:1b,Invulnerable:1b,ActiveEffects:[{Id:14b,Duration:2147483647,ShowParticles:0b}]}],Invisible:1b,Marker:1b}

And you can then target those specific hosts:

/execute @e[type=ArmorStand,tag=wool2] ~ ~ ~ /setblock ~ ~2 ~ minecraft:stone



Pictures about "How can I have data be different for three identical blocks?"

How can I have data be different for three identical blocks? - Top view closeup of blank paper card placed on multicolored various shapes yummy candies in light confectionery
How can I have data be different for three identical blocks? - Wooden shelf filled with different interesting books near pots with green plants at home
How can I have data be different for three identical blocks? - From above of crop anonymous child reading interesting book with colorful pictures of different animals





Create Subnets of Different Sizes




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Anna Shvets, Karolina Grabowska, Laker, Marta Wave