Class AddEntityToInstanceEvent

java.lang.Object
net.minestom.server.event.instance.AddEntityToInstanceEvent
All Implemented Interfaces:
Event, CancellableEvent, EntityEvent, InstanceEvent

public class AddEntityToInstanceEvent extends Object implements InstanceEvent, EntityEvent, CancellableEvent
Called by an Instance when an entity is added to it. Can be used attach data.
  • Constructor Details

    • AddEntityToInstanceEvent

      public AddEntityToInstanceEvent(@NotNull @NotNull Instance instance, @NotNull @NotNull Entity entity)
  • Method Details

    • getInstance

      @NotNull public @NotNull Instance getInstance()
      Description copied from interface: InstanceEvent
      Gets the instance.
      Specified by:
      getInstance in interface InstanceEvent
      Returns:
      instance
    • getEntity

      @NotNull public @NotNull Entity getEntity()
      Entity being added.
      Specified by:
      getEntity in interface EntityEvent
      Returns:
      the entity being added
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      Gets if the Event should be cancelled or not.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      true if the event should be cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: CancellableEvent
      Marks the Event as cancelled or not.
      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      cancel - true if the event should be cancelled, false otherwise