Replies: 2 comments
-
|
Implemented in kjs(but no knockback): EntityEvents.hurt(event => {
if(event.source.actual == null) return;
if(!event.source.actual.isPlayer()) return;
//No weak attacks
if(event.damage <= 2.5) return;
if (event.entity.type == 'minecraft:snow_golem' && event.source.actual.mainHandItem.id.contains('shovel')) {
event.entity.attack(4);
} else if (event.source.actual.mainHandItem.id.contains('pickaxe') && event.entity.type == 'minecraft:iron_golem') {
event.entity.attack(8);
};
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
A better version of the script: const toolHurtsExtra = {
"minecraft:snow_golem":{"tool":"shovel", "damage": 2},
"minecraft:iron_golem":{"tool":"pickaxe", "damage": 6},
};
EntityEvents.hurt(["minecraft:snow_golem", "minecraft:iron_golem"], e => {
if(!e.source.actual) return;
if(!e.source.actual.isPlayer()) return;
if(e.damage <= 2.5) return;
const {tool, damage} = toolHurtsExtra[e.entity.type];
if(damage > e.entity.health) return;
if(e.source.actual.mainHandItem.id.contains(`${tool}`)) e.entity.health -= damage;
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Pickaxes deal more damage to iron golems.
Shovels deal more damage to snow golems.
Beta Was this translation helpful? Give feedback.
All reactions