home Forumsplay_arrow PMC play_arrow Discussion


ADD a tag to an item with command

1 emeralds3 replies343 views
created 03/27/2017 1:32 pm by Bismuth_Bi
last reply 03/31/2017 2:46 pm
I'm working on a PvP map nd I want to make custom weapon, but I have to find how to reduce the number of commad block I use (curently a lot!!).
So, is there a way to add a tag (enchant for exemple) to an item? Adn by this, I really want to say "add", not "set"! Exm=emple, if i drop a diamon sword on the ground with sharpness 3, I want to add a knockback enchantement. I know if I use entitydata, it will set the tag and the sword will only have the knockback enchant. So, there is a way to ADD a tag?

Thanks a lot,
Posted by avatar
Level 1 : New Miner

comment Login or register to post a reply.

3 replies

03/31/2017 2:46 pm
Level 37 : Artisan Engineer
what.... 100,000?! Prove it!

You can tag (scoreboard) players using the SelectedItem tag (NBT), then execute a /enchant command for all players with the scoreboard tag.

Other than that, you can't "add" nbt tags that already exist.
Although please check if using /entitydata with the new enchant really doesn't work...

I managed to rename a damaged item that was thrown on the ground. Both the name and the damage value are inside the "Item" tag of the item.
03/31/2017 12:08 pm
Level 1 : New Miner
OK, thanks. I already knew that the / enchant added an enchantment, but I'm looking for an alternative to the level limit. Thank you for answering (although this is not the answer I wanted;)). If you ever have an illumination and you're finding a method to reduce my command number (I'm currently using 100,000 command blocks), I'm open to everything!

Thanks a lot!
03/27/2017 3:06 pm
Level 55 : Grandmaster Cyborg
Not really, you can't prevent it from overwriting previous enchantments. /enchant is a thing and it actually adds enchantments, but you're only able to target players with it (it will try to apply the enchantment to the item that the player is holding) and you can't apply enchantments that you won't be able to get on items in survival.

Planet Minecraft



© 2010 - 2019