
event.creatCustom seem broken
zhichaoxi2006 opened this issue ยท 0 comments
Minecraft Version
1.21.1
KubeJS Version
2101.7.1-build.181
Rhino Version
2101.2.7-build.74
Architectury Version
null
Forge/Fabric Version
21.1.136
Describe your issue
When you use createCustom
to registry an item, if you enter game and try to create a new world, the game will crash.
let $Item$Properties = Java.loadClass("net.minecraft.world.item.Item$Properties");
let $FlintAndSteelItem = Java.loadClass("net.minecraft.world.item.FlintAndSteelItem");
StartupEvents.registry("item", event => {
event.createCustom("kubejs:test_garget", () => new $FlintAndSteelItem(new $Item$Properties().durability(64).stacksTo(1)));
});
but the code can run in KubeJS 2101.7.1-build.148.