Disable Wither Attack?

Discussion in 'Plugin Development' started by iWareWolf, Feb 17, 2014.

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

    iWareWolf

    How do I disable withers attacking players?
     
  2. Offline

    valon750

  3. Offline

    iWareWolf

    valon750

    It doesn't work.
    Code:
        @EventHandler
        public void onTarget(EntityTargetEvent e) {
            if (e.getEntity() instanceof Wither) {
                e.setCancelled(true);
            }
        }
     
  4. Offline

    valon750

    iWareWolf

    Hate being asked this question myself, but have you registered the listeners?
     
  5. Offline

    iWareWolf

    valon750
    Yes I have.

    Code:
            getServer().getPluginManager().registerEvents(new TargetListener(), this);
    Anyone have a clue?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  6. Offline

    ItsLeoFTW

    Try:
    Code:
    @EventHandler
    public void onTarget(EntityTargetEvent e){
       if (e.getEntity() instanceof Wither){
         e.setTarget(null);
    } else {
       e.setTarget(target here)
    }
    
     
Thread Status:
Not open for further replies.

Share This Page