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
ConstructorDescriptionAddEntityToInstanceEvent
(@NotNull Instance instance, @NotNull Entity entity) -
Method Summary
Modifier and TypeMethodDescription@NotNull Entity
Entity being added.@NotNull Instance
Gets the instance.boolean
Gets if theEvent
should be cancelled or not.void
setCancelled
(boolean cancel) Marks theEvent
as cancelled or not.
-
Constructor Details
-
AddEntityToInstanceEvent
-
-
Method Details
-
getInstance
Description copied from interface:InstanceEvent
Gets the instance.- Specified by:
getInstance
in interfaceInstanceEvent
- Returns:
- instance
-
getEntity
Entity being added.- Specified by:
getEntity
in interfaceEntityEvent
- Returns:
- the entity being added
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEvent
Gets if theEvent
should be cancelled or not.- Specified by:
isCancelled
in interfaceCancellableEvent
- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEvent
Marks theEvent
as cancelled or not.- Specified by:
setCancelled
in interfaceCancellableEvent
- Parameters:
cancel
- true if the event should be cancelled, false otherwise
-