#Force Drop Items keep durability and enchants

1 messages · Page 1 of 1 (latest)

gloomy vector
#

Hello
Is there a way to keep the durability and enchants of an item?
I would like to force the player to drop their items, using spawItem, but I don't know how to keep the durability and enchants, can anyone help?

#

Force Drop Items keep durability and enchants

coral reef
plain orchid
#

:^

remote imp
#

Why dosen't this script works ?

#
import { ItemStack, world } from "@minecraft/server";

world.afterEvents.itemUse.subscribe(e => {
    const Sword = e ;
    const player = e.source
    const item = new ItemStack('minecraft:diamond_hoe' , 1).getComponent('minecraft:enchantable').addEnchantment({type : "mending", level : 1 })
    player.getComponent('minecraft:inventory').container.addItem(item);
})
#

@plain orchid

#

.__.

plain orchid
remote imp
#

._.

#

,__, can u help me to add Enchantments

#

To the item

#

When i use it it told me that