-1

I am using emeralds as currency in my adventure map, so they have a custom name and lore. When they are crafted into an emerald block and back into emeralds, the lore and name is gone. I want to add a repeat command block that permanently checks the player's inventory for emeralds WITHOUT the custom name. Is that possible?

  • Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins! – Frank Dec 29 '17 at 12:59
  • Are you asking about a workaround instead of the actual solution? Why don't you instead try to pretend them from losing their name at all? – Fabian Röling Dec 29 '17 at 13:38
0

Use clear command to detect how many emeralds you have, and how many named emeralds you do. If they are different, you have some unnamed emeralds.

-1

Yes it is possible. You just need to check the players inventory and clear the item.

/clear [player] emerald 1

then you have to put the custom name into it and give it back plus you need to put it on repeat

/give [player] minecraft:emerald 1 0 {display:{Name:"[Custom Name]"}}{display:{Lore:["Lore"]}}
  • 2
    That way you'd be constantly clearing and giving one emerald to the player. – Plagiatus Dec 29 '17 at 11:49
  • You also swapped data and maxCount. This command searches for an emerald with metadata 1 (which doesn't exist). – Fabian Röling Dec 29 '17 at 14:19
  • First I thought that the constant item in your face would be the only downside, which could be solved with entity models, but no, it also has a number of weird effects on single item stacks. – Fabian Röling Dec 29 '17 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.