Solved Set Entity Target To Null

Discussion in 'Plugin Development' started by John Cameron, Jun 1, 2013.

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

    John Cameron

    I got this code at the moment below.
    Code:
    @EventHandler(priority = EventPriority.MONITOR)
        public void EntityTargetEvent(org.bukkit.event.entity.EntityTargetEvent event){
            if(event.getEntity() instanceof Creeper){
                Creeper creeper = (Creeper) event.getEntity();
                creeper.setTarget(null); //what to fill in, null doesn't work...
            }
        }
    
    I know the event fires and everything else, but the creeper.setTarget(null); still targets a player, any idea how to make the creeper not target anyone? Thanks!
     
  2. Offline

    teunie75

    event.setCancelled();?
     
  3. Offline

    John Cameron

    I am sooooooooooo stupid :eek:
    Anyway thanks for the help!
     
Thread Status:
Not open for further replies.

Share This Page