promotional bannermobile promotional banner

DropPrevent

Abandoned
Small and simple plugin that stops players from dropping items manually.
<p>Icon for DropPrevent</p>

Icon for DropPrevent

Description

This is a very small [only 1.17kb file size], very simple plugin that stops any player who does not have dropprevent.allowdrop from dropping items manually. Players will still drop items on death. Players will not be allowed to drop items by default, a player HAS to have the permission dropprevent.allowdrop in order to drop items, which means ops/players with all permissions will be able to drop with no need to edit permissions.

This is literally the source code, there is no config necessary, and it will work right out of the box. I think i made it as small as possible.

package com.K3R3P0.DropPrevent;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class DropPrevent extends JavaPlugin implements Listener{
	public void onEnable() {
		PluginManager pm = getServer().getPluginManager();
		pm.registerEvents(this, this);
	}
	
	@EventHandler
	public void onPlayerDropItem(PlayerDropItemEvent event) {
		if(!event.getPlayer().hasPermission("dropprevent.allowdrop")) {event.setCancelled(true);}
	}
}

Thanks to chaseoes for helping me make this plugin even smaller!

I made this for my own needs, but figured i'd release it for anyone else who needs a simple solution to item dropping, if you need a more advanced anti-drop plugin, i suggest AntiDrops :)

The DropPrevent Team

profile avatar
  • 2
    Projects
  • 8.1K
    Downloads

More from _ForgeUser7664779

  • ButtonsPlus project image

    ButtonsPlus

    • 1.5K
    • Bukkit Plugins

    ButtonsPlus allows you to assign various commands and actions to buttons without the need to type any commands!

    • 1.5K
    • February 7, 2013
    • Bukkit Plugins
    • +3
  • ButtonsPlus project image

    ButtonsPlus

    • 7.2K
    • Bukkit Plugins

    ◄Buttons That do what YOU want them to do!►

    • 7.2K
    • April 19, 2012
    • Bukkit Plugins
    • +3
  • ButtonsPlus project image

    ButtonsPlus

    • 1.5K
    • Bukkit Plugins

    ButtonsPlus allows you to assign various commands and actions to buttons without the need to type any commands!

    • 1.5K
    • February 7, 2013
    • Bukkit Plugins
    • +3
  • ButtonsPlus project image

    ButtonsPlus

    • 7.2K
    • Bukkit Plugins

    ◄Buttons That do what YOU want them to do!►

    • 7.2K
    • April 19, 2012
    • Bukkit Plugins
    • +3