Arqade Asked by Rashard Givens on October 4, 2020
I’m trying to make a custom npc map for myself.
I need a command that will summon a weapon that has low durability so it can by dropped by the npc.
Can anyone give me an example on how to do it?
The /give command can do this.
The syntax is:
/give <player> <item> [amount] [data] [dataTag]
To give tools with less durability, just increase the [data].
This will give a diamond sword with full durability:
/give @p diamond_sword 1 0
This will give a diamond sword with 50 durability missing:
/give @p diamond_sword 1 50
This will give a diamond sword with 100 durability missing:
/give @p diamond_sword 1 100
Answered by user5074736 on October 4, 2020
Add the Damage tag to the command:
/give @s diamond_sword{Damage:780}
This will give you a half durability sword, or at least as close to half as you can get because a diamond swords durability is 1561
Answered by Dark_Shadow65 on October 4, 2020
Another thing that should be taken into account is that you cannot change the maximum durability of an item unless you use some sort of datapack or mod, but other than that you can change the number of uses it has left.
In 1.12 and before:
/give @p minecraft:diamond_sword 1 100
In 1.13 and after:
/give @p minecraft:diamond_sword{Damage:100} 1
Answered by Nathaniel Brown on October 4, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP