Ask Minecraft for Lore?

Ka
- in Earth
23

I have a question for the command experts. How can you ask for a lore in Minecraft (1.15.2) (not the one to drive, but this small text that you can add to items)? So if I now have earth with the "Hello" cart, how can I use commands to ask whether the item that I currently have in my normal hand has the "Hello" cart?

gl

/ execute if entity @p [nbt = {SelectedItem: {id: "minecraft: dirt", Count: 1b, tag: {display: {Lore: ['{"text": "Hallo"}']}}}}} ]

Tests whether @p holds a dirt block with the "Hello" lore in hand.

Ka

Thank you for your attention. For me it doesn't always work. I copied it and put it in a command block, replaced dirt with carrot_on_a_stick and replaced hello with a mysterious item. Command block is impulse absolutely and set to required redstone. I selected the item and bepowered on the command block but it didn't work. (Wrote run say hi at the end)

gl

You have to repeat the command block Absolutely Always active

Is the carriage of the carrot rod normal or colored, bold?

Otherwise you can try to place a new command block.

Ka

It is bold and in dark blue. It is also italic but I don't know if it is always so.

gl

You can't make italic either. Since the lore is bold and dark blue, it is not recognized. The right command:

/ execute if entity @p [nbt = {SelectedItem: {id: "minecraft: coarse_dirt", Count: 1b, tag: {display: {Lore: ['{"text": "Hallo", "color": "dark_blue "," bold ": true} ']}}}}]

Ka

Didn't work either. By the way, I thought purple accidentally wrote dark blue. However, I have added it and it still does not work. I can show you the order with which I got the carrot rod.

/ give Nasenboy minecraft: carrot_on_a_stick {Damage: 1b, Unbreakable: 1b, display: {Name: "{\" text \ ": \" Zeitanhalter \ ", \" color \ ": \" white \ ", \" bold \ ": \" true \ "}", Lore: ["{\" text \ ": \" A mysterious object \ ", \" color \ ": \" purple \ ", \" bold \ ": \" true \"}"]}} 1

gl

That should work:

/ execute if entity @p [nbt = {SelectedItem: {id: "minecraft: carrot_on_a_stick", Count: 1b, day: {display: {Name: '{"text": "Zeitanhalter", "color": "white", "bold": true} ', Lore: [' {"text": "A mysterious object", "color": "dark_purple", "bold": true} ']}, Unbreakable: 1b, Damage: 1b} }}]

What does Damage: 1b do?

Ka

Damage: 1b is apparently the same as Damage: 1 what the item uses. So when you get it it's a little worn out. I try it out and then get in touch.

Ka

This is really weird still doesn't work

gl

/ execute if entity @p [nbt = {SelectedItem: {id: "minecraft: carrot_on_a_stick", Count: 1b, day: {display: {Name: '{"text": "Zeitanhalter", "color": "white", "bold": true} ', Lore: [' {"text": "A mysterious object", "color": "purple", "bold": true} ']}, Unbreakable: 1b, Damage: 1b} }}]

Ka

Still does not work

Ka

I even got

/ execute If entity @a [nbt = {SelectedItem: {Unbreakable: 1b, Damage: 1}}] run say hello

Entered but it didn't say hello itself.

Ka

PS: In the end it was actually about me testing the item so that it couldn't be any other.

Ka

So if you find a way to test it differently, you can say so.

Ka

Can you at least write when you are not able to, etc

gl

You forgot carrot on a stick in this command xD

Be

The easiest way to test is to simply copy the bracket {Damage: 1b…} and then paste it here:

/ execute if entity @a [nbt = {SelectedItem: {Item: {Damage: 1b…}}}]

Ka

I'll try it out soon…

How can I say that it has to be a carrot rod?

Be

So:

{Damage: 1b, id: "minecraft: carrot_on_a_stick"}

Ka

Unfortunately, neither works.

Be

I made a small mistake with the first command. So he is correct:

/ execute if entity @a [nbt = {SelectedItem: {Item: {id: "minecraft: carrot_on_a_stick", tag: {Damage: 1b…}}}}]

Ka

OK I found out by day

Ar

/ execute at @e [type = minecraft: player, nbt = {SelecteItem: {id: "minecraft: dirt", tag: {display: {Lore: ['[{"text": "Hallo"}]']} }}}] run command_den_du_möscht_wie_zb: say player holds the item in his hand