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 Link icon

    • AddEntityToInstanceEvent Link icon

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

    • getInstance Link icon

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

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

      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 Link icon

      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