Interface MobChangeBlockEvent

All Superinterfaces:
Cancellable, Event, MobEvent

public interface MobChangeBlockEvent extends MobEvent, Cancellable
Fired before a mob changes a block of its world: an enderman picking a block up or putting it down, a silverfish slipping into a block or waking out of it, a zombie breaking a door, a sheep eating grass.

Cancelling it leaves the block as it is, and the mob does without: an enderman keeps its hands empty or full, a silverfish stays out, a door stays up. A sheep that grazed still grows its wool back.

Since:
0.1.0
  • Method Details

    • position

      BlockPosition position()
      Returns where the block lies, in the world of the mob.
      Returns:
      where the block lies, in the world of the mob
      Since:
      0.1.0
    • from

      BlockData from()
      Returns the block there now.
      Returns:
      the block there now
      Since:
      0.1.0
    • to

      BlockData to()
      Returns the block the mob is about to put there.
      Returns:
      the block the mob is about to put there
      Since:
      0.1.0