Compatibility
Minecraft: Java Edition
1.21.x
1.20.x
1.19.x
Platforms
Links
Creators
Details
Licensed GPL-3.0-only
Published 4 months ago
DontLoseYourSphere (also NoPlayerHeads)
A simple plugin to prevent players from losing their sphere by placing it on the ground.

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 effects of the sphere and the money 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);
...
}
}
}


