ServerEvents.compostableRecipes
Compostable recipes are made in a server script. The event is not cancellable.
Here is an example on how to use this event:
ServerEvents.compostableRecipes(event => {
event.add('minecraft:nether_star', 0.25)
event.add('#minecraft:leaves', 0.5)
event.remove('minecraft:wheat_seeds')
event.remove('#minecraft:saplings')
event.removeAll()
})List of all the available methods:
add(item, chance)chanceis a number between 0 and 1.
add(item, chance, villager)villageris a bool that controls whether farmer villagers can compost the item in their work AI.
addReplace(item, chance)addReplace(item, chance, villager)replaceAll()remove(item)removeAll()