KubeJS

KubeJS

69M Downloads

Item.pickup event can't be cancelled

DarkAges773 opened this issue ยท 3 comments

commented

Minecraft Version

1.18.2

KubeJS Version

1802.5.4-build.521

Rhino Version

1802.1.14-build.192

Architectury Version

5.9.31

Forge/Fabric Version

Forge 40.1.60

Describe your issue

When trying to cancel pickup event, using code below, the test messages get sent, but the item still gets picked up by the player. On the wiki it states that item.pickup event should be cancellable.
onEvent('item.pickup', event=> {
event.player.tell('test1')
event.cancel()
event.player.tell('test2')
})
Also tested on different minecraft versions: 1.16.5, 1.18.2, 1.19

Crash report/logs

No response

commented

Turns out this is an issue in Architectury, see architectury/architectury-api#301

commented

I just tested this with the test script provided and versions below, and it works. I do not pick up any items and test1 test2 is spammed in the chat when I stand near enough to an item to pick it up.

Is this resolved then?

Versions

architectury-4.8.80
kubejs-forge-1802.5.4
forge-40.1.60
rhino-forge-1802.1.14-build.209
commented

Assuming it was resolved, closing.