Interface CubeMob

All Superinterfaces:
Ageable, Entity, HoverEventSource<HoverEvent.ShowEntity>, LivingEntity, Mob, SchedulerSource, Sound.Emitter, Sound.Source.Provider
All Known Subinterfaces:
MagmaCube, Slime, SulfurCube

public interface CubeMob extends Ageable
A cube that hops around: a slime, a magma cube or a sulfur cube. Its size sets how big it is, its health, its speed and how hard it hits; a cube bigger than 1 splits into cubes of half its size once dead.

A cube has an age like the animals: a baby is half as big as its size says. Only sulfur cubes are born babies and grow up.

Like every entity, change it from the region thread owning its chunk.

Since:
0.1.0
  • Field Details

    • MIN_SIZE

      static final int MIN_SIZE
      The smallest size of a cube.
      Since:
      0.1.0
      See Also:
    • MAX_SIZE

      static final int MAX_SIZE
      The biggest size of a cube.
      Since:
      0.1.0
      See Also:
  • Method Details

    • size

      int size()
      Returns the size of this cube, from 1 to 127.
      Returns:
      the size of this cube, from 1 to 127
      Since:
      0.1.0
    • setSize

      void setSize(int size, boolean healed)
      Gives this cube a size, kept between 1 and 127: its health, speed and what depends on its size follow.
      Parameters:
      size - the size
      healed - true to give it its full new health
      Since:
      0.1.0
    • isTiny

      default boolean isTiny()
      Returns true for a cube of size 1.
      Returns:
      true for a cube of size 1
      Since:
      0.1.0