All checks were successful
continuous-integration/drone/push Build is passing
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
let pathBlocks = [
|
|
{'base': 'minecraft:crimson_nylium', 'path': 'morepaths:crimson_nylium_path', 'drops': 'minecraft:netherrack'},
|
|
{'base': 'minecraft:warped_nylium', 'path': 'morepaths:warped_nylium_path', 'drops': 'minecraft:netherrack'},
|
|
{'base': 'minecraft:mycelium', 'path': 'morepaths:mycelium_path', 'drops': 'minecraft:dirt'},
|
|
{'base': 'minecraft:podzol', 'path': 'morepaths:podzol_path', 'drops': 'minecraft:dirt'},
|
|
]
|
|
|
|
pathBlocks.forEach((p) => {
|
|
BlockEvents.rightClicked(p['base'], event => {
|
|
if (!event.item.hasTag(`minecraft:shovels`)) return
|
|
|
|
event.block.set(p['path'])
|
|
event.player.swing(event.hand, true)
|
|
|
|
if (!event.player.creative) {
|
|
event.item.setDamageValue(event.item.damageValue + 1)
|
|
}
|
|
|
|
event.cancel()
|
|
})
|
|
})
|
|
|
|
LootJS.modifiers((event) => {
|
|
event.enableLogging()
|
|
|
|
pathBlocks.forEach((p) => {
|
|
event
|
|
.addBlockLootModifier(p['path'])
|
|
.replaceLoot(Ingredient.all, p['drops'])
|
|
})
|
|
}) |