Minecraft Command Blocks (MapMaking)?

Yi
10

I'm currently doing a MapMaking and I'm not yet completely familiar with it. The whole thing would take place in Minecraft version 1.13. I give the player an item and want to read this item with a tag how can I do it? I have already tried whether this is possible via nbt data but it didn't work out exactly.

I would be happy if someone of you could help me.

an

What do you mean by "reading the item out with a tag"

What exactly do you want to read out? And then what do you want to do with the information read out?

Yi

I have a resource pack. With this I can give every Damage a texture. And if I add the standard item to it, the function also works there. But that would have to change if you give the sword a day, for example. And that you can read out the day, and thereby a function happens. And the standard item has no tag and therefore no function.

So far I have this:

/ execute if entity @a [nbt = {SelectedItem: {id: "minecraft: wooden_sword"}}] run say Hi

Be

As if I understood that correctly, you want to read the damage value from the selected item.

If so then you have the command here:

/ execute if entity @a [nbt = {SelectedItem: {id: "minecraft: wooden_sword", Count: 1b, tag: {Damage: 5}}}]

Be

With this website you can do it very easily and quickly:

https://mcstacker.net/

Yi

Thank you I will try it out. For me the https://mcstacker.net/ website doesn't work. At least not for version 1.13

Yi

Just tried it, it works great

Be

Then what did you do for a command

Yi

You sent me: - *

Be

Then click on / execute if entity at the top. Then click on the S next to SelectedItem and select the item you want. The command should be in a small window in the upper right corner.

Yi

Oki. The only thing is that it is from 14+