I need help

Discussion in 'Spigot Help' started by Prodigyx, May 4, 2017.

  1. can anyone send me a link to a plugin that stops blazes shooting fireballs aka attacking
    id really appreciate it
     
    • Funny Funny x 1
  2. https://bukkit.org/threads/disable-mob-attack.301521/

    Code (Text):
    package main;
    import java.util.logging.Logger;
    import org.bukkit.entity.Blaze;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.Wither;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.EntityChangeBlockEvent;
    import org.bukkit.event.entity.EntityDamageByEntityEvent;
    import org.bukkit.event.entity.EntityDamageEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    public class BlockedCmds extends JavaPlugin implements Listener {
    Logger log = Logger.getLogger("Minecraft");
    public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
    }
    public void onDisable() {}
    @EventHandler
    public void onEntityDamge(EntityDamageByEntityEvent event) {
    Entity entity = event.getEntity();
       if (entity instanceof Wither) {
       event.setCancelled(true);
       return;
       }
       if (entity instanceof Blaze) {
       event.setCancelled(true);
       return;
       }
    }
        @EventHandler
        public void onEntityChangeBlock(EntityChangeBlockEvent event) {
       Entity entity = event.getEntity();
       if (entity instanceof Wither) {
       event.setCancelled(true);
       return;
       }
       if (entity instanceof Blaze) {
       event.setCancelled(true);
       return;
       }
        }
    }
     
    • Funny Funny x 1
  3. All that does is prevent the damage from the fireballs, it however doesn't stop blazes shooting them. You're better off cancelling the projectile launch event if the entity is a blaze and/or the projectile is a fireball
     
    • Agree Agree x 2
  4. what about worldguard then?
     
  5. What about it?