KubeJS

KubeJS

61M Downloads

【BUG】The game crashes.

blood789 opened this issue · 2 comments

commented

I Want to chang the foodProperties of goldenapple, I write an this :

onEvent('item.modification', event => {
event.modify('minecraft:golden_apple', item => {
item.foodProperties = food => {
food.effect('minecraft.regeneration',30,3,1.0)
}
})
})

BUT, But when I enter the game, press the E key, and check the golden apple, the game crashes.

Is it a BUG ? OR I wirte in the wrong way?
debug.log

commented

I write it this way and it works. to somebody who want to use this function

onEvent('item.modification', event => {
event.modify('minecraft:golden_apple', item => {
item.foodProperties = food => {
food.effect('minecraft:regeneration',1200,3,1.0)
}
})
})

commented

The issue with your first version was that you used minecraft.regeneration instead of minecraft:regeneration, mind the colon ^^