home Forumsplay_arrow PMC play_arrow Discussion

1

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
Hello!
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,
Bismuth_Bi
Posted by avatar
Bismuth_Bi
Level 1 : New Miner
0

comment Login or register to post a reply.

3 replies

1
03/31/2017 2:46 pm
Level 37 : Artisan Engineer
Bertiecrafter
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.
1
03/31/2017 12:08 pm
Level 1 : New Miner
Bismuth_Bi
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!
1
03/27/2017 3:06 pm
Level 55 : Grandmaster Cyborg
Pepijn
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

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome