What is the name of the Minecraft permission for dropping?

An
- in Plugins
6

I would like to program a plugin that prevents players from dropping without an op

Me

I don't even think that something has a permission (?)

I would check for drops with an event, and if the player does not have permissions, cancel the event.

An

What's the code for that?

gl

Squeezed into one line:

@EventHandler void onDrop (PlayerDropItemEvent e) {if (! E.getPlayer (). IsOp ()) e.setCancelled (true); }

An

I did it, but when I want to register it, the class is not displayed

gl

How did you register the event?

Me

You register a PlayerDropItemEvent, check the permissions and cancel…

in approximately

class HandleDrops implements Listener {
@EventHandler
public void onDrop (PlayerDropItemEvent event) {
// check here for permissions
event.setCancelled (true);
}
}

The code is just written down, not tested.

https://hub.spigotmc.org/...Event.html