#change a item max durability
6 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Max durability is defined in startup. You can only change the damage value during gameplay.
Hmm then is there a way I can make a item take more or less damage from mining/attack
A workaround is to change the damage value when leftclick
BlockEvents.rightClicked("bedrock", event => {
const {player, hand} = event
if(hand == "off_hand") return;
player.give(Item.of("minecraft:netherite_axe").withNBT({"max_durability": 10}))
})
ItemEvents.firstLeftClicked(event => {
const {item} = event
if(!item.damageableItem) return;
const leastDamageValue = item.maxDamage - (item.nbt?.max_durability || 0)
if(item.damageValue < leastDamageValue) item.setDamageValue(leastDamageValue)
})
thanks this should work🙏