Why is this code not working?

Discussion in 'Spigot Plugin Help' started by DiamondGenerator, May 5, 2017.

  1. Code (Text):

    package DiamondGenerator.Guards;

    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class KeepInventory extends JavaPlugin {

        @EventHandler
        public void onDeath(PlayerDeathEvent e) {
            Player guard = e.getEntity();
            Player killer = e.getEntity().getKiller();

            if (killer != null) {
                if (guard.hasPermission("rghm.guard")) {
                    e.setKeepInventory(true);
               
        }

    }
    }
    }
     
    When you have the permission (or if you are op), your items still drop..
    What is wrong with it, I've got no idea why it is not working...[/QUOTE]
     
    • Agree Agree x 1
  2. Code (Java):

    public void onEnable() {
      Bukkit.getPluginManager().registerEvents(this, this);
    }

    Tapatalkkal küldve az én LG-K120 eszközömről

     
     
  3. I think this not the good place for this ;) This is for plugins not for Development..
     
    • Agree Agree x 1