I'm writing this because I notice that this question has been closed as a dupe of this. This is wrong, for a reason I am about to explain below. I left a comment on the question asking for it to be reopened, but I feel like a meta post is necessary so that no one makes the same mistake in the future.

The topics of the questions here are, how to test for an item's custom name with commands in Minecraft. The duplicate target here explains why testing for custom item names in this way is bad practice.

For a problem like this, there are two possible scenarios here. The difference is if the asker is using the custom item name decoratively or non-decoratively:

  • Decoratively: The asker has made a custom item for their map, and they are using a custom item name as part of the decoration for that item. In this case, the solution in the duplicate applies. The asker should be using a custom item tag.

    For example, "How do I detect a player holding my custom trident?", if the question contains a command testing for a custom item name, it should be closed as dupe.

  • Non-decoratively: The whole point of the system is that it needs to detect the item having the custom name. For example, a map that needs to detect when you rename a piece of paper.

    For example, "How do I detect a player renaming a piece of paper to 'John'?" should not be closed as duplicate, because adding a custom item tag doesn't help there.

As for the original question that was incorrectly closed, it is incorrectly closed because it is inconclusive whether this falls under the first or second scenario above. Inconclusiveness does not default to the side of closure. If it is inconclusive, a comment should be left and no further action until it is clear which scenario the question is leaning towards.

If you believe my self-answered question needs an edit or two to make this distinction more clear, feel free, I don't mind.

  • 2
    I reopened the post in question for now. I would love to hear pppery's take on this. I felt the duplicate was appropriate after fully reading it (nice post btw!), but honestly, I'm not the best when it comes to closing Minecraft questions as duplicates. My "mod powers" closed the post after my vote as well, preventing others from casting any votes.
    – Timmy Jim Mod
    Nov 20, 2021 at 11:16
  • 1
    I'm one of those who voted to close, my bad, thanks for the clarification.
    – pinckerman
    Nov 20, 2021 at 12:17
  • 3
    I'll be honest and say that the idea that testing for item names could be non-decorative completely never occurred to me. The next step should be to create a separate canonical "How does renaming items with an anvil format their NBT tag name" for the non-decorative use, and to close the original question as a double-duplicate of "Why is it bad practice to test for item names" and the new question.
    – pppery
    Nov 20, 2021 at 16:35
  • I'm actually somewhat surprised there don't seem to be any questions at all asking about the non-decorative case, even after going through every question tagged minecraft-commands containing the word anvil.
    – pppery
    Nov 20, 2021 at 16:47
  • @ppery I'm all for doing that. If you decide to create that post, link it here (you could post an answer). Thanks!
    – Timmy Jim Mod
    Nov 20, 2021 at 17:12
  • 1
    ExpertCoder14, you may want to post an answer that's splits the "answer-like" part of your post into an answer separate from the question itself. 👍
    – Timmy Jim Mod
    Nov 20, 2021 at 17:15
  • The duplicate target under discussion is not a particularly good question anyway since it's about best practice. I know this isn't Stack Overflow, it's Gaming SE, but still, it's phrased in an unnecessarily narrow way that happens to be opinion-based. In my opinion, it would be far better if it were written in the form of "how to [deal with/find/whatever] item names". That's a better direction to use for canonical questions because it doesn't deal with opinion and it doesn't presume a specific kind of issue someone is having regarding the topic at hand.
    – TylerH
    Nov 20, 2021 at 20:49
  • @TylerH What exactly about this do you find opinion-based? The use of custom item tags instead of custom name tests is common knowledge to command developers like me, not opinion.
    – One 2 Many
    Nov 20, 2021 at 20:51
  • 1
    @ExpertCoder14 The concept of 'best practice' is inherently an opinion-based one. What's best practice changes based on who you ask and what your concerns and goals are. If you think someone should do X instead of Y to obtain a goal, because X has A, B, C problems and Y doesn't, focus on that, not on "X is best practice".
    – TylerH
    Nov 21, 2021 at 2:41
  • 1
    @TylerH I do see a point in your statements and have initialized a plan to revise that Q&A post to reflect that. Thanks for the feedback! Every input counts towards a better knowledge base.
    – One 2 Many
    Nov 21, 2021 at 8:02


You must log in to answer this question.

Browse other questions tagged .