Package cn.nukkit.entity.mob
Class EntityWarden
- All Implemented Interfaces:
EntityControlUtils
,LogicalUtils
,EntityAgeable
,EntityAsyncPrepare
,EntityCanAttack
,EntityDamageable
,EntityNameable
,EntityWalkable
,EntityInventoryHolder
,InventoryHolder
,VibrationListener
,Metadatable
,Cloneable
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
static final int
protected boolean
Fields inherited from class cn.nukkit.entity.mob.EntityMob
diffHandDamage
Fields inherited from class cn.nukkit.entity.EntityIntelligent
behaviorGroup, isActive
Fields inherited from class cn.nukkit.entity.EntityPhysical
fallingTick, globalCycleTickSpread, needsRecalcMovement, offsetBoundingBox, PRECISION, previousCollideMotion, previousCurrentMotion, tickSpread
Fields inherited from class cn.nukkit.entity.EntityLiving
attackTime, DEFAULT_SPEED, invisible, movementSpeed, turtleTicks
Fields inherited from class cn.nukkit.entity.Entity
absorption, age, blocksAround, boundingBox, chunk, closed, collisionBlocks, DATA_AERIAL_ATTACK, DATA_AGENT, DATA_AIR, DATA_ALWAYS_SHOW_NAMETAG, DATA_AMBIENT_SOUND_EVENT_NAME, DATA_AMBIENT_SOUND_INTERVAL, DATA_AMBIENT_SOUND_INTERVAL_RANGE, DATA_AREA_EFFECT_CLOUD_PARTICLE_ID, DATA_AREA_EFFECT_CLOUD_RADIUS, DATA_AREA_EFFECT_CLOUD_WAITING, DATA_ARMOR_STAND_POSE_INDEX, DATA_AUX_POWER, DATA_BALLOON_ATTACHED_ENTITY, DATA_BASE_RUNTIME_ID, DATA_BLOCK_TARGET, DATA_BOUNDING_BOX_HEIGHT, DATA_BOUNDING_BOX_WIDTH, DATA_BUBBLE_TIME, DATA_BUOYANCY_DATA, DATA_CAN_RIDE_TARGET, DATA_CHANGE_ON_PICKUP, DATA_CHANGE_RATE, DATA_CHARGE_AMOUNT, DATA_CLIENT_EVENT, DATA_COLLISION_BOX, DATA_COLOR, DATA_COLOR_2, DATA_COLOUR, DATA_COMMAND_BLOCK_COMMAND, DATA_COMMAND_BLOCK_EXECUTE_ON_FIRST_TICK, DATA_COMMAND_BLOCK_LAST_OUTPUT, DATA_COMMAND_BLOCK_TICK_DELAY, DATA_COMMAND_BLOCK_TRACK_OUTPUT, DATA_CONTAINER_BASE_SIZE, DATA_CONTAINER_EXTRA_SLOTS_PER_STRENGTH, DATA_CONTAINER_TYPE, DATA_CONTROLLING_RIDER_SEAT_NUMBER, DATA_DISPLAY_ITEM, DATA_DISPLAY_OFFSET, DATA_DURATION, DATA_EATING_COUNTER, DATA_ENDER_CRYSTAL_TIME_OFFSET, DATA_ENDERMAN_HELD_RUNTIME_ID, DATA_ENTITY_AGE, DATA_EXPERIENCE_VALUE, DATA_FALL_DAMAGE_MULTIPLIER, DATA_FIREBALL_POWER_X, DATA_FIREBALL_POWER_Y, DATA_FIREBALL_POWER_Z, DATA_FISH_ANGLE, DATA_FISH_X, DATA_FISH_Z, DATA_FLAG_ACTION, DATA_FLAG_ADMIRING, DATA_FLAG_ALWAYS_SHOW_NAMETAG, DATA_FLAG_ANGRY, DATA_FLAG_BABY, DATA_FLAG_BLOCKED_USING_DAMAGED_SHIELD, DATA_FLAG_BLOCKED_USING_SHIELD, DATA_FLAG_BLOCKING, DATA_FLAG_BREAKING_OBSTRUCTION, DATA_FLAG_BREATHING, DATA_FLAG_BRIBED, DATA_FLAG_CAN_CLIMB, DATA_FLAG_CAN_DASH, DATA_FLAG_CAN_FLY, DATA_FLAG_CAN_POWER_JUMP, DATA_FLAG_CAN_SHOW_NAMETAG, DATA_FLAG_CELEBRATING, DATA_FLAG_CELEBRATING_SPECIAL, DATA_FLAG_CHARGE_ATTACK, DATA_FLAG_CHARGED, DATA_FLAG_CHESTED, DATA_FLAG_CONTAINER_PRIVATE, DATA_FLAG_CONVERTING, DATA_FLAG_CRAWLING, DATA_FLAG_CRITICAL, DATA_FLAG_CROAKING, DATA_FLAG_DANCING, DATA_FLAG_DELAYED_ATTACK, DATA_FLAG_DIGGING, DATA_FLAG_DOOR_BREAKER, DATA_FLAG_DOOR_OPENER, DATA_FLAG_EAT_MOB, DATA_FLAG_EATING, DATA_FLAG_ELDER, DATA_FLAG_EMERGING, DATA_FLAG_EMOTING, DATA_FLAG_ENCHANTED, DATA_FLAG_ENTITY_GROW_UP, DATA_FLAG_EVOKER_SPELL, DATA_FLAG_FACING_TARGET_TO_RANGE_ATTACK, DATA_FLAG_FALL_THROUGH_SCAFFOLDING, DATA_FLAG_FEELING_HAPPY, DATA_FLAG_FIRE_IMMUNE, DATA_FLAG_GLIDING, DATA_FLAG_GRAVITY, DATA_FLAG_HAS_COLLISION, DATA_FLAG_HAS_DASH_COOLDOWN, DATA_FLAG_HIDDEN_WHEN_INVISIBLE, DATA_FLAG_IDLING, DATA_FLAG_IGNITED, DATA_FLAG_IMMOBILE, DATA_FLAG_IN_ASCENDABLE_BLOCK, DATA_FLAG_IN_SCAFFOLDING, DATA_FLAG_INLOVE, DATA_FLAG_INTERESTED, DATA_FLAG_INVISIBLE, DATA_FLAG_IS_AVOIDING_BLOCKS, DATA_FLAG_IS_AVOIDING_MOBS, DATA_FLAG_IS_ILLAGER_CAPTAIN, DATA_FLAG_IS_IN_UI, DATA_FLAG_IS_TRANSFORMING, DATA_FLAG_JUMP_GOAL_JUMP, DATA_FLAG_LAYING_DOWN, DATA_FLAG_LAYING_EGG, DATA_FLAG_LEASHED, DATA_FLAG_LINGER, DATA_FLAG_MOVING, DATA_FLAG_NO_AI, DATA_FLAG_ONFIRE, DATA_FLAG_ORPHANED, DATA_FLAG_OVER_DESCENDABLE_BLOCK, DATA_FLAG_OVER_SCAFFOLDING, DATA_FLAG_PLAYING_DEAD, DATA_FLAG_POWERED, DATA_FLAG_PREGNANT, DATA_FLAG_PUSH_TOWARDS_CLOSEST_SPACE, DATA_FLAG_RAM_ATTACK, DATA_FLAG_REARING, DATA_FLAG_RESTING, DATA_FLAG_RIDER_CAN_PICK, DATA_FLAG_RIDING, DATA_FLAG_RISING, DATA_FLAG_ROARING, DATA_FLAG_ROLLING, DATA_FLAG_SADDLED, DATA_FLAG_SCARED, DATA_FLAG_SCENTING, DATA_FLAG_SEARCHING, DATA_FLAG_SHEARED, DATA_FLAG_SHOW_TRIDENT_ROPE, DATA_FLAG_SHOWBASE, DATA_FLAG_SILENT, DATA_FLAG_SITTING, DATA_FLAG_SLEEPING, DATA_FLAG_SNEAKING, DATA_FLAG_SNEEZING, DATA_FLAG_SNIFFING, DATA_FLAG_SONIC_BOOM, DATA_FLAG_SPIN_ATTACK, DATA_FLAG_SPRINTING, DATA_FLAG_STACKABLE, DATA_FLAG_STALKING, DATA_FLAG_STUNNED, DATA_FLAG_SWIMMER, DATA_FLAG_SWIMMING, DATA_FLAG_TAMED, DATA_FLAG_TEMPTED, DATA_FLAG_TRADE_INTEREST, DATA_FLAG_TRANSITION_BLOCKING, DATA_FLAG_TRANSITION_SETTING, DATA_FLAG_TRANSITION_SITTING, DATA_FLAG_TRUSTING, DATA_FLAG_VIBRATING, DATA_FLAG_WALKER, DATA_FLAG_WALLCLIMBING, DATA_FLAG_WASD_CONTROLLED, DATA_FLAGS, DATA_FLAGS_EXTENDED, DATA_FREEZING_EFFECT_STRENGTH, DATA_FUSE_LENGTH, DATA_GOAT_HORN_COUNT, DATA_HAS_COMMAND_BLOCK, DATA_HAS_DISPLAY, DATA_HAS_NPC_COMPONENT, DATA_HEALTH, DATA_HEARTBEAT_INTERVAL_TICKS, DATA_HEARTBEAT_SOUND_EVENT, DATA_HIGH_TIER_CURED_DISCOUNT, DATA_HITBOX, DATA_HURT_DIRECTION, DATA_HURT_TIME, DATA_INTERACT_TEXT, DATA_INTERACTIVE_TAG, DATA_IS_BUOYANT, DATA_JUMP_DURATION, DATA_LAYING_AMOUNT, DATA_LAYING_AMOUNT_PREVIOUS, DATA_LEAD_HOLDER_EID, DATA_LIMITED_LIFE, DATA_LOW_TIER_CURED_DISCOUNT, DATA_MARK_VARIANT, DATA_MAX_AIR, DATA_MAX_STRENGTH, DATA_MAX_TRADE_TIER, DATA_MOVEMENT_SOUND_DISTANCE_OFFSET, DATA_NAME_AUTHOR, DATA_NAME_RAW_TEXT, DATA_NAMETAG, DATA_NEARBY_CURED_DISCOUNT, DATA_NEARBY_CURED_DISCOUNT_TIMESTAMP, DATA_NPC_ACTIONS, DATA_NPC_SKIN_DATA, DATA_OLD_SWELL, DATA_OWNER_EID, DATA_PADDLE_TIME_LEFT, DATA_PADDLE_TIME_RIGHT, DATA_PICKUP_COUNT, DATA_PLAYER_BED_POSITION, DATA_PLAYER_BUTTON_TEXT, DATA_PLAYER_FLAG_DEAD, DATA_PLAYER_FLAG_SLEEP, DATA_PLAYER_FLAGS, DATA_PLAYER_HAS_DIED, DATA_PLAYER_INDEX, DATA_PLAYER_LAST_DEATH_DIMENSION, DATA_PLAYER_LAST_DEATH_POS, DATA_POTION_AMBIENT, DATA_POTION_AUX_VALUE, DATA_POTION_COLOR, DATA_PUFFERFISH_SIZE, DATA_RIDER_MAX_ROTATION, DATA_RIDER_MIN_ROTATION, DATA_RIDER_ROTATION_LOCKED, DATA_RIDER_ROTATION_OFFSET, DATA_RIDER_SEAT_POSITION, DATA_SCALE, DATA_SCORE_TAG, DATA_SHULKER_ATTACH_FACE, DATA_SHULKER_ATTACH_POS, DATA_SHULKER_ATTACHED, DATA_SHULKER_PEEK_ID, DATA_SITTING_AMOUNT, DATA_SITTING_AMOUNT_PREVIOUS, DATA_SKIN_ID, DATA_SPAWN_TIME, DATA_SPAWNING_FRAMES, DATA_SPELL_CASTING_COLOR, DATA_STRENGTH, DATA_SWELL, DATA_SWELL_DIR, DATA_TARGET_EID, DATA_TRADE_EXPERIENCE, DATA_TRADE_TIER, DATA_TRADING_CAREER, DATA_TRADING_PLAYER_EID, DATA_TYPE_BYTE, DATA_TYPE_FLOAT, DATA_TYPE_INT, DATA_TYPE_LONG, DATA_TYPE_NBT, DATA_TYPE_POS, DATA_TYPE_SHORT, DATA_TYPE_STRING, DATA_TYPE_VECTOR3F, DATA_USING_ITEM, DATA_VARIANT, DATA_WITHER_INVULNERABLE_TICKS, DATA_WITHER_TARGET_1, DATA_WITHER_TARGET_2, DATA_WITHER_TARGET_3, dataProperties, deadTicks, effects, EMPTY_ARRAY, entityCollisionReduction, entityCount, entityUniqueId, fallDistance, fireProof, fireTicks, firstMove, freezingTicks, hasSpawned, headYawDelta, health, highestPosition, id, inBlock, inEndPortal, inPortalTicks, invulnerable, isCollided, isCollidedHorizontally, isCollidedVertically, isPlayer, isStatic, justCreated, keepMovement, lastDamageCause, lastHeadYaw, lastMotionX, lastMotionY, lastMotionZ, lastPitch, lastUpdate, lastX, lastY, lastYaw, lastZ, maxFireTicks, motionChanged, motionX, motionY, motionZ, namedTag, noClip, noDamageTicks, onGround, passengers, pitchDelta, positionChanged, riding, saveWithChunk, scale, server, temporalVector, ticksLived, yawDelta, ySize
Fields inherited from interface cn.nukkit.entity.EntityCanAttack
EMPTY_FLOAT_ARRAY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntityAngerValue
(Entity entity, int addition) boolean
attack
(EntityDamageEvent source) 当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.int
void
close()
float
获得浮动到的实体高度 , 0为实体底部Entity.getCurrentHeight()
为实体顶部
例:
值为0时,实体的脚接触水平面
值为getCurrentHeight/2时,实体的中间部分接触水平面
值为getCurrentHeight时,实体的头部接触水平面float
实体高度返回振动监听器的位置double
返回振动监听半径int
获得该实体的网络IDThe name that English name of the type of this entity.float
getWidth()
protected void
实体初始化顺序,先初始化Entity类字段->Entity构造函数->进入init方法->调用initEntity方法->子类字段初始化->子类构造函数boolean
isInAngerRange
(Entity entity) boolean
isInRangedAttackRange
(Entity entity) boolean
isInSniffRange
(Entity entity) boolean
isValidAngerEntity
(Entity entity) boolean
isValidAngerEntity
(Entity entity, boolean sniff) void
protected boolean
void
onVibrationArrive
(VibrationEvent event) 声波到达事件boolean
onVibrationOccur
(VibrationEvent event) 是否响应此振动 若响应,将会从声波源发射声波到监听器位置,并在到达时调用 onVibrationArrive() 方法 请注意,若此方法被调用,则声波必定可到达请求一个行为组实例,此方法在实体初始化行为组时调用void
setOnFire
(int seconds) Methods inherited from class cn.nukkit.entity.mob.EntityMob
attackTarget, calculateEnchantmentProtectionFactor, canEquipByDispenser, damageArmor, getArmorInventory, getDiffHandDamage, getEquipmentInventory, getInventory, onUpdate, saveNBT, spawnTo, spawnToAll
Methods inherited from class cn.nukkit.entity.EntityIntelligent
asyncPrepare, enableHeadYaw, getBehaviorGroup, getJumpingMotion, getMemoryStorage, isActive, onInteract
Methods inherited from class cn.nukkit.entity.EntityPhysical
addPreviousLiquidMovement, addTmpMoveMotion, addTmpMoveMotionXZ, calculateOffsetBoundingBox, canBeMovedByCurrents, entityBaseTick, entityBaseTick, getFallingTick, getFloatingForceFactor, getFootHeight, getGravity, getGroundFrictionFactor, getLiquidMovementSpeed, getOffsetBoundingBox, getPassableBlockFrictionFactor, handleCollideMovement, handleFloatingMovement, handleGravity, handleGroundFrictionMovement, handleLiquidMovement, handlePassableBlockFrictionMovement, isFalling, resetFallDistance, updateMovement
Methods inherited from class cn.nukkit.entity.EntityCreature
applyNameTag, playerApplyNameTag
Methods inherited from class cn.nukkit.entity.EntityLiving
blockedByShield, collidingWith, getAirTicks, getAttackTime, getAttackTimeBefore, getDrag, getDrops, getLineOfSight, getLineOfSight, getLineOfSight, getLineOfSight, getMovementSpeed, getTargetBlock, getTargetBlock, getTargetBlock, hasLineOfSight, isAttackTimeByShieldKb, isBlocking, isPersistent, kill, knockBack, onBlock, postAttack, preAttack, setAirTicks, setBlocking, setHealth, setMovementSpeed, setPersistent
Methods inherited from class cn.nukkit.entity.Entity
addEffect, addFreezingTicks, addMotion, addMovement, addTag, applyEntityCollision, attack, broadcastLinkPacket, broadcastMovement, canBePushed, canBeSavedWithChunk, canClimb, canClimbWalls, canCollide, canCollideWith, canPassThrough, canTriggerWalking, checkBlockCollision, checkChunks, checkGroundState, checkObstruction, collideWithBlock, containTag, createAddEntityPacket, createEntity, createEntity, createEntity, createEntity, createEntity, despawnFrom, despawnFromAll, dismountEntity, dismountEntity, doesTriggerPressurePlate, equals, extinguish, fall, fastMove, getAbsorption, getAge, getAllTags, getBaseOffset, getBlocksAround, getBoundingBox, getCollisionBlocks, getCurrentHeight, getDataFlag, getDataProperties, getDataProperty, getDataPropertyBoolean, getDataPropertyByte, getDataPropertyFloat, getDataPropertyInt, getDataPropertyLong, getDataPropertyNBT, getDataPropertyPos, getDataPropertyShort, getDataPropertyString, getDataPropertyType, getDataPropertyVector3f, getDefaultNBT, getDefaultNBT, getDefaultNBT, getDirection, getDirectionPlane, getDirectionVector, getEffect, getEffects, getEntityDefinitions, getEyeHeight, getFreezingEffectStrength, getFreezingTicks, getFrostbiteInjury, getHealth, getHorizontalFacing, getId, getIdentifier, getIdentifier, getKnownEntities, getKnownEntityIds, getKnownEntityProviders, getLastDamageCause, getLength, getLocation, getMaxHealth, getMetadata, getMotion, getMountedOffset, getName, getNameTag, getPassenger, getPassengers, getPosition, getRiding, getSaveId, getSaveId, getSaveId, getSaveIds, getScale, getScoreTag, getSeatPosition, getServer, getStepHeight, getSwimmingHeight, getTickCachedBlocksAround, getTickCachedCollisionBlocks, getUniqueId, getViewers, getVisibleName, handleLavaMovement, hasControllingPassenger, hasCustomName, hasEffect, hashCode, hasMetadata, hasWaterAt, hasWaterAt, heal, heal, init, init, isAlive, isBoss, isClosed, isControlling, isGliding, isImmobile, isInEndPortal, isInsideOfFire, isInsideOfLava, isInsideOfSolid, isInsideOfWater, isNameTagAlwaysVisible, isNameTagVisible, isNoClip, isOnFire, isOnGround, isOnLadder, isPassenger, isPreventingSleep, isSneaking, isSpinAttacking, isSprinting, isSwimming, isTouchingWater, isUndead, isUnderBlock, mountEntity, mountEntity, move, moveFlying, onCollideWithPlayer, onInteract, onPhysicalInteraction, onPushByPiston, onStruckByLightning, playActionAnimation, playActionAnimation, playAnimation, playAnimation, playAnimationOnEntities, playAnimationOnEntities, recalculateBoundingBox, recalculateBoundingBox, recalculateEffectColor, registerCustomEntity, registerEntity, registerEntity, registerEntity, registerEntity, removeAllEffects, removeEffect, removeMetadata, removeTag, respawnToAll, scheduleUpdate, sendData, sendData, sendData, sendData, sendPotionEffects, setAbsorption, setAmbientSoundEvent, setAmbientSoundEventName, setAmbientSoundInterval, setAmbientSoundIntervalRange, setBooleanEntityProperty, setCanBeSavedWithChunk, setCanClimb, setCanClimb, setCanClimbWalls, setCanClimbWalls, setDataFlag, setDataFlag, setDataProperty, setDataProperty, setEnumEntityProperty, setFloatEntityProperty, setFreezingEffectStrength, setFreezingTicks, setGliding, setGliding, setImmobile, setImmobile, setIntEntityProperty, setLastDamageCause, setMaxHealth, setMetadata, setMotion, setNameTag, setNameTagAlwaysVisible, setNameTagAlwaysVisible, setNameTagVisible, setNameTagVisible, setNoClip, setPosition, setPositionAndRotation, setPositionAndRotation, setRotation, setRotation, setScale, setScoreTag, setSeatPosition, setSneaking, setSneaking, setSpinAttacking, setSpinAttacking, setSprinting, setSprinting, setSwimming, setSwimming, switchLevel, teleport, teleport, teleport, teleport, teleport, teleport, updateFallState, updatePassengerPosition, updatePassengers
Methods inherited from class cn.nukkit.level.Location
abs, add, add, add, add, ceil, clone, divide, floor, fromObject, fromObject, fromObject, fromObject, fromObject, getHeadYaw, getPitch, getYaw, multiply, round, setHeadYaw, setPitch, setX, setY, setYaw, setZ, subtract, subtract, subtract, subtract, subtract, toString
Methods inherited from class cn.nukkit.level.Position
getChunk, getLevel, getLevelBlock, getLevelBlock, getLevelBlock, getLevelBlock, getLevelBlockAround, getLevelBlockAtLayer, getLevelBlockEntity, getLevelBlockState, getLevelBlockState, getLevelName, getSide, getSide, getSidePos, getTickCachedLevelBlock, getTickCachedLevelBlockAtLayer, getTypedBlockEntity, getValidLevel, isValid, setComponents, setComponents, setLevel, setStrong, setWeak
Methods inherited from class cn.nukkit.positiontracking.NamedPosition
matchesNamedPosition
Methods inherited from class cn.nukkit.math.Vector3
asBlockVector3, asVector3f, cross, distance, distance, distanceManhattan, distanceSquared, distanceSquared, dot, down, down, east, east, getAxis, getChunkSectionY, getChunkVector, getChunkX, getChunkZ, getFloorX, getFloorY, getFloorZ, getForward, getIntermediateWithXValue, getIntermediateWithYValue, getIntermediateWithZValue, getRight, getSideVec, getSouth, getUp, getWest, getX, getY, getZ, length, lengthSquared, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, normalize, north, north, rawHashCode, setComponentsAdding, setComponentsAdding, south, south, up, up, west, west
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface cn.nukkit.entity.EntityAgeable
isBaby, setBaby
Methods inherited from interface cn.nukkit.entity.EntityCanAttack
getDiffHandDamage
Methods inherited from interface cn.nukkit.entity.ai.controller.EntityControlUtils
getLookTarget, getMoveDirectionEnd, getMoveDirectionStart, getMoveTarget, hasMoveDirection, isEnablePitch, isShouldUpdateMoveDirection, setEnablePitch, setLookTarget, setMoveDirectionEnd, setMoveDirectionStart, setMoveTarget, setShouldUpdateMoveDirection
Methods inherited from interface cn.nukkit.inventory.EntityInventoryHolder
getBoots, getChestplate, getHelmet, getItemInHand, getItemInOffhand, getLeggings, setBoots, setChestplate, setHelmet, setItemInHand, setItemInHand, setItemInOffhand, setItemInOffhand, setLeggings
Methods inherited from interface cn.nukkit.entity.EntityNameable
applyNameTag, getNameTag, isNameTagVisible, isPersistent, playerApplyNameTag, setNameTag, setNameTagVisible, setPersistent
Methods inherited from interface cn.nukkit.entity.ai.evaluator.LogicalUtils
all, all, any, any
Methods inherited from interface cn.nukkit.level.vibration.VibrationListener
asEntity, isEntity
-
Field Details
-
NETWORK_ID
public static final int NETWORK_ID- See Also:
-
lastDetectTime
protected int lastDetectTime -
lastCollideTime
protected int lastCollideTime -
waitForVibration
protected boolean waitForVibration
-
-
Constructor Details
-
EntityWarden
-
-
Method Details
-
requireBehaviorGroup
Description copied from class:EntityIntelligent
请求一个行为组实例,此方法在实体初始化行为组时调用- Overrides:
requireBehaviorGroup
in classEntityIntelligent
- Returns:
- 新创建的行为组
-
getNetworkId
public int getNetworkId()Description copied from class:Entity
获得该实体的网络IDGet the network ID of the entity
- Specified by:
getNetworkId
in classEntity
- Returns:
- the network id
-
getHeight
public float getHeight()Description copied from class:Entity
实体高度entity Height
-
getFloatingHeight
Description copied from class:EntityPhysical
获得浮动到的实体高度 , 0为实体底部Entity.getCurrentHeight()
为实体顶部
例:
值为0时,实体的脚接触水平面
值为getCurrentHeight/2时,实体的中间部分接触水平面
值为getCurrentHeight时,实体的头部接触水平面- Overrides:
getFloatingHeight
in classEntityPhysical
- Returns:
- the float
-
getWidth
public float getWidth() -
initEntity
protected void initEntity()Description copied from class:Entity
实体初始化顺序,先初始化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
- Overrides:
initEntity
in classEntityMob
-
getOriginalName
Description copied from class:Entity
The name that English name of the type of this entity.- Overrides:
getOriginalName
in classEntity
-
getListenerVector
Description copied from interface:VibrationListener
返回振动监听器的位置- Specified by:
getListenerVector
in interfaceVibrationListener
- Returns:
- Vector3
-
onVibrationOccur
Description copied from interface:VibrationListener
是否响应此振动 若响应,将会从声波源发射声波到监听器位置,并在到达时调用 onVibrationArrive() 方法 请注意,若此方法被调用,则声波必定可到达- Specified by:
onVibrationOccur
in interfaceVibrationListener
- Parameters:
event
- 振动事件- Returns:
- boolean
-
onVibrationArrive
Description copied from interface:VibrationListener
声波到达事件- Specified by:
onVibrationArrive
in interfaceVibrationListener
- Parameters:
event
- 振动事件
-
getListenRange
public double getListenRange()Description copied from interface:VibrationListener
返回振动监听半径- Specified by:
getListenRange
in interfaceVibrationListener
- Returns:
- double
-
close
public void close() -
knockBack
- Overrides:
knockBack
in classEntityLiving
-
onCollide
- Overrides:
onCollide
in classEntityPhysical
collidingEntities
- 碰撞的实体- Returns:
- false以拦截实体碰撞运动计算
-
attack
Description copied from class:Entity
当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.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).
-
addEntityAngerValue
-
isValidAngerEntity
-
isValidAngerEntity
-
isInSniffRange
-
isInRangedAttackRange
-
isInAngerRange
-
calHeartBeatDelay
public int calHeartBeatDelay() -
setOnFire
public void setOnFire(int seconds)
-