DontLoseYourSphere (NoPlayerHeads)
PluginGPL-3.0-only

DontLoseYourSphere (NoPlayerHeads)

A simple plugin to prevent players from losing their sphere's buffs by placing it on the ground.

8
Downloads
1
Followers
3 months ago
Updated
📦
4
Versions

📖About DontLoseYourSphere (NoPlayerHeads)

DontLoseYourSphere (also NoPlayerHeads)

A simple plugin to prevent players from losing their sphere by placing it on the ground.

Plugin preview

How does it work?

Because all players equip the sphere in their offhand, they have a change of accidentaly placing it down and losing all the buffs of the sphere and the money, which they spent on the sphere itself. This plugin prevents all of that by cancelling the place event:

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerHeadPlace(BlockPlaceEvent event) {
    Material type = event.getBlockPlaced().getType();

    if (type == Material.PLAYER_HEAD ||
        type == Material.PLAYER_WALL_HEAD ||
        (type.name().startsWith("PLAYER_") && type.name().endsWith("HEAD"))) {

        event.setCancelled(true);

        ...
        }
    }
}