Interface CubeSplitEvent

All Superinterfaces:
Cancellable, Event, MobEvent

public interface CubeSplitEvent extends MobEvent, Cancellable
Fired when a cube bigger than the smallest (a slime, a magma cube or a sulfur cube) dies and is about to split into smaller ones, half its size.

Cancelling it, or setting the count to 0, leaves nothing behind.

Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the size of each cube it splits into.
    int
    Returns how many cubes it splits into.
    mob()
    Returns the cube that died.
    void
    setCount(int count)
    Changes how many cubes it splits into.

    Methods inherited from interface Cancellable

    isCancelled, setCancelled
  • Method Details

    • mob

      CubeMob mob()
      Returns the cube that died.
      Specified by:
      mob in interface MobEvent
      Returns:
      the cube that died
      Since:
      0.1.0
    • count

      int count()
      Returns how many cubes it splits into.: at first between 2 and 4 for a slime or a magma cube, 2 for a sulfur cube
      Returns:
      how many cubes it splits into
      Since:
      0.1.0
    • setCount

      void setCount(int count)
      Changes how many cubes it splits into.
      Parameters:
      count - the new count, 0 or more
      Throws:
      IllegalArgumentException - if the count is negative
      Since:
      0.1.0
    • childSize

      int childSize()
      Returns the size of each cube it splits into.
      Returns:
      the size of each cube it splits into
      Since:
      0.1.0