Package io.papermc.paper.event.entity
Class ItemTransportingEntityValidateTargetEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.ItemTransportingEntityValidateTargetEvent
Called when an item-transporting entity (typically a
CopperGolem
,
although other entities may be possible through non-API means)
is searching for or validating an existing target container block for
taking or depositing items.
This may be called multiple times per entity per tick, so listeners should be careful to implement checks in an efficient manner.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
FieldsFields inherited from class org.bukkit.event.entity.EntityEvent
entity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBlock()
Gets the target block the entity is validating.static HandlerList
boolean
Gets if the entity is allowed to usegetBlock()
as a target.void
setAllowed
(boolean allowed) Sets if the entity is allowed to usegetBlock()
as a target.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityType
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Field Details
-
HANDLER_LIST
-
-
Constructor Details
-
ItemTransportingEntityValidateTargetEvent
-
-
Method Details
-
setAllowed
public void setAllowed(boolean allowed) Sets if the entity is allowed to usegetBlock()
as a target.- Parameters:
allowed
- whether the target is allowed
-
isAllowed
public boolean isAllowed()Gets if the entity is allowed to usegetBlock()
as a target.- Returns:
- true if the target is allowed
-
getBlock
Gets the target block the entity is validating.- Returns:
- the target block
-
getHandlerList
-
getHandlers
- Specified by:
getHandlers
in classEvent
-