Merge branch 'dev' of https://github.com/TerraFirmaGreg-Team/Modpack-Modern into dev
This commit is contained in:
commit
e77519aa59
1 changed files with 7 additions and 6 deletions
|
|
@ -503,18 +503,19 @@ BlockEvents.rightClicked(event => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Makes scythes, hoes, and knives take damage when cutting grass
|
// Makes scythes, hoes, and knives take damage when cutting grass
|
||||||
BlockEvents.broken('tfc:mineable_with_sharp_tool', event => {
|
BlockEvents.broken(event => {
|
||||||
let player = event.player;
|
const { server, item, player, block } = event;
|
||||||
let toolUsed = player.mainHandItem;
|
|
||||||
|
|
||||||
if (!toolUsed.hasTag('tfc:sharp_tools')) {
|
if (!block.hasTag('tfc:mineable_with_sharp_tool') || !toolUsed.hasTag('tfc:sharp_tools')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let toolUsed = player.mainHandItem;
|
||||||
|
|
||||||
if (!player.isCreative()) {
|
if (!player.isCreative()) {
|
||||||
toolUsed.damageValue++;
|
toolUsed.damageValue++;
|
||||||
if (toolUsed.damageValue >= toolUsed.maxDamage) {
|
if (toolUsed.damageValue >= toolUsed.maxDamage) {
|
||||||
event.server.runCommandSilent(`playsound minecraft:item.shield.break player ${player.username} ${player.x} ${player.y} ${player.z} 1 1 1`);
|
server.runCommandSilent(`playsound minecraft:item.shield.break player ${player.username} ${player.x} ${player.y} ${player.z} 1 1 1`);
|
||||||
toolUsed.count--;
|
toolUsed.count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue