Can't get this plugin to work

Discussion in 'Plugin Development' started by NoU_X2, Jul 13, 2020.

  1. Offline

    NoU_X2

    So recently I made a new plugin and it's basically about when a creeper spawns they are already super powered (Have the glowing electric thing around them) but for some reason it won't work. There are no errors in my code or in my plugin.yml.


    package me.NoU_X2.OpCreeper;

    import org.bukkit.entity.Creeper;
    import org.bukkit.entity.EntityType;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.CreatureSpawnEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin implements Listener {

    @EventHandler
    public void creatureSpawn(CreatureSpawnEvent event) {

    if(event.getEntityType() == EntityType.CREEPER) {

    Creeper creeper = (Creeper) event.getEntity();

    creeper.setPowered(true);
    }

    }

    }
     
  2. Offline

    timtower Moderator Moderator

    @NoU_X2 You did not register the listener in the onEnable.
     
  3. Offline

    NoU_X2

    Still don't get it
    Sorry I'm new
     
  4. Offline

    timtower Moderator Moderator

  5. Offline

    NoU_X2

    Got it to work now. Thanks!!
     

Share This Page