Right click event doesnt cancel things it should
ChiefArug opened this issue ยท 3 comments
Minecraft Version
1.19.2
KubeJS Version
kubejs-forge-1902.6.1-build.9999 (same as build.236 with #646 applied)
Rhino Version
rhino-forge-1902.2.2-build.268.jar
Architectury Version
architectury-6.5.85-forge.jar
Forge/Fabric Version
43.2.14
Describe your issue
ItemEvents.rightClicked('create:wrench', event => {
event.cancel()
})
This should prevent all create wrench interactions, but it does nothing.
The forge event version
ForgeEvents.onEvent('net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock', event => {
if (event.itemStack.id == 'create:wrench'))
event.setCanceled(true)
})
works fine
Crash report/logs
No response
Use:
BlockEvents.rightClicked(event => {
event.cancel()
})
instead.
ItemEvents.rightClicked
is when the player right-clicks with the item in hand but is selecting no block or entities.
Previously ItemEvents.rightClicked triggered on both block right click and empty right click, and BlockEvents.rightClicked triggered after ItemEvents.rightClicked only if ItemEvents.rightClicked wasnt cancelled.