KubeJS

KubeJS

83M Downloads

Canceling dropping item is broken + docs error

Kardane opened this issue ยท 0 comments

commented

Minecraft Version

1.20.1

KubeJS Version

2001.6.5-build16

Rhino Version

2001.2.3-build10

Architectury Version

9.2.1.4

Forge/Fabric Version

forge-1.20.1-47.4.0

Describe your issue

ItemEvents.dropped(event => {
    event.entity.tell(Text.of('You dropped an item!'))
    event.cancel()
})

It works 1.21 neoforge, but it seems broken at 1.20.1 forge.
Also in docs, you can use this event at client and server, but it only works in server environment

Image

gif Image
https://imgur.com/a/hVOuphe

[22:37:10] [INIT] KubeJS 2001.6.5-build.16; MC 2001 forge
[22:37:10] [INIT] Loaded plugins:
[22:37:10] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgePlugin
[22:37:10] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgeClientPlugin
[22:37:10] [INFO] Loaded script server_scripts:example.js in 0.006 s
[22:37:10] [INFO] Loaded 1/1 KubeJS server scripts in 0.01 s with 0 errors and 0 warnings

kube/server.log

[25Apr2025 22:41:11.038] [Server thread/INFO] [KubeJS Server/]: Loaded script server_scripts:example.js in 0.0 s
[25Apr2025 22:41:11.038] [Server thread/INFO] [KubeJS Server/]: Loaded 1/1 KubeJS server scripts in 0.005 s with 0 errors and 0 warnings
[25Apr2025 22:41:11.044] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Done! To reload recipes, tags, loot tables and other datapack things, run '/reload'
[25Apr2025 22:41:12.809] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] You dropped an item!
[25Apr2025 22:41:13.002] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] You dropped an item!
[25Apr2025 22:41:13.152] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] You dropped an item!
[25Apr2025 22:41:13.304] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] You dropped an item!
[25Apr2025 22:41:13.453] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] You dropped an item!

latest.log

And also, In cilent side, this event didn't even triggered

ItemEvents.dropped(event => {
    event.entity.tell(Text.of('You dropped an item! client'))
    event.cancel()
})

Discord Post:
https://discord.com/channels/303440391124942858/1360483813649678396