Class EntityItemMergeEvent
java.lang.Object
net.minestom.server.event.entity.EntityItemMergeEvent
- All Implemented Interfaces:
Event, CancellableEvent, EntityEvent, EntityInstanceEvent, InstanceEvent
Called when two
ItemEntity are merging their ItemStack together to form a sole entity.-
Constructor Summary
ConstructorsConstructorDescriptionEntityItemMergeEvent(ItemEntity source, ItemEntity merged, ItemStack result) -
Method Summary
Modifier and TypeMethodDescriptionGets theItemEntitywho is receivinggetMerged().Gets the entity who will be merged.Gets the final item stack on the ground.booleanGets if theEventshould be cancelled or not.voidsetCancelled(boolean cancel) Marks theEventas cancelled or not.voidChanges the item stack which will appear on the ground.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityInstanceEvent
getInstance
-
Constructor Details
-
EntityItemMergeEvent
-
-
Method Details
-
getEntity
Gets theItemEntitywho is receivinggetMerged().This can be used to get the final ItemEntity position.
- Specified by:
getEntityin interfaceEntityEvent- Returns:
- the source ItemEntity
-
getMerged
Gets the entity who will be merged.This entity will be removed after the event.
- Returns:
- the merged ItemEntity
-
getResult
-
setResult
Changes the item stack which will appear on the ground.- Parameters:
result- the new item stack
-
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
-