skapa-season-3/kubejs/server_scripts/soul_soil_farmland.js
Steve McMaster fdce87ac75
All checks were successful
continuous-integration/drone/push Build is passing
Import KubeJS and Almost Unified
2024-07-12 00:30:16 +00:00

28 lines
720 B
JavaScript

let farmBlocks = [
{'base': 'minecraft:soul_soil', 'farmland': 'soulsoilfarmland:soul_soil_farmland'}
]
farmBlocks.forEach((p) => {
BlockEvents.rightClicked(p['base'], event => {
if (!event.item.hasTag(`minecraft:hoes`)) return
event.block.set(p['farmland'])
event.player.swing(event.hand, true)
if (!event.player.creative) {
event.item.setDamageValue(event.item.damageValue + 1)
}
event.cancel()
})
})
LootJS.modifiers((event) => {
event.enableLogging()
farmBlocks.forEach((p) => {
event
.addBlockLootModifier(p['farmland'])
.replaceLoot(Ingredient.all, p['base'])
})
})