2

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.

2
  • Just updated question. This is for adventure mode. May 27, 2016 at 17:03
  • 1
    You dont have to write a comment if you edit the question :) May 27, 2016 at 17:46

1 Answer 1

1

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

You must log in to answer this question.

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