your current location:首页 > news>How to use Kubejs to add items that can be put in the pile barrel [KJS] Kubejs Minecraft Game

How to use Kubejs to add items that can be put in the pile barrel [KJS] Kubejs Minecraft Game

2024-12-10 17:50:56|Myriagame |source:minecraft skins

This article will realize how to use Kubejs to add items that can be put in the fertilizer barrel

The effect is as shown in the figure

Refer to Discord

Create a new js file in Kubejs's server_scripts file (the name is self -determined but cannot be Chinese)

Add the following code to the new JS file:

 serverEvents.compostablerecipes ((e) => {

Const recipes = [

{{

Input: "Minecraft: Magma_block",

CHANCE: 1,

},

{{

Input: Add the tags of items,

CHANCE: The probability and probability of compost barrels (1 is 100 %)

}

];

Recipes.Foreach ((recipe) => {

E.add (recipe.input, recipe.chance);

});

});

Save file

Return to the game input/RELOAD command and reload it again.

Finish!IntersectionIntersection