The entity that this trait will be attached to.
Optional
_options: unknownProtected
Readonly
entityThe entity that this trait is attached to.
Readonly
identifierThe identifier of the trait.
Whether the player is on cooldown.
Whether the player is on critical cooldown.
Readonly
playerThe player that this trait is attached to.
Static
Readonly
componentsThe entity component identifiers that this trait is compatible with by default. If empty, the trait will not be initialized by any component.
Static
Readonly
identifierThe identifier of the trait.
Static
Readonly
typesThe entity type identifiers that this trait is compatible with by default.
The amount of ticks till the player can attack again.
The amount of ticks till the player can attack again.
Protected
dimensionThe dimension that the entity is in.
The horizontal knockback of the player.
The horizontal knockback of the player.
The maximum reach of the player horizontally.
The maximum reach of the player horizontally.
The combat property data for the player.
The vertical knockback of the player.
The vertical knockback of the player.
The maximum reach of the player vertically.
The maximum reach of the player vertically.
Clones the entity trait.
The entity to clone the trait to.
A new entity trait.
Gets the calculated damage of the player based on the held item enchantments.
Whether the damage is critical.
The calculated damage.
Gets the calculated horizontal knockback of the player based on the held item enchantments.
The calculated horizontal knockback.
Gets the calculated vertical knockback of the player based on the held item enchantments.
The calculated vertical knockback.
Checks whether the entity is in reach of the player.
The entity to check if it is in reach of the player.
Whether the entity is in reach of the player.
Called when the trait is added to an object.
Optional
onCalled when the player sends a chat message.
The message that the player sent.
Whether the chat message was successful; default is true
Optional
onCalled when the entity that this trait is attached executes a command.
The command execution state.
Whether the command was successful; default is true.
Optional
onCalled when a container that is attached to the entity is updated.
The container that was updated.
Optional
onCalled when the entity that this trait is attached to is killed.
The details of the entity death.
Optional
onCalled when the entity that this trait is attached to is despawned from a dimension.
The details of the entity despawn.
Optional
onCalled when the entity that this trait is attached to falls on a block.
The event properties of the entity falling on a block.
Optional
onCalled when a players gamemode is changed.
The previous gamemode of the player.
Optional
onCalled when the entity that this trait is attached to is interacted with by a player.
The player that interacted with the entity.
The method that the player used to interact with the entity.
Optional
onCalled when the player jumps.
Called when the trait is removed from an object.
Optional
onCalled then the entity that this trait is attached to is spawned into a dimension.
The details of the entity spawn.
Optional
onCalled when the player starts sneaking.
Optional
onCalled when the player starts sprinting.
Optional
onCalled when the player stops sneaking.
Optional
onCalled when the player stops sprinting.
Optional
onCalled when the trait is ticked by the dimension.
The details about the tick event.
Starts the combat cooldown of the player.
Optional
ticks: numberThe amount of ticks to cooldown the player; if not provided, the default combat cooldown will be used.
Starts the critical combat cooldown of the player.
Optional
ticks: numberThe amount of ticks to cooldown the player; if not provided, the default combat cooldown will be used multiplied by 5.
Creates a new instance of the entity trait.