Is it possible to test for an item that has its name recolored using an inventory editor? I want to prevent players from obtaining certain effects by simply renaming their items in an anvil, and color (or any other formatting for that matter) can only be added to item names using external programs.
You'd need to use an external editor to modify the command block that checks for the item's NBT data. You'd then need to be very careful handling the command, as to not remove the formatting.
But you'd probably be more interested in using custom NBT data. If you apply non-vanilla NBT data to items in 1.8, that data remains for us to detect, and cannot be modified without commands. A quick example:
The "CUSTOM" tag is not a vanilla tag, but will not be removed at all. Its value is set to 1, with a tag-type of 'byte'. You can use that to check for custom items:
The "CUSTOM" tag is not a vanilla tag, but will not be removed at all. Its value is set to 1, with a tag-type of 'byte'.
Does this work for blocks as well? Say for instance you wanted a player to mine and replace a certain block somewhere. Could you use /blockdata to go in and set a custom data tag, and then /testforblock wherever it is you want the player to put the block? Or would the block lose it's data when it gets mined?
Rollback Post to RevisionRollBack
I like to do redstone builds on my channel, and I can probably help you with your in game troubles.
Quite a bit of a bump here, but I have a relevant question. Even though droppers can hold additional information as blocks it doesn't seem to be possible to make it retain any custom nbt tags. The situation is similar for other data holding blocks. Additionally, it seems to be impossible to match blocks like this with colored names. So, is there a way to ensure that a custom dropper is actually a custom dropper as opposed to a normal, renamed dropper?
Veni, vidi, cecidi
(I came, I saw, I tripped)
But you'd probably be more interested in using custom NBT data. If you apply non-vanilla NBT data to items in 1.8, that data remains for us to detect, and cannot be modified without commands. A quick example:
The "CUSTOM" tag is not a vanilla tag, but will not be removed at all. Its value is set to 1, with a tag-type of 'byte'. You can use that to check for custom items:
That way there's no need to use external editors.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Does this work for blocks as well? Say for instance you wanted a player to mine and replace a certain block somewhere. Could you use /blockdata to go in and set a custom data tag, and then /testforblock wherever it is you want the player to put the block? Or would the block lose it's data when it gets mined?
I like to do redstone builds on my channel, and I can probably help you with your in game troubles.
Quite a bit of a bump here, but I have a relevant question. Even though droppers can hold additional information as blocks it doesn't seem to be possible to make it retain any custom nbt tags. The situation is similar for other data holding blocks. Additionally, it seems to be impossible to match blocks like this with colored names. So, is there a way to ensure that a custom dropper is actually a custom dropper as opposed to a normal, renamed dropper?
Veni, vidi, cecidi
(I came, I saw, I tripped)