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 Summary
ConstructorsConstructorDescriptionAddEntityToInstanceEvent(@NotNull Instance instance, @NotNull Entity entity) -
Method Summary
Modifier and TypeMethodDescription@NotNull EntityEntity being added.@NotNull InstanceGets the instance.booleanGets if theEventshould be cancelled or not.voidsetCancelled(boolean cancel) Marks theEventas cancelled or not.
-
Constructor Details
-
AddEntityToInstanceEvent
-
-
Method Details
-
getInstance
Description copied from interface:InstanceEventGets the instance.- Specified by:
getInstancein interfaceInstanceEvent- Returns:
- instance
-
getEntity
Entity being added.- Specified by:
getEntityin interfaceEntityEvent- Returns:
- the entity being added
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEventGets if theEventshould be cancelled or not.- Specified by:
isCancelledin interfaceCancellableEvent- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEventMarks theEventas cancelled or not.- Specified by:
setCancelledin interfaceCancellableEvent- Parameters:
cancel- true if the event should be cancelled, false otherwise
-