Nodrop in fly

Discussion in 'Plugin Development' started by MasterDavide_00, Oct 30, 2013.

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

    MasterDavide_00

    Hello everyone, I'm new in the forum ... I must also tell you that they are not very practical ... I tried to create a plugin that blocks the drop in fly but without success. I could use some help from you, thank you!
     
  2. Offline

    Fred12i12i

    do you need help to make the plugin or do you want someone to make the plugin for you? MasterDavide_00
     
  3. Offline

    MasterDavide_00

    I did not explain ... I do not have pasted what I had done because now no longer available, I meant to put the code in the main, if you have any idea about
     
  4. Offline

    Fred12i12i

    Firt of all i don't get what you are trying to say. But if you want someone to help you with your pluygin, than this is the wrong forum. MasterDavide_00
     
  5. Offline

    MasterDavide_00

    looking for someone who has had experience before, and he could give me a hand.
    I'm not saying you have to do the plugin to my place.
     
  6. Offline

    Fred12i12i

  7. Offline

    Necrodoom

    Moved to correct section.
     
  8. Offline

    se1by

  9. Offline

    MasterDavide_00

    I solved, thanks
    se1by
    Code:
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerDropItemEvent;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public final class Main extends JavaPlugin implements Listener {
        public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
        }
     
     
    @EventHandler(priority = EventPriority.HIGHEST)
    public boolean onPlayerDrop(PlayerDropItemEvent event) {
        if(event.getPlayer().getAllowFlight()&& !event.getPlayer().hasPermission("nodropfly.drop"))
        {
            event.setCancelled(true);
        } else
        {
            return false;
        }
        event.setCancelled(true);
        return true;
       
        }
    }
     
Thread Status:
Not open for further replies.

Share This Page