Files
patata-pack2/web/pack/kubejs/startup_scripts/start.js
2024-09-15 13:01:06 +02:00

34 lines
1.2 KiB
JavaScript

StartupEvents.registry('item', e => {
e.create('incomplete_netherstar', 'create:sequenced_assembly')
e.create('andesite_shears', 'shears')
.displayName("Andesite Shears")
.maxDamage(127)
e.create('brass_shears', 'shears')
.displayName("Brass Shears")
.maxDamage(450)
e.create('golde_potato').food(food => {
food
.hunger(18)
.saturation(18)//This value does not directly translate to saturation points gained
//The real value can be assumed to be:
//min(hunger * saturation * 2 + saturation, foodAmountAfterEating)
.effect('speed', 600, 0, 1)
.removeEffect('poison')
.alwaysEdible()//Like golden apples
.fastToEat()//Like dried kelp
.meat()//Dogs are willing to eat it
.eaten(ctx => {//runs code upon consumption
ctx.player.tell(Text.gold('Yummy Yummy!'))
//If you want to modify this code then you need to restart the game.
//However, if you make this code call a global startup function
//and place the function *outside* of an event handler
//then you may use the command:
// /kubejs reload startup_scripts
//to reload the function instantly.
//See example below
})
})
})