KubeJS

KubeJS

61M Downloads

Custom food items cannot use non-vanilla potion effects

notWaterGuy12 opened this issue ยท 5 comments

commented

Not sure if this extends to all events that deal with potions, but modded potion effects lead to a game crash when a food that uses them is consumed.

script used in item creation:
event.create('foxtail_ramen').displayName('Foxtail Ramen').food(function(food){
food.hunger(10)
food.saturation(1)
food.effect('minecraft:regeneration', 400, 0, 1.0)})
food.effect('farmersdelight:comfort', 2400, 0, 1.0)})
food.effect('farmersdelight:nourished', 2400, 0, 1.0)})

commented

Recently got back into working on my pack, bug is no longer present

commented

did some experimenting and stuff on the discord, putting this crash report here. came from a test with only kubejs and thermal installed: https://pastebin.com/gWjQQ7y4

commented

Still an issue in kubejs-forge-1605.3.10-build.18. Crash report here: https://gist.github.com/pm065/fc732b14639d1562baf1a8f1b3a7cb97

Script used:

onEvent("item.registry", (event) => {
    //abnormals bread dough
    event.create("cosy:pumpkin_dough").group("food").texture(`cosy:item/pumpkin_dough`);
    event.create("cosy:banana_dough").group("food").texture(`cosy:item/banana_dough`);

    //seasonals/peculiars cake slices
    event.create("cosy:pumpkin_cake_slice").group("food").texture(`cosy:item/pumpkin_cake_slice`).food(food => {
        food
          .hunger(6) //obviously works
          .saturation(6) //obviously works
          .effect('minecraft:speed', 600, 0, 1) //this works
          .effect('seasonals:puppeteering', 200, 0, 1) // ):
          .fastToEat() //this works
    });
    event.create("cosy:sweet_berry_cake_slice").group("food").texture(`cosy:item/sweet_berry_cake_slice`).food(food => {
        food
          .hunger(6)
          .saturation(6)
          .effect('minecraft:speed', 600, 0, 1)
          .effect('seasonals:thorn_resistance', 200, 0, 1)
          .fastToEat()
    });
    event.create("cosy:aloe_cake_slice").group("food").texture(`cosy:item/aloe_cake_slice`).food(food => {
        food
          .hunger(6)
          .saturation(6)
          .effect('minecraft:speed', 600, 0, 1)
          .effect('atmospheric:persistence', 200, 0, 1)
          .fastToEat()
    });
    event.create("cosy:passionfruit_cake_slice").group("food").texture(`cosy:item/passionfruit_cake_slice`).food(food => {
        food
          .hunger(6)
          .saturation(6)
          .effect('minecraft:speed', 600, 0, 1)
          .effect('atmospheric:spitting', 200, 0, 1)
          .fastToEat()
    });
    event.create("cosy:yucca_cake_slice").group("food").texture(`cosy:item/yucca_cake_slice`).food(food => {
        food
          .hunger(6)
          .saturation(6)
          .effect('minecraft:speed', 600, 0, 1)
          .effect('atmospheric:gelled', 200, 0, 1)
          .fastToEat()
    });
});

Until this is fixed, I suppose I could just deal with only swiftness; slightly inconsistent cake is better than no cake :p

commented

Is this still an issue in the latest build?

commented

I'm gonna close this for now since there's been no activity on this issue for the last 4 weeks. If this issue still comes up, feel free to reopen!