All checks were successful
continuous-integration/drone/push Build is passing
28 lines
720 B
JavaScript
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'])
|
|
})
|
|
}) |