This commit is contained in:
2024-09-15 13:57:32 +02:00
parent 14c3a1c764
commit c62597984d
22 changed files with 612 additions and 58 deletions

View 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
});
});
});

View 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);
});

View File

@@ -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
})
})
})