Skip to content

Commit

Permalink
melee_attack mech
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 25, 2021
1 parent 20388b5 commit a2af142
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -3353,6 +3353,18 @@ else if (getBukkitEntity() instanceof Creeper) {
NMSHandler.getEntityHelper().setEndermanAngry(getBukkitEntity(), mechanism.getValue().asBoolean());
}

// <--[mechanism]
// @object EntityTag
// @name melee_attack
// @input EntityTag
// @description
// Causes this hostile-mob entity to immediately melee-attack the specified target entity once.
// Does not work with passive mobs, player entities, non-living entities, etc.
// -->
if (mechanism.matches("melee_attack") && mechanism.requireObject(EntityTag.class)) {
getLivingEntity().attack(mechanism.valueAsType(EntityTag.class).getBukkitEntity());
}

CoreUtilities.autoPropertyMechanism(this, mechanism);
}
}

0 comments on commit a2af142

Please sign in to comment.