recipes
This commit is contained in:
28
web/pack/kubejs/startup_scripts/food.js
Normal file
28
web/pack/kubejs/startup_scripts/food.js
Normal file
@@ -0,0 +1,28 @@
|
||||
StartupEvents.registry("item", (event) => {
|
||||
event.create("golden_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)
|
||||
.effect("health_boost", 600, 0, 1)
|
||||
.effect("luck",600,0,1)
|
||||
.effect("strength",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
|
||||
});
|
||||
});
|
||||
});
|
||||
13
web/pack/kubejs/startup_scripts/items.js
Normal file
13
web/pack/kubejs/startup_scripts/items.js
Normal file
@@ -0,0 +1,13 @@
|
||||
StartupEvents.registry("item", (event) => {
|
||||
event.create("incomplete_netherstar", "create:sequenced_assembly");
|
||||
|
||||
event
|
||||
.create("andesite_shears", "shears")
|
||||
.displayName("Andesite Shears")
|
||||
.maxDamage(127);
|
||||
|
||||
event
|
||||
.create("brass_shears", "shears")
|
||||
.displayName("Brass Shears")
|
||||
.maxDamage(450);
|
||||
});
|
||||
@@ -1,34 +0,0 @@
|
||||
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
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user