Answers for "spigot clear player inventory"

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();

});
Posted by: Guest on December-08-2020
0

spigot disable health regeneration

@EventHandler
    public void onPlayerRegainHealth(EntityRegainHealthEvent event) {
        if(event.getRegainReason() == RegainReason.SATIATED || event.getRegainReason() == RegainReason.REGEN)
            event.setCancelled(true);
    }
Posted by: Guest on February-07-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language