spigot clear player inventory code example
Example 1: spigot remove every entity
//Get all entities
Bukkit.getWorld("world").getEntities().forEach(entity -> {
//Check if entity isnt a player
if(!(entity instanceof Player))
entity.remove();
});
Example 2: spigot disable health regeneration
@EventHandler
public void onPlayerRegainHealth(EntityRegainHealthEvent event) {
if(event.getRegainReason() == RegainReason.SATIATED || event.getRegainReason() == RegainReason.REGEN)
event.setCancelled(true);
}