Class PlayerToggleEntityAgeLockEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerToggleEntityAgeLockEvent
- All Implemented Interfaces:
Cancellable
Called when a player toggles the age lock of an entity using an item.
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerToggleEntityAgeLockEvent(Player player, LivingEntity entity, ItemStack item, EquipmentSlot hand, boolean ageLocked) -
Method Summary
Modifier and TypeMethodDescriptionReturns the entity that is having its age locked or unlocked.getHand()Returns the hand being used to toggle the age lock of the entity.static HandlerListgetItem()Returns the item being used to toggle the age lock of the entity.booleanReturns whether the age of the entity is going to be locked or not.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.Methods inherited from class PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerToggleEntityAgeLockEvent
@Internal public PlayerToggleEntityAgeLockEvent(Player player, LivingEntity entity, ItemStack item, EquipmentSlot hand, boolean ageLocked)
-
-
Method Details
-
getEntity
Returns the entity that is having its age locked or unlocked.- Returns:
- the entity that is having its age locked or unlocked
-
getItem
Returns the item being used to toggle the age lock of the entity.- Returns:
- the item being used to toggle the age lock of the entity
-
getHand
Returns the hand being used to toggle the age lock of the entity.- Returns:
- the hand being used to toggle the age lock of the entity
-
isAgeLocked
public boolean isAgeLocked()Returns whether the age of the entity is going to be locked or not.- Returns:
- whether the age of the entity is going to be locked or not
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-