EntityTargetEvent and Wolf

Discussion in 'Plugin Development' started by halvors, May 6, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    halvors

    Hi!

    I have some problems with EntityTargetEvent and Wolf, when a wolf has a target set, it does not fire EntityTargetEvent, is this a bug or just my code?

    Code:
    @Override
    public void onEntityTarget(EntityTargetEvent event) {
        Entity entity = event.getEntity();
        Entity target = event.getTarget();
        if (entity instanceof Wolf) {
            Wolf wolf = (Wolf)entity;
    
            if (target instanceof Player) {
                Player player = (Player)target;
    
                player.sendMessage("Wolf is attacking you!");
            }
        }
    }
    
     
Thread Status:
Not open for further replies.

Share This Page