1.17.x Forcing Enderman to take damage from Projectiles

Discussion in 'Spigot Plugin Development' started by GamerCoder215, Jun 20, 2021.

?

How?

  1. I will explain below

    66.7%
  2. Custom Pathfinding (NMS)

    33.3%
  1. I was wondering if there is anyway to replicate Hypixel Skyblock's new bows, which can make enderman take damage from projectiles. If this is used with Custom Pathfinding in NMS, let me know.
     
  2. You can use the fact that the ProjectileHitEvent calls when a projectile tries to hit an enderman too.
    1. check if the hit entity's type is an enderman
    2. cancel the event so that the enderman doesn't dodge
    3. damage the enderman.
    4. remove the projectile
     
    #2 Dolphin2410, Jun 20, 2021
    Last edited: Jun 20, 2021
    • Like Like x 2
  3. I think that on ProjectileLaunchEvent you need to see if the arrow possibly hits the enderman (or another projectile), then calculate the knockback and damage and manually deal it to the enderman. If one teleports, teleport 'em back.
    EDIT: @Dolphin2410 suggested a better approach :)