Handle armorstands interaction for commands

This commit is contained in:
libraryaddict 2020-05-11 14:53:58 +12:00
parent 111acda388
commit 9a40df5bd8
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -496,6 +496,21 @@ public class DisguiseListener implements Listener {
interactions.remove(p.getName()).onInteract(p, entity); interactions.remove(p.getName()).onInteract(p, entity);
} }
@EventHandler
public void onRightClick(PlayerInteractAtEntityEvent event) {
Player p = event.getPlayer();
if (!interactions.containsKey(p.getName())) {
return;
}
event.setCancelled(true);
disguiseRunnable.remove(p.getName()).cancel();
Entity entity = event.getRightClicked();
interactions.remove(p.getName()).onInteract(p, entity);
}
@EventHandler @EventHandler
public void onTarget(EntityTargetEvent event) { public void onTarget(EntityTargetEvent event) {
if (event.getTarget() == null) { if (event.getTarget() == null) {