Class SlimeSplitEvent

java.lang.Object
valorless.rarespawns.events.SlimeSplitEvent
All Implemented Interfaces:
org.bukkit.event.Listener

public class SlimeSplitEvent extends Object implements org.bukkit.event.Listener
Bukkit Listener that controls slime splitting behavior for rare slimes.

When a slime that has been marked as a rare entity splits (e.g. upon death or size reduction), this listener checks the associated EntityData configuration to determine whether splitting is permitted (the slimeSplit flag). If splitting is disabled for that rare entity definition, the split event is cancelled preventing child slimes from spawning.

Registration is performed via the static init() method, typically during plugin startup.

  • Constructor Details

    • SlimeSplitEvent

      public SlimeSplitEvent()
  • Method Details

    • init

      public static void init()
      Registers this listener with the server's plugin manager. Should be called during the plugin's onEnable lifecycle.
    • onSlimeSplit

      public void onSlimeSplit(org.bukkit.event.entity.SlimeSplitEvent event)
      Handles the Bukkit SlimeSplitEvent.

      If the splitting slime is a registered rare entity and its configuration specifies slimeSplit = false, the event is cancelled to prevent the natural spawning of smaller slimes. Otherwise the event proceeds normally.

      Parameters:
      event - The slime split event fired by the Bukkit API.