Is there a way to test for an item that hasn't been renamed?

Is there a way to test for an item that hasn't been renamed? - Photo of Clear Glass Measuring Cup Lot

This is for adventure mode.

Is there a way to test for an item that hasn't been renamed?

I'm trying to test if a player has an item

(ie. wooden pickaxe)

and then i want to replace it with the same type of item with a different tag

(ie. wooden pickaxe named super miner and can destroy stone).

The way i have it it replaces the normal pickaxe with the custom pickaxe but then it replaces the custom pickaxe with a 2nd custom pickaxe and it keeps going.



Best Answer

I tried several commands but i could not find a way to check if a item was not renamed.

You can check, if a pickaxe was crafted:

Create a scoreboard:

/scoreboard objectives add craftedPick stat.craftItem.minecraft.wooden_pickaxe

Then the following commands in a chain:

/give @a[score_craftedPick_min=1] minecraft:wooden_pickaxe 1 1 {YOUR_TAGS}
/scoreboard players remove @a[score_craftedPick_min=1] craftedPick 1
/clear @a minecraft:wooden_pickaxe 0 1

enter image description here

Plugin to create those command block text entities: https://www.spigotmc.org/resources/commanddesciptor.23870/

Related: Replace the item crafted with a tag




Pictures about "Is there a way to test for an item that hasn't been renamed?"

Is there a way to test for an item that hasn't been renamed? - Two Clear Glass Jars Beside Several Flasks
Is there a way to test for an item that hasn't been renamed? - Person Pouring Blue Liquid Into a Glass Container
Is there a way to test for an item that hasn't been renamed? - Satisfied adult bearded ethnic man and playful woman with curly hair wearing casual t shirts unboxing ceramics for home decoration from carton boxes while moving in new apartment



How do you Testfor an item?

Type the command in the chat window and press the Enter key to run the command. Once the cheat has been entered, the testfor command will check for mooshrooms. You will see the message "Found Mooshroom" appear in the lower left corner of the game window for each mooshroom found within 50 blocks of you.



Minecraft Bedrock - Test For Items In Inventory (Mobile/Xbox/PS4/Windows 10/Switch)




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Rodolfo Clix, Pixabay, Ivan Samkov, Ketut Subiyanto