[SPIGOT-2348] EntityTeleportEvent is not working properly when player is using bow to shoot an Enderman Created: 03/Jun/16  Updated: 12/Jun/16  Resolved: 12/Jun/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Mars Tan Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: event
Environment:

java 8



 Description   

I implement the method below.
When player is using bow to shoot an Enderman, the Enderman will teleport far away, not being damaged by arrow. The console with print about 10 lines of "EnderMan!", which means the method has been fired for several times.

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityTeleport(EntityTeleportEvent event)

{ System.out.println("EnderMan!"); event.setCancelled(true); }

 Comments   
Comment by md_5 [ 12/Jun/16 ]

Look I've fixed this in the sense that the teleport is now properly cancelled.
You however cannot shoot endermen because 1) They are immune to bows, 2) For enderman specifically this glitchy as the client will teleport the endermen away, meaning they will vanish for a second until the server resyncs.

Comment by Mars Tan [ 03/Jun/16 ]

You are right, but since this event is cancelled, Enderman should not teleport to somewhere else and should be damaged by the arrow.

Comment by Black Hole [ 03/Jun/16 ]

You forgot the specify what you mean by "not working properly".

The arrow takes some time in the air, so the Enderman will try to teleport multiple times.

Generated at Tue Apr 22 04:20:15 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.