2

As mentioned in the title, I am looking for a command that will remove the item with the changed name from the player's inventory. I tried using:

/clear @p acacia_boat {{{display:{Name:'{"text":"blabla"}'}} 1

And nothing works. I searched the internet but didn't turn up any results, and I've found no answer anywhere when trying to do this on version 1.16.5.

11
  • 3
    Possible duplicate of Why is it bad practice to test for item names?
    – pppery
    Commented Nov 19, 2021 at 22:33
  • 3
    Voting to reopen. This should not have been closed because it is not clear whether the asker is asking for specifically detecting the renamed item, or whether they're just testing for the custom name because they need some way of detecting their renamed item.
    – One 2 Many
    Commented Nov 20, 2021 at 4:17
  • 1
    @ExpertCoder14 I think it can be, but that's not the point here - in this case I'm just asking because you wrote "it is not clear whether the asker is asking for specifically detecting the renamed item, or whether ..", but i might be misinterpreting your comment. Hence the question :)
    – Joachim
    Commented Nov 20, 2021 at 21:39
  • 1
    @Joachim It is clear what the issue is, but in order for an answer, they need to specify whether the name is decorative or non-decorative. I don't vote to close this question because, how were they supposed to know that there is a difference in the first place?
    – One 2 Many
    Commented Nov 20, 2021 at 23:05
  • 1
    @ExpertCoder14 I understand and agree. But closing a question can be done purely because more information is needed, and does in no way reflect badly on the OP. It's just a heads-up, a prompt to action, and to avoid others answering a question when they actually can't.
    – Joachim
    Commented Nov 21, 2021 at 11:13

1 Answer 1

0

You would want to state the item then add the modifier:

 {display:{Name:'{"text":"custom name"}'}}

Example:

/clear @a minecraft:torch{display:{Name:'{"text":"lighter"}'}}

Not the answer you're looking for? Browse other questions tagged .