-
Bug
-
Resolution: Awaiting Response
-
None
-
1.20.40
-
None
-
Unconfirmed
-
Windows
I'm trying to use the world.beforeEvents.itemUse to cancel the setting of a custom item, but when I try to do it the item is blocked in the slot where it should be equipped, this only happens if the player is in creative and with custom items apparently
code:
world.beforeEvents.itemUse.subscribe((eventData) => {
let player = eventData.source
system.run(() => {
let chestplate = player.getComponent('equippable').getEquipmentSlot('Chest')
player.runCommand('say hi-' + chestplate.typeId)
if (chestplate.typeId == 'backpack:backpack_c')
})
eventData.cancel = true;
})
Evidence:
https://drive.google.com/file/d/1fiprPu54LJJ4h9OzXqvYtHwo1KvcnY4w/view?usp=sharing