Class Entity

All Implemented Interfaces:
Metadatable, Cloneable
Direct Known Subclasses:
EntityAreaEffectCloud, EntityArmorStand, EntityEndCrystal, EntityFallingBlock, EntityFirework, EntityHanging, EntityItem, EntityLightning, EntityLiving, EntityPrimedTNT, EntityProjectile, EntityVehicle, EntityXPOrb

@PowerNukkitDifference(since="1.4.0.0-PN", info="All DATA constants were made dynamic because they have tendency to change on Minecraft updates, these dynamic calls will avoid the need of plugin recompilations after Minecraft updates that shifts the data values") public abstract class Entity extends Location implements Metadatable
Author:
MagicDroidX
  • Field Details

    • EMPTY_ARRAY

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static final Entity[] EMPTY_ARRAY
    • NETWORK_ID

      public static final int NETWORK_ID
      See Also:
    • DATA_TYPE_BYTE

      public static final int DATA_TYPE_BYTE
      See Also:
    • DATA_TYPE_SHORT

      public static final int DATA_TYPE_SHORT
      See Also:
    • DATA_TYPE_INT

      public static final int DATA_TYPE_INT
      See Also:
    • DATA_TYPE_FLOAT

      public static final int DATA_TYPE_FLOAT
      See Also:
    • DATA_TYPE_STRING

      public static final int DATA_TYPE_STRING
      See Also:
    • DATA_TYPE_NBT

      public static final int DATA_TYPE_NBT
      See Also:
    • DATA_TYPE_POS

      public static final int DATA_TYPE_POS
      See Also:
    • DATA_TYPE_LONG

      public static final int DATA_TYPE_LONG
      See Also:
    • DATA_TYPE_VECTOR3F

      public static final int DATA_TYPE_VECTOR3F
      See Also:
    • DATA_FLAGS

      public static final int DATA_FLAGS
    • DATA_HEALTH

      public static final int DATA_HEALTH
    • DATA_VARIANT

      public static final int DATA_VARIANT
    • DATA_COLOR

      public static final int DATA_COLOR
    • DATA_COLOUR

      public static final int DATA_COLOUR
    • DATA_NAMETAG

      public static final int DATA_NAMETAG
    • DATA_OWNER_EID

      public static final int DATA_OWNER_EID
    • DATA_TARGET_EID

      public static final int DATA_TARGET_EID
    • DATA_AIR

      public static final int DATA_AIR
    • DATA_POTION_COLOR

      public static final int DATA_POTION_COLOR
    • DATA_POTION_AMBIENT

      public static final int DATA_POTION_AMBIENT
    • DATA_JUMP_DURATION

      public static final int DATA_JUMP_DURATION
    • DATA_HURT_TIME

      public static final int DATA_HURT_TIME
    • DATA_HURT_DIRECTION

      public static final int DATA_HURT_DIRECTION
    • DATA_PADDLE_TIME_LEFT

      public static final int DATA_PADDLE_TIME_LEFT
    • DATA_PADDLE_TIME_RIGHT

      public static final int DATA_PADDLE_TIME_RIGHT
    • DATA_EXPERIENCE_VALUE

      public static final int DATA_EXPERIENCE_VALUE
    • DATA_DISPLAY_ITEM

      public static final int DATA_DISPLAY_ITEM
    • DATA_DISPLAY_OFFSET

      public static final int DATA_DISPLAY_OFFSET
    • DATA_HAS_DISPLAY

      public static final int DATA_HAS_DISPLAY
    • DATA_SWELL

      @Since("1.2.0.0-PN") public static final int DATA_SWELL
    • DATA_OLD_SWELL

      @Since("1.2.0.0-PN") public static final int DATA_OLD_SWELL
    • DATA_SWELL_DIR

      @Since("1.2.0.0-PN") public static final int DATA_SWELL_DIR
    • DATA_CHARGE_AMOUNT

      @Since("1.2.0.0-PN") public static final int DATA_CHARGE_AMOUNT
    • DATA_ENDERMAN_HELD_RUNTIME_ID

      public static final int DATA_ENDERMAN_HELD_RUNTIME_ID
    • DATA_CLIENT_EVENT

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static final int DATA_CLIENT_EVENT
    • DATA_ENTITY_AGE

      @Deprecated @DeprecationDetails(since="1.4.0.0-PN", by="PowerNukkit", reason="Apparently this the ID 24 was reused to represent CLIENT_EVENT but Cloudburst Nukkit is still mapping it as age") public static final int DATA_ENTITY_AGE
      Deprecated.
    • DATA_PLAYER_FLAG_SLEEP

      public static final int DATA_PLAYER_FLAG_SLEEP
      See Also:
    • DATA_PLAYER_FLAG_DEAD

      public static final int DATA_PLAYER_FLAG_DEAD
      See Also:
    • DATA_USING_ITEM

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static final int DATA_USING_ITEM
    • DATA_PLAYER_FLAGS

      public static final int DATA_PLAYER_FLAGS
    • DATA_PLAYER_INDEX

      @Since("1.2.0.0-PN") public static final int DATA_PLAYER_INDEX
    • DATA_PLAYER_BED_POSITION

      public static final int DATA_PLAYER_BED_POSITION
    • DATA_PLAYER_BUTTON_TEXT

      public static final int DATA_PLAYER_BUTTON_TEXT
      See Also:
    • DATA_FIREBALL_POWER_X

      public static final int DATA_FIREBALL_POWER_X
    • DATA_FIREBALL_POWER_Y

      public static final int DATA_FIREBALL_POWER_Y
    • DATA_FIREBALL_POWER_Z

      public static final int DATA_FIREBALL_POWER_Z
    • DATA_AUX_POWER

      @Since("1.2.0.0-PN") public static final int DATA_AUX_POWER
    • DATA_FISH_X

      @Since("1.2.0.0-PN") public static final int DATA_FISH_X
    • DATA_FISH_Z

      @Since("1.2.0.0-PN") public static final int DATA_FISH_Z
    • DATA_FISH_ANGLE

      @Since("1.2.0.0-PN") public static final int DATA_FISH_ANGLE
    • DATA_POTION_AUX_VALUE

      public static final int DATA_POTION_AUX_VALUE
    • DATA_LEAD_HOLDER_EID

      public static final int DATA_LEAD_HOLDER_EID
    • DATA_SCALE

      public static final int DATA_SCALE
    • DATA_HAS_NPC_COMPONENT

      @Since("1.2.0.0-PN") public static final int DATA_HAS_NPC_COMPONENT
    • DATA_NPC_SKIN_DATA

      public static final int DATA_NPC_SKIN_DATA
    • DATA_NPC_ACTIONS

      public static final int DATA_NPC_ACTIONS
    • DATA_MAX_AIR

      public static final int DATA_MAX_AIR
    • DATA_MARK_VARIANT

      public static final int DATA_MARK_VARIANT
    • DATA_CONTAINER_TYPE

      public static final int DATA_CONTAINER_TYPE
    • DATA_CONTAINER_BASE_SIZE

      public static final int DATA_CONTAINER_BASE_SIZE
    • DATA_CONTAINER_EXTRA_SLOTS_PER_STRENGTH

      public static final int DATA_CONTAINER_EXTRA_SLOTS_PER_STRENGTH
    • DATA_BLOCK_TARGET

      public static final int DATA_BLOCK_TARGET
    • DATA_WITHER_INVULNERABLE_TICKS

      public static final int DATA_WITHER_INVULNERABLE_TICKS
    • DATA_WITHER_TARGET_1

      public static final int DATA_WITHER_TARGET_1
    • DATA_WITHER_TARGET_2

      public static final int DATA_WITHER_TARGET_2
    • DATA_WITHER_TARGET_3

      public static final int DATA_WITHER_TARGET_3
    • DATA_AERIAL_ATTACK

      @Since("1.2.0.0-PN") public static final int DATA_AERIAL_ATTACK
    • DATA_BOUNDING_BOX_WIDTH

      public static final int DATA_BOUNDING_BOX_WIDTH
    • DATA_BOUNDING_BOX_HEIGHT

      public static final int DATA_BOUNDING_BOX_HEIGHT
    • DATA_FUSE_LENGTH

      public static final int DATA_FUSE_LENGTH
    • DATA_RIDER_SEAT_POSITION

      public static final int DATA_RIDER_SEAT_POSITION
    • DATA_RIDER_ROTATION_LOCKED

      public static final int DATA_RIDER_ROTATION_LOCKED
    • DATA_RIDER_MAX_ROTATION

      public static final int DATA_RIDER_MAX_ROTATION
    • DATA_RIDER_MIN_ROTATION

      public static final int DATA_RIDER_MIN_ROTATION
    • DATA_RIDER_ROTATION_OFFSET

      @Since("1.4.0.0-PN") public static final int DATA_RIDER_ROTATION_OFFSET
    • DATA_AREA_EFFECT_CLOUD_RADIUS

      public static final int DATA_AREA_EFFECT_CLOUD_RADIUS
    • DATA_AREA_EFFECT_CLOUD_WAITING

      public static final int DATA_AREA_EFFECT_CLOUD_WAITING
    • DATA_AREA_EFFECT_CLOUD_PARTICLE_ID

      public static final int DATA_AREA_EFFECT_CLOUD_PARTICLE_ID
    • DATA_SHULKER_PEEK_ID

      @Since("1.2.0.0-PN") public static final int DATA_SHULKER_PEEK_ID
    • DATA_SHULKER_ATTACH_FACE

      public static final int DATA_SHULKER_ATTACH_FACE
    • DATA_SHULKER_ATTACHED

      @Since("1.2.0.0-PN") public static final int DATA_SHULKER_ATTACHED
    • DATA_SHULKER_ATTACH_POS

      public static final int DATA_SHULKER_ATTACH_POS
    • DATA_TRADING_PLAYER_EID

      public static final int DATA_TRADING_PLAYER_EID
    • DATA_TRADING_CAREER

      @Since("1.2.0.0-PN") public static final int DATA_TRADING_CAREER
    • DATA_HAS_COMMAND_BLOCK

      @Since("1.2.0.0-PN") public static final int DATA_HAS_COMMAND_BLOCK
    • DATA_COMMAND_BLOCK_COMMAND

      @Since("1.2.0.0-PN") public static final int DATA_COMMAND_BLOCK_COMMAND
    • DATA_COMMAND_BLOCK_LAST_OUTPUT

      public static final int DATA_COMMAND_BLOCK_LAST_OUTPUT
    • DATA_COMMAND_BLOCK_TRACK_OUTPUT

      public static final int DATA_COMMAND_BLOCK_TRACK_OUTPUT
    • DATA_CONTROLLING_RIDER_SEAT_NUMBER

      public static final int DATA_CONTROLLING_RIDER_SEAT_NUMBER
    • DATA_STRENGTH

      public static final int DATA_STRENGTH
    • DATA_MAX_STRENGTH

      public static final int DATA_MAX_STRENGTH
    • DATA_SPELL_CASTING_COLOR

      @Since("1.2.0.0-PN") public static final int DATA_SPELL_CASTING_COLOR
    • DATA_LIMITED_LIFE

      public static final int DATA_LIMITED_LIFE
    • DATA_ARMOR_STAND_POSE_INDEX

      public static final int DATA_ARMOR_STAND_POSE_INDEX
    • DATA_ENDER_CRYSTAL_TIME_OFFSET

      public static final int DATA_ENDER_CRYSTAL_TIME_OFFSET
    • DATA_ALWAYS_SHOW_NAMETAG

      public static final int DATA_ALWAYS_SHOW_NAMETAG
    • DATA_COLOR_2

      public static final int DATA_COLOR_2
    • DATA_NAME_AUTHOR

      @Since("1.2.0.0-PN") public static final int DATA_NAME_AUTHOR
    • DATA_SCORE_TAG

      public static final int DATA_SCORE_TAG
    • DATA_BALLOON_ATTACHED_ENTITY

      public static final int DATA_BALLOON_ATTACHED_ENTITY
    • DATA_PUFFERFISH_SIZE

      public static final int DATA_PUFFERFISH_SIZE
    • DATA_BUBBLE_TIME

      @Since("1.2.0.0-PN") public static final int DATA_BUBBLE_TIME
    • DATA_AGENT

      @Since("1.2.0.0-PN") public static final int DATA_AGENT
    • DATA_SITTING_AMOUNT

      @Since("1.2.0.0-PN") public static final int DATA_SITTING_AMOUNT
    • DATA_SITTING_AMOUNT_PREVIOUS

      @Since("1.2.0.0-PN") public static final int DATA_SITTING_AMOUNT_PREVIOUS
    • DATA_EATING_COUNTER

      @Since("1.2.0.0-PN") public static final int DATA_EATING_COUNTER
    • DATA_FLAGS_EXTENDED

      public static final int DATA_FLAGS_EXTENDED
    • DATA_LAYING_AMOUNT

      @Since("1.2.0.0-PN") public static final int DATA_LAYING_AMOUNT
    • DATA_LAYING_AMOUNT_PREVIOUS

      @Since("1.2.0.0-PN") public static final int DATA_LAYING_AMOUNT_PREVIOUS
    • DATA_DURATION

      @Since("1.2.0.0-PN") public static final int DATA_DURATION
    • DATA_SPAWN_TIME

      @Since("1.2.0.0-PN") public static final int DATA_SPAWN_TIME
    • DATA_CHANGE_RATE

      @Since("1.2.0.0-PN") public static final int DATA_CHANGE_RATE
    • DATA_CHANGE_ON_PICKUP

      @Since("1.2.0.0-PN") public static final int DATA_CHANGE_ON_PICKUP
    • DATA_PICKUP_COUNT

      @Since("1.2.0.0-PN") public static final int DATA_PICKUP_COUNT
    • DATA_INTERACTIVE_TAG

      @Since("1.4.0.0-PN") public static final int DATA_INTERACTIVE_TAG
    • DATA_INTERACT_TEXT

      @PowerNukkitOnly("Removed from Cloudburst Nukkit") @Deprecated @DeprecationDetails(by="Cloudburst Nukkit", reason="Duplicated and removed", replaceWith="DATA_INTERACTIVE_TAG", since="FUTURE") @Since("1.2.0.0-PN") public static final int DATA_INTERACT_TEXT
      Deprecated.
    • DATA_TRADE_TIER

      public static final int DATA_TRADE_TIER
    • DATA_MAX_TRADE_TIER

      public static final int DATA_MAX_TRADE_TIER
    • DATA_TRADE_EXPERIENCE

      @Since("1.2.0.0-PN") public static final int DATA_TRADE_EXPERIENCE
    • DATA_SKIN_ID

      @Since("1.1.1.0-PN") public static final int DATA_SKIN_ID
    • DATA_SPAWNING_FRAMES

      @Since("1.2.0.0-PN") public static final int DATA_SPAWNING_FRAMES
    • DATA_COMMAND_BLOCK_TICK_DELAY

      @Since("1.2.0.0-PN") public static final int DATA_COMMAND_BLOCK_TICK_DELAY
    • DATA_COMMAND_BLOCK_EXECUTE_ON_FIRST_TICK

      @Since("1.2.0.0-PN") public static final int DATA_COMMAND_BLOCK_EXECUTE_ON_FIRST_TICK
    • DATA_AMBIENT_SOUND_INTERVAL

      @Since("1.2.0.0-PN") public static final int DATA_AMBIENT_SOUND_INTERVAL
    • DATA_AMBIENT_SOUND_INTERVAL_RANGE

      @Since("1.3.0.0-PN") public static final int DATA_AMBIENT_SOUND_INTERVAL_RANGE
    • DATA_AMBIENT_SOUND_EVENT_NAME

      @Since("1.2.0.0-PN") public static final int DATA_AMBIENT_SOUND_EVENT_NAME
    • DATA_FALL_DAMAGE_MULTIPLIER

      @Since("1.2.0.0-PN") public static final int DATA_FALL_DAMAGE_MULTIPLIER
    • DATA_NAME_RAW_TEXT

      @Since("1.2.0.0-PN") public static final int DATA_NAME_RAW_TEXT
    • DATA_CAN_RIDE_TARGET

      @Since("1.2.0.0-PN") public static final int DATA_CAN_RIDE_TARGET
    • DATA_LOW_TIER_CURED_DISCOUNT

      @Since("1.3.0.0-PN") public static final int DATA_LOW_TIER_CURED_DISCOUNT
    • DATA_HIGH_TIER_CURED_DISCOUNT

      @Since("1.3.0.0-PN") public static final int DATA_HIGH_TIER_CURED_DISCOUNT
    • DATA_NEARBY_CURED_DISCOUNT

      @Since("1.3.0.0-PN") public static final int DATA_NEARBY_CURED_DISCOUNT
    • DATA_NEARBY_CURED_DISCOUNT_TIMESTAMP

      @Since("1.3.0.0-PN") public static final int DATA_NEARBY_CURED_DISCOUNT_TIMESTAMP
    • DATA_HITBOX

      @Since("1.3.0.0-PN") public static final int DATA_HITBOX
    • DATA_IS_BUOYANT

      @Since("1.3.0.0-PN") public static final int DATA_IS_BUOYANT
    • DATA_FREEZING_EFFECT_STRENGTH

      @Since("1.4.0.0-PN") public static final int DATA_FREEZING_EFFECT_STRENGTH
    • DATA_BUOYANCY_DATA

      @Since("1.3.0.0-PN") public static final int DATA_BUOYANCY_DATA
    • DATA_GOAT_HORN_COUNT

      @Since("1.4.0.0-PN") public static final int DATA_GOAT_HORN_COUNT
    • DATA_BASE_RUNTIME_ID

      @Since("1.5.0.0-PN") public static final int DATA_BASE_RUNTIME_ID
    • DATA_MOVEMENT_SOUND_DISTANCE_OFFSET

      public static final int DATA_MOVEMENT_SOUND_DISTANCE_OFFSET
    • DATA_HEARTBEAT_INTERVAL_TICKS

      public static final int DATA_HEARTBEAT_INTERVAL_TICKS
    • DATA_HEARTBEAT_SOUND_EVENT

      public static final int DATA_HEARTBEAT_SOUND_EVENT
    • DATA_PLAYER_LAST_DEATH_POS

      @Since("1.19.40-r3") public static final int DATA_PLAYER_LAST_DEATH_POS
      See Also:
    • DATA_PLAYER_LAST_DEATH_DIMENSION

      @Since("1.19.40-r3") public static final int DATA_PLAYER_LAST_DEATH_DIMENSION
      See Also:
    • DATA_PLAYER_HAS_DIED

      @Since("1.19.40-r3") public static final int DATA_PLAYER_HAS_DIED
      See Also:
    • DATA_COLLISION_BOX

      @Since("1.20.10-r1") public static final int DATA_COLLISION_BOX
      See Also:
    • DATA_FLAG_ONFIRE

      public static final int DATA_FLAG_ONFIRE
    • DATA_FLAG_SNEAKING

      public static final int DATA_FLAG_SNEAKING
    • DATA_FLAG_RIDING

      public static final int DATA_FLAG_RIDING
    • DATA_FLAG_SPRINTING

      public static final int DATA_FLAG_SPRINTING
    • DATA_FLAG_ACTION

      public static final int DATA_FLAG_ACTION
    • DATA_FLAG_INVISIBLE

      public static final int DATA_FLAG_INVISIBLE
    • DATA_FLAG_TEMPTED

      public static final int DATA_FLAG_TEMPTED
    • DATA_FLAG_INLOVE

      public static final int DATA_FLAG_INLOVE
    • DATA_FLAG_SADDLED

      public static final int DATA_FLAG_SADDLED
    • DATA_FLAG_POWERED

      public static final int DATA_FLAG_POWERED
    • DATA_FLAG_IGNITED

      public static final int DATA_FLAG_IGNITED
    • DATA_FLAG_BABY

      public static final int DATA_FLAG_BABY
    • DATA_FLAG_CONVERTING

      public static final int DATA_FLAG_CONVERTING
    • DATA_FLAG_CRITICAL

      public static final int DATA_FLAG_CRITICAL
    • DATA_FLAG_CAN_SHOW_NAMETAG

      public static final int DATA_FLAG_CAN_SHOW_NAMETAG
    • DATA_FLAG_ALWAYS_SHOW_NAMETAG

      public static final int DATA_FLAG_ALWAYS_SHOW_NAMETAG
    • DATA_FLAG_IMMOBILE

      public static final int DATA_FLAG_IMMOBILE
    • DATA_FLAG_NO_AI

      public static final int DATA_FLAG_NO_AI
    • DATA_FLAG_SILENT

      public static final int DATA_FLAG_SILENT
    • DATA_FLAG_WALLCLIMBING

      public static final int DATA_FLAG_WALLCLIMBING
    • DATA_FLAG_CAN_CLIMB

      public static final int DATA_FLAG_CAN_CLIMB
    • DATA_FLAG_SWIMMER

      public static final int DATA_FLAG_SWIMMER
    • DATA_FLAG_CAN_FLY

      public static final int DATA_FLAG_CAN_FLY
    • DATA_FLAG_WALKER

      public static final int DATA_FLAG_WALKER
    • DATA_FLAG_RESTING

      public static final int DATA_FLAG_RESTING
    • DATA_FLAG_SITTING

      public static final int DATA_FLAG_SITTING
    • DATA_FLAG_ANGRY

      public static final int DATA_FLAG_ANGRY
    • DATA_FLAG_INTERESTED

      public static final int DATA_FLAG_INTERESTED
    • DATA_FLAG_CHARGED

      public static final int DATA_FLAG_CHARGED
    • DATA_FLAG_TAMED

      public static final int DATA_FLAG_TAMED
    • DATA_FLAG_ORPHANED

      public static final int DATA_FLAG_ORPHANED
    • DATA_FLAG_LEASHED

      public static final int DATA_FLAG_LEASHED
    • DATA_FLAG_SHEARED

      public static final int DATA_FLAG_SHEARED
    • DATA_FLAG_GLIDING

      public static final int DATA_FLAG_GLIDING
    • DATA_FLAG_ELDER

      public static final int DATA_FLAG_ELDER
    • DATA_FLAG_MOVING

      public static final int DATA_FLAG_MOVING
    • DATA_FLAG_BREATHING

      public static final int DATA_FLAG_BREATHING
    • DATA_FLAG_CHESTED

      public static final int DATA_FLAG_CHESTED
    • DATA_FLAG_STACKABLE

      public static final int DATA_FLAG_STACKABLE
    • DATA_FLAG_SHOWBASE

      public static final int DATA_FLAG_SHOWBASE
    • DATA_FLAG_REARING

      public static final int DATA_FLAG_REARING
    • DATA_FLAG_VIBRATING

      public static final int DATA_FLAG_VIBRATING
    • DATA_FLAG_IDLING

      public static final int DATA_FLAG_IDLING
    • DATA_FLAG_EVOKER_SPELL

      public static final int DATA_FLAG_EVOKER_SPELL
    • DATA_FLAG_CHARGE_ATTACK

      public static final int DATA_FLAG_CHARGE_ATTACK
    • DATA_FLAG_WASD_CONTROLLED

      public static final int DATA_FLAG_WASD_CONTROLLED
    • DATA_FLAG_CAN_POWER_JUMP

      public static final int DATA_FLAG_CAN_POWER_JUMP
    • DATA_FLAG_CAN_DASH

      public static final int DATA_FLAG_CAN_DASH
    • DATA_FLAG_LINGER

      public static final int DATA_FLAG_LINGER
    • DATA_FLAG_HAS_COLLISION

      public static final int DATA_FLAG_HAS_COLLISION
    • DATA_FLAG_GRAVITY

      public static final int DATA_FLAG_GRAVITY
    • DATA_FLAG_FIRE_IMMUNE

      public static final int DATA_FLAG_FIRE_IMMUNE
    • DATA_FLAG_DANCING

      public static final int DATA_FLAG_DANCING
    • DATA_FLAG_ENCHANTED

      public static final int DATA_FLAG_ENCHANTED
    • DATA_FLAG_SHOW_TRIDENT_ROPE

      public static final int DATA_FLAG_SHOW_TRIDENT_ROPE
    • DATA_FLAG_CONTAINER_PRIVATE

      public static final int DATA_FLAG_CONTAINER_PRIVATE
    • DATA_FLAG_IS_TRANSFORMING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_IS_TRANSFORMING
    • DATA_FLAG_SPIN_ATTACK

      public static final int DATA_FLAG_SPIN_ATTACK
    • DATA_FLAG_SWIMMING

      public static final int DATA_FLAG_SWIMMING
    • DATA_FLAG_BRIBED

      public static final int DATA_FLAG_BRIBED
    • DATA_FLAG_PREGNANT

      public static final int DATA_FLAG_PREGNANT
    • DATA_FLAG_LAYING_EGG

      public static final int DATA_FLAG_LAYING_EGG
    • DATA_FLAG_RIDER_CAN_PICK

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_RIDER_CAN_PICK
    • DATA_FLAG_TRANSITION_SITTING

      @PowerNukkitOnly @Since("1.2.0.0-PN") public static final int DATA_FLAG_TRANSITION_SITTING
    • DATA_FLAG_TRANSITION_SETTING

      @Deprecated @DeprecationDetails(reason="This is from NukkitX but it has a typo which we can\'t remove unless NukkitX removes from their side.", since="1.2.0.0-PN", replaceWith="DATA_FLAG_TRANSITION_SITTING") @Since("1.2.0.0-PN") public static final int DATA_FLAG_TRANSITION_SETTING
      Deprecated.
      This is from NukkitX but it has a typo which we can't remove unless NukkitX removes from their side.
      See Also:
    • DATA_FLAG_EATING

      public static final int DATA_FLAG_EATING
    • DATA_FLAG_LAYING_DOWN

      public static final int DATA_FLAG_LAYING_DOWN
    • DATA_FLAG_SNEEZING

      public static final int DATA_FLAG_SNEEZING
    • DATA_FLAG_TRUSTING

      public static final int DATA_FLAG_TRUSTING
    • DATA_FLAG_ROLLING

      public static final int DATA_FLAG_ROLLING
    • DATA_FLAG_SCARED

      public static final int DATA_FLAG_SCARED
    • DATA_FLAG_IN_SCAFFOLDING

      public static final int DATA_FLAG_IN_SCAFFOLDING
    • DATA_FLAG_OVER_SCAFFOLDING

      public static final int DATA_FLAG_OVER_SCAFFOLDING
    • DATA_FLAG_FALL_THROUGH_SCAFFOLDING

      public static final int DATA_FLAG_FALL_THROUGH_SCAFFOLDING
    • DATA_FLAG_BLOCKING

      public static final int DATA_FLAG_BLOCKING
    • DATA_FLAG_TRANSITION_BLOCKING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_TRANSITION_BLOCKING
    • DATA_FLAG_BLOCKED_USING_SHIELD

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_BLOCKED_USING_SHIELD
    • DATA_FLAG_BLOCKED_USING_DAMAGED_SHIELD

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_BLOCKED_USING_DAMAGED_SHIELD
    • DATA_FLAG_SLEEPING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_SLEEPING
    • DATA_FLAG_ENTITY_GROW_UP

      @Since("FUTURE") public static final int DATA_FLAG_ENTITY_GROW_UP
    • DATA_FLAG_TRADE_INTEREST

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_TRADE_INTEREST
    • DATA_FLAG_DOOR_BREAKER

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_DOOR_BREAKER
    • DATA_FLAG_BREAKING_OBSTRUCTION

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_BREAKING_OBSTRUCTION
    • DATA_FLAG_DOOR_OPENER

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_DOOR_OPENER
    • DATA_FLAG_IS_ILLAGER_CAPTAIN

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_IS_ILLAGER_CAPTAIN
    • DATA_FLAG_STUNNED

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_STUNNED
    • DATA_FLAG_ROARING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_ROARING
    • DATA_FLAG_DELAYED_ATTACK

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_DELAYED_ATTACK
    • DATA_FLAG_IS_AVOIDING_MOBS

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_IS_AVOIDING_MOBS
    • DATA_FLAG_IS_AVOIDING_BLOCKS

      @Since("1.3.0.0-PN") public static final int DATA_FLAG_IS_AVOIDING_BLOCKS
    • DATA_FLAG_FACING_TARGET_TO_RANGE_ATTACK

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_FACING_TARGET_TO_RANGE_ATTACK
    • DATA_FLAG_HIDDEN_WHEN_INVISIBLE

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_HIDDEN_WHEN_INVISIBLE
    • DATA_FLAG_IS_IN_UI

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_IS_IN_UI
    • DATA_FLAG_STALKING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_STALKING
    • DATA_FLAG_EMOTING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_EMOTING
    • DATA_FLAG_CELEBRATING

      @Since("1.2.0.0-PN") public static final int DATA_FLAG_CELEBRATING
    • DATA_FLAG_ADMIRING

      @Since("1.3.0.0-PN") public static final int DATA_FLAG_ADMIRING
    • DATA_FLAG_CELEBRATING_SPECIAL

      @Since("1.3.0.0-PN") public static final int DATA_FLAG_CELEBRATING_SPECIAL
    • DATA_FLAG_RAM_ATTACK

      @Since("1.4.0.0-PN") public static final int DATA_FLAG_RAM_ATTACK
    • DATA_FLAG_PLAYING_DEAD

      @Since("1.5.0.0-PN") public static final int DATA_FLAG_PLAYING_DEAD
    • DATA_FLAG_IN_ASCENDABLE_BLOCK

      @Since("FUTURE") public static final int DATA_FLAG_IN_ASCENDABLE_BLOCK
    • DATA_FLAG_OVER_DESCENDABLE_BLOCK

      @Since("FUTURE") public static final int DATA_FLAG_OVER_DESCENDABLE_BLOCK
    • DATA_FLAG_CROAKING

      @Since("1.6.0.0-PNX") public static final int DATA_FLAG_CROAKING
    • DATA_FLAG_EAT_MOB

      @Since("1.6.0.0-PNX") public static final int DATA_FLAG_EAT_MOB
    • DATA_FLAG_JUMP_GOAL_JUMP

      @Since("1.6.0.0-PNX") public static final int DATA_FLAG_JUMP_GOAL_JUMP
    • DATA_FLAG_EMERGING

      @Since("1.6.0.0-PNX") public static final int DATA_FLAG_EMERGING
    • DATA_FLAG_SNIFFING

      @Since("1.6.0.0-PNX") public static final int DATA_FLAG_SNIFFING
    • DATA_FLAG_DIGGING

      @Since("1.6.0.0-PNX") public static final int DATA_FLAG_DIGGING
    • DATA_FLAG_SONIC_BOOM

      @Since("1.19.21-r4") public static final int DATA_FLAG_SONIC_BOOM
    • DATA_FLAG_HAS_DASH_COOLDOWN

      @Since("1.19.50-r1") public static final int DATA_FLAG_HAS_DASH_COOLDOWN
    • DATA_FLAG_PUSH_TOWARDS_CLOSEST_SPACE

      @Since("1.19.50-r1") public static final int DATA_FLAG_PUSH_TOWARDS_CLOSEST_SPACE
    • DATA_FLAG_SCENTING

      @Since("1.19.70-r1") public static final int DATA_FLAG_SCENTING
    • DATA_FLAG_RISING

      @Since("1.19.70-r1") public static final int DATA_FLAG_RISING
    • DATA_FLAG_FEELING_HAPPY

      @Since("1.19.70-r1") public static final int DATA_FLAG_FEELING_HAPPY
    • DATA_FLAG_SEARCHING

      @Since("1.19.70-r1") public static final int DATA_FLAG_SEARCHING
    • DATA_FLAG_CRAWLING

      @Since("1.20.10-r1") public static final int DATA_FLAG_CRAWLING
    • entityCount

      public static long entityCount
    • passengers

      public final List<Entity> passengers
    • offsetBoundingBox

      public final AxisAlignedBB offsetBoundingBox
    • hasSpawned

      protected final Map<Integer,Player> hasSpawned
    • effects

      protected final Map<Integer,Effect> effects
    • dataProperties

      protected final EntityMetadata dataProperties
    • riding

      public Entity riding
      这个实体骑在谁身上

      Who is this entity riding on

    • chunk

      public FullChunk chunk
    • blocksAround

      public List<Block> blocksAround
    • collisionBlocks

      public List<Block> collisionBlocks
    • lastX

      public double lastX
    • lastY

      public double lastY
    • lastZ

      public double lastZ
    • firstMove

      public boolean firstMove
    • motionX

      public double motionX
    • motionY

      public double motionY
    • motionZ

      public double motionZ
    • temporalVector

      public Vector3 temporalVector
      临时向量,其值没有任何含义
    • lastMotionX

      public double lastMotionX
    • lastMotionY

      public double lastMotionY
    • lastMotionZ

      public double lastMotionZ
    • lastPitch

      public double lastPitch
    • lastYaw

      @Since("FUTURE") public double lastYaw
    • lastHeadYaw

      @Since("FUTURE") public double lastHeadYaw
    • pitchDelta

      public double pitchDelta
    • yawDelta

      @Since("FUTURE") public double yawDelta
    • headYawDelta

      @Since("FUTURE") public double headYawDelta
    • entityCollisionReduction

      public double entityCollisionReduction
    • boundingBox

      public AxisAlignedBB boundingBox
    • onGround

      public boolean onGround
    • inBlock

      public boolean inBlock
    • positionChanged

      public boolean positionChanged
    • motionChanged

      public boolean motionChanged
    • deadTicks

      public int deadTicks
    • keepMovement

      public boolean keepMovement
      Player do not use
    • fallDistance

      public float fallDistance
    • ticksLived

      public int ticksLived
    • lastUpdate

      public int lastUpdate
    • maxFireTicks

      public int maxFireTicks
    • fireTicks

      public int fireTicks
    • inPortalTicks

      public int inPortalTicks
    • freezingTicks

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int freezingTicks
    • scale

      public float scale
    • namedTag

      public CompoundTag namedTag
    • isCollided

      public boolean isCollided
    • isCollidedHorizontally

      public boolean isCollidedHorizontally
    • isCollidedVertically

      public boolean isCollidedVertically
    • noDamageTicks

      public int noDamageTicks
    • justCreated

      public boolean justCreated
    • fireProof

      public boolean fireProof
    • invulnerable

      public boolean invulnerable
    • highestPosition

      public double highestPosition
    • closed

      public boolean closed
    • noClip

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean noClip
    • entityUniqueId

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") protected UUID entityUniqueId
    • id

      protected long id
    • lastDamageCause

      protected EntityDamageEvent lastDamageCause
    • age

      protected int age
    • health

      protected float health
    • absorption

      protected float absorption
    • ySize

      protected float ySize
      Player do not use
    • inEndPortal

      @PowerNukkitOnly @Since("1.2.1.0-PN") protected boolean inEndPortal
    • isStatic

      protected boolean isStatic
    • server

      protected Server server
    • isPlayer

      protected boolean isPlayer
    • saveWithChunk

      @PowerNukkitXOnly @Since("1.20.10-r1") protected volatile boolean saveWithChunk
  • Constructor Details

  • Method Details

    • createEntity

      @PowerNukkitXOnly @Since("1.19.60-r1") @Nullable public static Entity createEntity(Identifier identifier, @NotNull Position pos, @Nullable Object... args)
      从mc标准实体标识符创建实体,形如(minecraft:sheep)

      Create an entity from the entity identifier, like (minecraft:sheep)

      Parameters:
      identifier - the identifier
      pos - the pos
      args - the args
      Returns:
      the entity
    • createEntity

      @Nullable public static Entity createEntity(@NotNull String name, @NotNull Position pos, @Nullable Object... args)
      创建一个实体从实体名,名称从registerEntities源代码查询

      Create an entity from entity name, name from registerEntities source code query

      Parameters:
      name - the name
      pos - the pos
      args - the args
      Returns:
      the entity
    • createEntity

      @Nullable public static Entity createEntity(int type, @NotNull Position pos, @Nullable Object... args)
      创建一个实体从网络id

      Create an entity from the network id

      Parameters:
      type - 网络ID
      network id
      pos - the pos
      args - the args
      Returns:
      the entity
    • createEntity

      @Nullable public static Entity createEntity(int type, @NotNull FullChunk chunk, @NotNull CompoundTag nbt, @Nullable Object... args)
      创建一个实体从网络id

      Create an entity from the network id

      Parameters:
      type - 网络ID
      network id
      chunk - the chunk
      nbt - the nbt
      args - the args
      Returns:
      the entity
    • createEntity

      @Nullable public static Entity createEntity(@NotNull String name, @NotNull FullChunk chunk, @NotNull CompoundTag nbt, @Nullable Object... args)
      See Also:
    • registerEntity

      public static boolean registerEntity(String name, Class<? extends Entity> clazz)
      See Also:
    • registerEntity

      @PowerNukkitXDifference(since="1.19.21-r1", info="Use internal provider instead.") public static boolean registerEntity(String name, Class<? extends Entity> clazz, boolean force)
      注册一个实体,仅供内部使用,自定义实体请使用registerCustomEntity

      Register an entity for internal use only, for custom entities please use registerCustomEntity

      Parameters:
      name - the name
      clazz - the clazz
      force - the force
      Returns:
      the boolean
    • registerEntity

      @PowerNukkitXOnly @Since("1.19.21-r2") public static boolean registerEntity(EntityProvider<? extends Entity> provider)
      See Also:
    • registerEntity

      @PowerNukkitXOnly @Since("1.19.21-r2") public static boolean registerEntity(EntityProvider<? extends Entity> provider, boolean force)
      注册一个实体,仅供内部使用,自定义实体请使用registerCustomEntity

      Register an entity for internal use only, for custom entities please use registerCustomEntity

      Parameters:
      provider - the provider
      force - the force
      Returns:
      the boolean
    • getEntityDefinitions

      @PowerNukkitXOnly public static Set<CustomEntityDefinition> getEntityDefinitions()
      获取全部自定义实体定义的拷贝

      Get a copy of all custom entity definitions

      Returns:
      the entity definitions
    • registerCustomEntity

      @PowerNukkitXOnly @Since("1.19.21-r2") public static OK<?> registerCustomEntity(CustomEntityProvider customEntityProvider)
      注册一个自定义实体

      Register a custom entity

      Parameters:
      customEntityProvider - the custom entity provider
      Returns:
      the ok
    • getKnownEntityIds

      @NotNull @PowerNukkitOnly @Since("1.5.1.0-PN") public static it.unimi.dsi.fastutil.ints.IntCollection getKnownEntityIds()
      获得全部实体的网络id

      Get the network id of all entities

      Returns:
      the known entity ids
    • getKnownEntities

      @NotNull @PowerNukkitXOnly @Since("1.19.20-r4") @Deprecated public static Map<String,Class<? extends Entity>> getKnownEntities()
      Deprecated.
      获取全部已经注册的实体,包括自定义实体

      Get all registered entities, including custom entities

      Returns:
      the known entities
    • getKnownEntityProviders

      @NotNull @PowerNukkitXOnly @Since("1.19.20-r4") @Deprecated public static Map<String,EntityProvider<? extends Entity>> getKnownEntityProviders()
      Deprecated.
    • getSaveIds

      @NotNull @PowerNukkitOnly @Since("1.5.1.0-PN") public static List<String> getSaveIds()
      获取全部已经注册的实体提供者

      Get all registered entity providers

      Returns:
      the known entity providers
    • getSaveId

      @NotNull @PowerNukkitOnly @Since("1.5.1.0-PN") public static OptionalInt getSaveId(String id)
      从key id 查询该实体的网络id,knownEntities

      Query the network id of the entity from the key id,knownEntities

      Parameters:
      id - the id
      Returns:
      the save id
    • getSaveId

      @Nullable @PowerNukkitOnly @Since("1.5.1.0-PN") public static String getSaveId(int id)
      从网络id 查询该实体的Name,对应knownEntities key

      Query the name of the entity from its network id, corresponding to knownEntities key

      Parameters:
      id - the id
      Returns:
      the save id
    • getIdentifier

      @Nullable public static Identifier getIdentifier(int networkID)
      获取指定网络id实体的标识符

      Get the identifier of the specified network id entity

      Returns:
      the identifier
    • getDefaultNBT

      @NotNull public static CompoundTag getDefaultNBT(@NotNull Vector3 pos)
      See Also:
    • getDefaultNBT

      @NotNull public static CompoundTag getDefaultNBT(@NotNull Vector3 pos, @Nullable Vector3 motion)
    • getDefaultNBT

      @NotNull public static CompoundTag getDefaultNBT(@NotNull Vector3 pos, @Nullable Vector3 motion, float yaw, float pitch)
      获得该实体的默认NBT,带有位置,motion,yaw pitch等信息

      Get the default NBT of the entity, with information such as position, motion, yaw pitch, etc.

      Parameters:
      pos - the pos
      motion - the motion
      yaw - the yaw
      pitch - the pitch
      Returns:
      the default nbt
    • playAnimationOnEntities

      @PowerNukkitXOnly @Since("1.19.50-r3") public static void playAnimationOnEntities(AnimateEntityPacket.Animation animation, Collection<Entity> entities, Collection<Player> players)
      Batch play animation on entity groups
      This method is recommended if you need to play the same animation on a large number of entities at the same time, as it only sends packets once for each player, which greatly reduces bandwidth pressure

      在实体群上批量播放动画
      若你需要同时在大量实体上播放同一动画,建议使用此方法,因为此方法只会针对每个玩家发送一次包,这能极大地缓解带宽压力

      Parameters:
      animation - 动画对象 Animation objects
      entities - 需要播放动画的实体群 Group of entities that need to play animations
      players - 可视玩家 Visible Player
    • playAnimationOnEntities

      @PowerNukkitXOnly @Since("1.19.50-r3") public static void playAnimationOnEntities(AnimateEntityPacket.Animation animation, Collection<Entity> entities)
      See Also:
    • init

      @PowerNukkitXInternal public static void init()
    • getIdentifier

      @Nullable public Identifier getIdentifier()
      获取该实体的标识符

      Get the identifier of the entity

      Returns:
      the identifier
    • getNetworkId

      public abstract int getNetworkId()
      获得该实体的网络ID

      Get the network ID of the entity

      Returns:
      the network id
    • getHeight

      public float getHeight()
      实体高度

      entity Height

      Returns:
      the height
    • getCurrentHeight

      @PowerNukkitOnly @Since("1.5.1.0-PN") public float getCurrentHeight()
    • getEyeHeight

      public float getEyeHeight()
    • getWidth

      public float getWidth()
    • getLength

      public float getLength()
    • getStepHeight

      protected double getStepHeight()
    • canCollide

      public boolean canCollide()
    • getGravity

      protected float getGravity()
    • getDrag

      protected float getDrag()
    • getBaseOffset

      protected float getBaseOffset()
    • getFrostbiteInjury

      @PowerNukkitXOnly @Since("1.19.50-r2") public int getFrostbiteInjury()
    • initEntity

      protected void initEntity()
      实体初始化顺序,先初始化Entity类字段->Entity构造函数->进入init方法->调用initEntity方法->子类字段初始化->子类构造函数

      用于初始化实体的NBT和实体字段的方法

      Entity initialization order, first initialize the Entity class field->Entity constructor->Enter the init method->Call the init Entity method-> subclass field initialization-> subclass constructor

      The method used to initialize the NBT and entity fields of the entity

    • init

      protected final void init(FullChunk chunk, CompoundTag nbt)
    • hasCustomName

      public boolean hasCustomName()
    • getNameTag

      public String getNameTag()
    • setNameTag

      public void setNameTag(String name)
    • isNameTagVisible

      public boolean isNameTagVisible()
    • setNameTagVisible

      public void setNameTagVisible(boolean value)
    • isNameTagAlwaysVisible

      public boolean isNameTagAlwaysVisible()
    • setNameTagAlwaysVisible

      public void setNameTagAlwaysVisible(boolean value)
    • setNameTagVisible

      public void setNameTagVisible()
    • setNameTagAlwaysVisible

      public void setNameTagAlwaysVisible()
    • getScoreTag

      public String getScoreTag()
    • setScoreTag

      public void setScoreTag(String score)
    • isSneaking

      public boolean isSneaking()
    • setSneaking

      public void setSneaking(boolean value)
    • setSneaking

      public void setSneaking()
    • isSwimming

      public boolean isSwimming()
    • setSwimming

      public void setSwimming(boolean value)
    • getSwimmingHeight

      @PowerNukkitOnly @Since("1.5.1.0-PN") public float getSwimmingHeight()
    • setSwimming

      public void setSwimming()
    • isSprinting

      public boolean isSprinting()
    • setSprinting

      public void setSprinting(boolean value)
    • setSprinting

      public void setSprinting()
    • isGliding

      public boolean isGliding()
    • setGliding

      public void setGliding(boolean value)
    • setGliding

      public void setGliding()
    • isImmobile

      public boolean isImmobile()
    • setImmobile

      public void setImmobile(boolean value)
    • setImmobile

      public void setImmobile()
    • canClimb

      public boolean canClimb()
    • setCanClimb

      public void setCanClimb()
    • setCanClimb

      public void setCanClimb(boolean value)
    • canClimbWalls

      public boolean canClimbWalls()
    • setCanClimbWalls

      public void setCanClimbWalls()
    • setCanClimbWalls

      public void setCanClimbWalls(boolean value)
    • getScale

      public float getScale()
    • setScale

      public void setScale(float scale)
    • getPassengers

      public List<Entity> getPassengers()
    • getPassenger

      public Entity getPassenger()
    • isPassenger

      public boolean isPassenger(Entity entity)
    • isControlling

      public boolean isControlling(Entity entity)
    • hasControllingPassenger

      public boolean hasControllingPassenger()
    • getRiding

      public Entity getRiding()
    • getEffects

      public Map<Integer,Effect> getEffects()
    • removeAllEffects

      public void removeAllEffects()
    • removeEffect

      public void removeEffect(int effectId)
    • getEffect

      public Effect getEffect(int effectId)
    • hasEffect

      public boolean hasEffect(int effectId)
    • addEffect

      public void addEffect(Effect effect)
    • recalculateBoundingBox

      public void recalculateBoundingBox()
    • recalculateBoundingBox

      public void recalculateBoundingBox(boolean send)
    • recalculateEffectColor

      protected void recalculateEffectColor()
    • saveNBT

      public void saveNBT()
    • getOriginalName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public String getOriginalName()
      The name that English name of the type of this entity.
    • getVisibleName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public final String getVisibleName()
      Similar to getName(), but if the name is blank or empty it returns the static name instead.
    • getName

      @NotNull public String getName()
      The current name used by this entity in the name tag, or the static name if the entity don't have nametag.
    • getSaveId

      public final String getSaveId()
    • spawnTo

      public void spawnTo(Player player)
      将这个实体在客户端生成,让该玩家可以看到它

      Spawn this entity on the client side so that the player can see it

      Parameters:
      player - the player
    • createAddEntityPacket

      protected DataPacket createAddEntityPacket()
    • getViewers

      public Map<Integer,Player> getViewers()
    • sendPotionEffects

      public void sendPotionEffects(Player player)
    • sendData

      public void sendData(Player player)
    • sendData

      public void sendData(Player player, EntityMetadata data)
    • sendData

      public void sendData(Player[] players)
    • sendData

      public void sendData(Player[] players, EntityMetadata data)
    • despawnFrom

      public void despawnFrom(Player player)
    • attack

      public boolean attack(EntityDamageEvent source)
      当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.

      Called when an entity is attacked (i.e. receives an entity damage event. This event can be caused by an attack by another entity, or it can be a natural damage).

      Parameters:
      source - 记录伤害源的事件
      Record the event of the source of the attack
      Returns:
      是否攻击成功
      Whether the attack was successful
    • attack

      public boolean attack(float damage)
    • getAge

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int getAge()
    • heal

      public void heal(EntityRegainHealthEvent source)
    • heal

      public void heal(float amount)
    • getHealth

      public float getHealth()
    • setHealth

      public void setHealth(float health)
    • isAlive

      public boolean isAlive()
    • isClosed

      public boolean isClosed()
    • getLastDamageCause

      public EntityDamageEvent getLastDamageCause()
    • setLastDamageCause

      public void setLastDamageCause(EntityDamageEvent type)
    • getMaxHealth

      public int getMaxHealth()
    • setMaxHealth

      public void setMaxHealth(int maxHealth)
    • canCollideWith

      public boolean canCollideWith(Entity entity)
    • canBeSavedWithChunk

      @PowerNukkitXOnly @Since("1.20.10-r1") public boolean canBeSavedWithChunk()
    • setCanBeSavedWithChunk

      @PowerNukkitXOnly @Since("1.20.10-r1") public void setCanBeSavedWithChunk(boolean saveWithChunk)
    • checkObstruction

      protected boolean checkObstruction(double x, double y, double z)
    • entityBaseTick

      public boolean entityBaseTick()
    • entityBaseTick

      public boolean entityBaseTick(int tickDiff)
    • updateMovement

      @PowerNukkitDifference(since="1.6.0.0-PNX", info="add support for the new movement packet MoveEntityDeltaPacket") public void updateMovement()
    • enableHeadYaw

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public boolean enableHeadYaw()
    • addMovement

      public void addMovement(double x, double y, double z, double yaw, double pitch, double headYaw)
      增加运动 (仅发送数据包,如果需要请使用setMotion(cn.nukkit.math.Vector3))

      Add motion (just sending packet will not make the entity actually move, use setMotion(cn.nukkit.math.Vector3) if needed)

      Parameters:
      x - x
      y - y
      z - z
      yaw - 左右旋转
      pitch - 上下旋转
      headYaw - headYaw
    • addMotion

      public void addMotion(double motionX, double motionY, double motionZ)
    • broadcastMovement

      @PowerNukkitXOnly @Since("1.19.31-r1") protected void broadcastMovement()
    • getDirectionVector

      @PowerNukkitXDifference(info="There is no need to set the temporalVector, because the result is prone to change in an asynchronous environment.") public Vector3 getDirectionVector()
      Overrides:
      getDirectionVector in class Location
    • getDirectionPlane

      public Vector2 getDirectionPlane()
    • getHorizontalFacing

      public BlockFace getHorizontalFacing()
    • onUpdate

      public boolean onUpdate(int currentTick)
    • mountEntity

      public boolean mountEntity(Entity entity)
    • mountEntity

      public boolean mountEntity(Entity entity, byte mode)
      Mount an Entity from a/into vehicle
      Parameters:
      entity - The target Entity
      Returns:
      true if the mounting successful
    • dismountEntity

      public boolean dismountEntity(Entity entity)
    • dismountEntity

      public boolean dismountEntity(Entity entity, boolean sendLinks)
    • broadcastLinkPacket

      protected void broadcastLinkPacket(Entity rider, byte type)
    • updatePassengers

      public void updatePassengers()
    • updatePassengerPosition

      protected void updatePassengerPosition(Entity passenger)
    • getSeatPosition

      public Vector3f getSeatPosition()
    • setSeatPosition

      public void setSeatPosition(Vector3f pos)
    • getMountedOffset

      public Vector3f getMountedOffset(Entity entity)
    • scheduleUpdate

      public final void scheduleUpdate()
    • isOnFire

      public boolean isOnFire()
    • setOnFire

      public void setOnFire(int seconds)
    • getAbsorption

      public float getAbsorption()
    • setAbsorption

      public void setAbsorption(float absorption)
    • canBePushed

      @PowerNukkitOnly public boolean canBePushed()
    • getDirection

      public BlockFace getDirection()
    • extinguish

      public void extinguish()
    • canTriggerWalking

      public boolean canTriggerWalking()
    • resetFallDistance

      @PowerNukkitXDifference(since="1.19.20-r5") public void resetFallDistance()
    • updateFallState

      protected void updateFallState(boolean onGround)
    • getBoundingBox

      public AxisAlignedBB getBoundingBox()
    • fall

      public void fall(float fallDistance)
    • onPhysicalInteraction

      @PowerNukkitXDifference(info="change to protected") protected boolean onPhysicalInteraction(Block block, boolean cancelled)
    • handleLavaMovement

      public void handleLavaMovement()
    • moveFlying

      public void moveFlying(float strafe, float forward, float friction)
    • onCollideWithPlayer

      public void onCollideWithPlayer(EntityHuman entityPlayer)
    • applyEntityCollision

      public void applyEntityCollision(Entity entity)
    • onStruckByLightning

      public void onStruckByLightning(Entity entity)
    • onPushByPiston

      @PowerNukkitOnly public void onPushByPiston(BlockEntityPistonArm piston)
    • onInteract

      public boolean onInteract(Player player, Item item, Vector3 clickedPos)
    • onInteract

      public boolean onInteract(Player player, Item item)
    • switchLevel

      protected boolean switchLevel(Level targetLevel)
    • getPosition

      @NotNull public Position getPosition()
    • getLocation

      @NotNull public Location getLocation()
      Overrides:
      getLocation in class Location
    • isTouchingWater

      @PowerNukkitOnly public boolean isTouchingWater()
    • isInsideOfWater

      public boolean isInsideOfWater()
    • isUnderBlock

      @PowerNukkitXOnly public boolean isUnderBlock()
    • hasWaterAt

      @PowerNukkitOnly @Since("1.4.0.0-PN") @PowerNukkitXDifference(info="Make as public method", since="1.19.60-r1") public boolean hasWaterAt(float height)
    • hasWaterAt

      @PowerNukkitXOnly @Since("1.19.60-r1") protected boolean hasWaterAt(float height, boolean tickCached)
    • isInsideOfSolid

      public boolean isInsideOfSolid()
    • isInsideOfFire

      public boolean isInsideOfFire()
    • collideWithBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") public <T extends Block> boolean collideWithBlock(Class<T> classType)
    • isInsideOfLava

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isInsideOfLava()
    • isOnLadder

      public boolean isOnLadder()
    • fastMove

      public boolean fastMove(double dx, double dy, double dz)
    • move

      @PowerNukkitXDifference(since="1.19.60-r1", info="The onGround is updated when the entity motion is 0") public boolean move(double dx, double dy, double dz)
    • checkGroundState

      protected void checkGroundState(double movX, double movY, double movZ, double dx, double dy, double dz)
    • getBlocksAround

      public List<Block> getBlocksAround()
    • getTickCachedBlocksAround

      @PowerNukkitXOnly @Since("1.19.50-r2") public List<Block> getTickCachedBlocksAround()
    • getCollisionBlocks

      public List<Block> getCollisionBlocks()
    • getTickCachedCollisionBlocks

      @PowerNukkitXOnly @Since("1.19.50-r2") public List<Block> getTickCachedCollisionBlocks()
    • canBeMovedByCurrents

      public boolean canBeMovedByCurrents()
      Returns whether this entity can be moved by currents in liquids.
      Returns:
      boolean
    • checkBlockCollision

      protected void checkBlockCollision()
    • setPositionAndRotation

      public boolean setPositionAndRotation(Vector3 pos, double yaw, double pitch)
    • setPositionAndRotation

      public boolean setPositionAndRotation(Vector3 pos, double yaw, double pitch, double headYaw)
      Sets position and rotation.
      Parameters:
      pos - the pos
      yaw - the yaw
      pitch - the pitch
      headYaw - the head yaw
      Returns:
      切换地图失败会返回false
    • setRotation

      public void setRotation(double yaw, double pitch)
    • setRotation

      @Since("FUTURE") public void setRotation(double yaw, double pitch, double headYaw)
    • doesTriggerPressurePlate

      public boolean doesTriggerPressurePlate()
      Whether the entity can active pressure plates. Used for EntityBats only.
      Returns:
      triggers pressure plate
    • canPassThrough

      public boolean canPassThrough()
    • checkChunks

      protected void checkChunks()
    • setPosition

      public boolean setPosition(Vector3 pos)
    • getMotion

      public Vector3 getMotion()
    • setMotion

      public boolean setMotion(Vector3 motion)
      设置一个运动向量(会使得实体移动这个向量的距离,非精准移动)

      Set a motion vector (will make the entity move the distance of this vector, not move precisely)

      Parameters:
      motion - 运动向量
      a motion vector
      Returns:
      boolean
    • isOnGround

      public boolean isOnGround()
    • kill

      public void kill()
    • teleport

      public boolean teleport(Vector3 pos)
    • teleport

      public boolean teleport(Vector3 pos, PlayerTeleportEvent.TeleportCause cause)
    • teleport

      public boolean teleport(Position pos)
    • teleport

      public boolean teleport(Position pos, PlayerTeleportEvent.TeleportCause cause)
    • teleport

      public boolean teleport(Location location)
    • teleport

      public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause)
    • getId

      public long getId()
    • getUniqueId

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public UUID getUniqueId()
    • respawnToAll

      public void respawnToAll()
    • spawnToAll

      public void spawnToAll()
    • despawnFromAll

      public void despawnFromAll()
    • close

      public void close()
    • setDataProperty

      public boolean setDataProperty(EntityData data)
    • setDataProperty

      public boolean setDataProperty(EntityData data, boolean send)
    • getDataProperties

      public EntityMetadata getDataProperties()
    • getDataProperty

      public EntityData getDataProperty(int id)
    • getDataPropertyInt

      public int getDataPropertyInt(int id)
    • getDataPropertyShort

      public int getDataPropertyShort(int id)
    • getDataPropertyByte

      public int getDataPropertyByte(int id)
    • getDataPropertyBoolean

      public boolean getDataPropertyBoolean(int id)
    • getDataPropertyLong

      public long getDataPropertyLong(int id)
    • getDataPropertyString

      public String getDataPropertyString(int id)
    • getDataPropertyFloat

      public float getDataPropertyFloat(int id)
    • getDataPropertyNBT

      public CompoundTag getDataPropertyNBT(int id)
    • getDataPropertyPos

      public Vector3 getDataPropertyPos(int id)
    • getDataPropertyVector3f

      public Vector3f getDataPropertyVector3f(int id)
    • getDataPropertyType

      public int getDataPropertyType(int id)
    • setDataFlag

      public void setDataFlag(int propertyId, int id)
    • setDataFlag

      public void setDataFlag(int propertyId, int id, boolean value)
    • getDataFlag

      public boolean getDataFlag(int propertyId, int id)
    • setMetadata

      public void setMetadata(String metadataKey, MetadataValue newMetadataValue)
      Specified by:
      setMetadata in interface Metadatable
    • getMetadata

      public List<MetadataValue> getMetadata(String metadataKey)
      Specified by:
      getMetadata in interface Metadatable
    • hasMetadata

      public boolean hasMetadata(String metadataKey)
      Specified by:
      hasMetadata in interface Metadatable
    • removeMetadata

      public void removeMetadata(String metadataKey, Plugin owningPlugin)
      Specified by:
      removeMetadata in interface Metadatable
    • getServer

      public Server getServer()
    • isUndead

      @PowerNukkitOnly public boolean isUndead()
    • isInEndPortal

      @PowerNukkitOnly @Since("1.2.1.0-PN") public boolean isInEndPortal()
    • isPreventingSleep

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isPreventingSleep(Player player)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Vector3
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Vector3
    • isSpinAttacking

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isSpinAttacking()
    • setSpinAttacking

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setSpinAttacking(boolean value)
    • setSpinAttacking

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setSpinAttacking()
    • isNoClip

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isNoClip()
    • setNoClip

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setNoClip(boolean noClip)
    • isBoss

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isBoss()
    • addTag

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void addTag(String tag)
    • removeTag

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void removeTag(String tag)
    • containTag

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public boolean containTag(String tag)
    • getAllTags

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public List<StringTag> getAllTags()
    • getFreezingEffectStrength

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public float getFreezingEffectStrength()
    • setFreezingEffectStrength

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setFreezingEffectStrength(float strength)
    • getFreezingTicks

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int getFreezingTicks()
    • setFreezingTicks

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setFreezingTicks(int ticks)
    • addFreezingTicks

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void addFreezingTicks(int increments)
    • setAmbientSoundInterval

      @PowerNukkitXOnly @Since("1.19.21-r4") public void setAmbientSoundInterval(float interval)
    • setAmbientSoundIntervalRange

      @PowerNukkitXOnly @Since("1.19.21-r4") public void setAmbientSoundIntervalRange(float range)
    • setAmbientSoundEvent

      @PowerNukkitXOnly @Since("1.19.21-r4") public void setAmbientSoundEvent(Sound sound)
    • setAmbientSoundEventName

      @PowerNukkitXOnly @Since("1.19.21-r4") public void setAmbientSoundEventName(String eventName)
    • playAnimation

      @PowerNukkitXOnly @Since("1.19.50-r3") public void playAnimation(AnimateEntityPacket.Animation animation)
    • playAnimation

      @PowerNukkitXOnly @Since("1.19.50-r3") public void playAnimation(AnimateEntityPacket.Animation animation, Collection<Player> players)
      Play the animation of this entity to a specified group of players

      向指定玩家群体播放此实体的动画

      Parameters:
      animation - 动画对象 Animation objects
      players - 可视玩家 Visible Player
    • playActionAnimation

      @PowerNukkitXOnly @Since("1.19.60-r1") public void playActionAnimation(AnimatePacket.Action action, float rowingTime)
    • playActionAnimation

      @PowerNukkitXOnly @Since("1.19.60-r1") public void playActionAnimation(AnimatePacket.Action action, float rowingTime, Collection<Player> players)
      Play the action animation of this entity to a specified group of players

      向指定玩家群体播放此实体的action动画

      Parameters:
      action - the action
      rowingTime - the rowing time
      players - 可视玩家 Visible Player
    • setIntEntityProperty

      @PowerNukkitXOnly @Since("1.20.10-r2") public final boolean setIntEntityProperty(String identifier, int value)
    • setBooleanEntityProperty

      @PowerNukkitXOnly @Since("1.20.10-r2") public final boolean setBooleanEntityProperty(String identifier, boolean value)
    • setFloatEntityProperty

      @PowerNukkitXOnly @Since("1.20.10-r2") public final boolean setFloatEntityProperty(String identifier, float value)
    • setEnumEntityProperty

      @PowerNukkitXOnly @Since("1.20.10-r2") public final boolean setEnumEntityProperty(String identifier, String value)