程序包 cn.nukkit
类 Player
- 所有已实现的接口:
CommandSender
,EntityDamageable
,EntityNameable
,InventoryHolder
,IPlayer
,ChunkLoader
,Metadatable
,Permissible
,ServerOperator
,Cloneable
public class Player
extends EntityHuman
implements CommandSender, InventoryHolder, ChunkLoader, IPlayer
- 作者:
- MagicDroidX & Box (Nukkit Project)
-
字段概要
修饰符和类型字段说明static final int
protected AdventureSettings
static final int
static final int
protected boolean
protected int
protected int
protected final int
protected Long
protected int
protected boolean
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected CraftingGrid
protected CraftingTransaction
int
long
static final int
static final int
static final float
protected com.google.common.cache.Cache<String,
FormWindowDialog> 我们使用google的cache来存储NPC对话框发送信息 原因是发送过去的对话框客户端有几率不响应,在特定情况下我们无法清除这些对话框,这会导致内存泄漏 5分钟后未响应的对话框会被清除protected String
protected Map<Long,
DummyBossBar> static final Player[]
protected boolean
static final int
protected EnchantTransaction
protected PlayerFood
protected Vector3
protected int
protected Map<Integer,
FormWindow> int
static final int
protected GrindstoneTransaction
protected int
protected final SourceInterface
protected String
long
protected int
protected int
protected int
protected Vector3
protected double
long
protected final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<Boolean>
boolean
boolean
static final float
protected int
protected Vector3
protected int
static final int
static final int
static final int
static final int
int
boolean
protected PlayerUIInventory
protected long
protected boolean
protected RepairItemTransaction
protected static final int
protected Map<Integer,
FormWindow> protected boolean
protected Vector3
static final int
protected SmithingTransaction
protected final InetSocketAddress
protected Vector3
boolean
protected Position
protected final int
static final int
protected int
protected int
protected float
static final int
static final int
protected Vector3
protected String
static final int
protected int
protected int
从类继承的字段 cn.nukkit.entity.EntityHuman
DATA_PLAYER_BED_POSITION, DATA_PLAYER_BUTTON_TEXT, DATA_PLAYER_FLAG_DEAD, DATA_PLAYER_FLAG_SLEEP, DATA_PLAYER_FLAGS, rawUUID, skin, uuid
从类继承的字段 cn.nukkit.entity.EntityHumanType
enderChestInventory, inventory, offhandInventory
从类继承的字段 cn.nukkit.entity.EntityLiving
attackTime, invisible, movementSpeed, turtleTicks
从类继承的字段 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_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_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_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_FIRE_IMMUNE, DATA_FLAG_GLIDING, DATA_FLAG_GRAVITY, DATA_FLAG_HAS_COLLISION, 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_RAM_ATTACK, DATA_FLAG_REARING, DATA_FLAG_RESTING, DATA_FLAG_RIDER_CAN_PICK, DATA_FLAG_RIDING, DATA_FLAG_ROARING, DATA_FLAG_ROLLING, DATA_FLAG_SADDLED, DATA_FLAG_SCARED, 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_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_INDEX, 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_UPDATE_PROPERTIES, DATA_USING_ITEM, DATA_VARIANT, DATA_WITHER_INVULNERABLE_TICKS, DATA_WITHER_TARGET_1, DATA_WITHER_TARGET_2, DATA_WITHER_TARGET_3, dataProperties, deadTicks, effects, 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, NETWORK_ID, noClip, noDamageTicks, offsetBoundingBox, onGround, passengers, pitchDelta, positionChanged, riding, scale, server, temporalVector, ticksLived, timing, yawDelta, ySize
-
构造器概要
构造器说明Player
(SourceInterface interfaz, Long clientID, String ip, int port) Player
(SourceInterface interfaz, Long clientID, InetSocketAddress socketAddress) -
方法概要
修饰符和类型方法说明addAttachment
(Plugin plugin) addAttachment
(Plugin plugin, String name) addAttachment
(Plugin plugin, String name, Boolean value) protected void
void
addExperience
(int add) void
addExperience
(int add, boolean playLevelUpSound) void
addMovement
(double x, double y, double z, double yaw, double pitch, double headYaw) int
addServerSettings
(FormWindow window) Shows a new setting page in game settings You can find out settings result by listening to PlayerFormRespondedEventint
int
int
int
asEntity()
asPlayer()
boolean
attack
(EntityDamageEvent source) boolean
awardAchievement
(String achievementId) boolean
batchDataPacket
(DataPacket packet) 已过时。static int
calculateRequireExperience
(int level) boolean
canCollideWith
(Entity entity) boolean
canInteract
(Vector3 pos, double maxDistance) boolean
canInteract
(Vector3 pos, double maxDistance, double maxDiff) boolean
boolean
Sends a chat message as this player.protected void
protected void
protected void
checkGroundState
(double movX, double movY, double movZ, double dx, double dy, double dz) void
protected void
void
protected boolean
void
void
void
close()
void
close
(TextContainer message) void
close
(TextContainer message, String reason) void
close
(TextContainer message, String reason, boolean notify) void
void
void
protected void
void
completeUsingItem
(int itemId, int action) long
createBossBar
(DummyBossBar dummyBossBar) Creates and sends a BossBar to the playerlong
createBossBar
(String text, int length) 已过时。boolean
dataPacket
(DataPacket packet) 0 is true -1 is false other is identiferint
dataPacket
(DataPacket packet, boolean needACK) 已过时。boolean
dataPacketImmediately
(DataPacket packet) boolean
dataResourcePacket
(DataPacket packet) boolean
directDataPacket
(DataPacket packet) 已过时。int
directDataPacket
(DataPacket packet, boolean needACK) 已过时。boolean
Whether the entity can active pressure plates.protected void
dropAndGetItem
(Item item) Drops an item on the ground in front of the player.boolean
Drops an item on the ground in front of the player.boolean
entityBaseTick
(int tickDiff) boolean
boolean
fastMove
(double dx, double dy, double dz) protected void
boolean
已过时。static BatchPacket
getChunkCacheFromData
(int chunkX, int chunkZ, int subChunkCount, byte[] payload) 已过时。int
Item[]
getDrops()
getDummyBossBar
(long bossBarId) Get a DummyBossBar objectGet all DummyBossBar objectsgetEntityPlayerLookingAt
(int maxDistance) Returns the Entity the player is looking at currentlyint
int
得到这个玩家第一次游戏的时间。int
int
int
int
得到这个玩家上次加入游戏的时间。int
getMetadata
(String metadataKey) getName()
The current name used by this entity in the name tag, or the static name if the entity don't have nametag.int
The name that English name of the type of this entity.int
getPing()
得到这个接口的Player
对象。int
getPort()
boolean
EntitySelector 返回命令发送者所在的服务器。float
getSpawn()
The block that holds the player respawn position.int
int
int
getWindowById
(int id) int
getWindowId
(Inventory inventory) void
Adds the items to the main player inventory and drops on the floor any excess.void
handleDataPacket
(DataPacket packet) boolean
hasAchievement
(String achievementId) boolean
已过时。int
hashCode()
boolean
hasMetadata
(String metadataKey) boolean
hasPermission
(Permission permission) boolean
hasPermission
(String name) boolean
返回这个玩家以前是否来过服务器。boolean
void
hidePlayer
(Player player) protected void
boolean
boolean
isBanned()
返回这个玩家是否被封禁(ban)。boolean
boolean
boolean
boolean
boolean
boolean
isEntity()
boolean
boolean
boolean
boolean
isOnline()
返回这个玩家是否在线。boolean
isOp()
返回这个对象是不是服务器管理员。boolean
isPermissionSet
(Permission permission) boolean
isPermissionSet
(String name) boolean
isPlayer()
boolean
boolean
boolean
boolean
boolean
Returns whether the player is currently using an item (right-click and hold).protected boolean
isValidRespawnBlock
(Block block) boolean
返回这个玩家是否已加入白名单。boolean
kick()
boolean
kick
(PlayerKickEvent.Reason reason) boolean
kick
(PlayerKickEvent.Reason reason, boolean isAdmin) boolean
kick
(PlayerKickEvent.Reason reason, String reasonString) boolean
kick
(PlayerKickEvent.Reason reason, String reasonString, boolean isAdmin) boolean
boolean
void
kill()
protected void
void
onBlockChanged
(Vector3 block) void
void
onChunkChanged
(FullChunk chunk) void
onChunkLoaded
(FullChunk chunk) void
onChunkPopulated
(FullChunk chunk) void
onChunkUnloaded
(FullChunk chunk) void
boolean
onUpdate
(int currentTick) protected boolean
boolean
pickupEntity
(Entity entity, boolean near) protected void
protected void
processMovement
(int tickDiff) void
void
removeAchievement
(String achievementId) void
void
removeAllWindows
(boolean permanent) void
removeAttachment
(PermissionAttachment attachment) void
removeBossBar
(long bossBarId) Removes a BossBarvoid
removeMetadata
(String metadataKey, Plugin owningPlugin) void
removeWindow
(Inventory inventory) protected void
removeWindow
(Inventory inventory, boolean isResponse) void
void
void
void
Resets both title animation times and subtitle for the next shown titleprotected void
respawn()
void
save()
void
save
(boolean async) void
saveNBT()
void
sendActionBar
(String title) void
sendActionBar
(String title, int fadein, int duration, int fadeout) void
void
sendAnnouncement
(String message) void
sendAnnouncement
(String source, String message) void
void
void
void
sendChunk
(int x, int z, int subChunkCount, byte[] payload) void
sendChunk
(int x, int z, DataPacket packet) void
void
void
sendExperience
(int exp) void
void
sendExperienceLevel
(int level) void
sendMessage
(TextContainer message) 给命令发送者返回信息。void
sendMessage
(String message) 给命令发送者返回信息。void
sendMovementSpeed
(float speed) protected void
protected void
sendPlayStatus
(int status) protected void
sendPlayStatus
(int status, boolean immediate) void
void
void
sendPopupJukebox
(String message) void
sendPosition
(Vector3 pos) void
sendPosition
(Vector3 pos, double yaw) void
sendPosition
(Vector3 pos, double yaw, double pitch) void
sendPosition
(Vector3 pos, double yaw, double pitch, int mode) void
sendPosition
(Vector3 pos, double yaw, double pitch, int mode, Player[] targets) void
sendRawTextMessage
(RawText text) void
sendScoreboard
(Scoreboard scoreboard, DisplaySlot slot) void
已过时。void
sendSystem
(String message) void
void
void
void
void
void
sendTranslation
(String message) void
sendTranslation
(String message, String[] parameters) void
sendWhisper
(String message) void
sendWhisper
(String source, String message) void
setAdventureSettings
(AdventureSettings adventureSettings) void
setAllowFlight
(boolean value) 已过时。void
setAllowInteract
(boolean value) void
setAllowInteract
(boolean value, boolean containers) void
setAllowModifyWorld
(boolean value) void
setAttribute
(Attribute attribute) void
setAutoJump
(boolean value) 已过时。void
setBanned
(boolean value) 设置这个玩家是否被封禁(ban)。void
setButtonText
(String text) void
setCheckMovement
(boolean checkMovement) void
setCraftingGrid
(CraftingGrid grid) void
setDisplayName
(String displayName) void
setEnableClientCommand
(boolean enable) void
setExperience
(int exp) void
setExperience
(int exp, int level) void
setExperience
(int exp, int level, boolean playLevelUpSound) void
setFoodEnabled
(boolean foodEnabled) boolean
setGamemode
(int gamemode) boolean
setGamemode
(int gamemode, boolean clientSide) boolean
setGamemode
(int gamemode, boolean clientSide, AdventureSettings newSettings) void
setHasSeenCredits
(boolean hasSeenCredits) void
setHealth
(float health) void
void
setMaxHealth
(int maxHealth) void
setMetadata
(String metadataKey, MetadataValue newMetadataValue) boolean
void
setMovementSpeed
(float speed) void
setMovementSpeed
(float speed, boolean send) void
setNoShieldTicks
(int noShieldTicks) void
setOp
(boolean value) 把这个对象设置成服务器管理员。void
setRawTextActionBar
(RawText text) void
setRawTextActionBar
(RawText text, int fadein, int duration, int fadeout) void
setRawTextSubTitle
(RawText text) void
setRawTextTitle
(RawText text) void
void
setRemoveFormat
(boolean remove) void
setShowingCredits
(boolean showingCredits) void
void
void
setSpawnBlock
(Vector3 spawnBlock) Sets the position of the block that holds the player respawn position.void
setSprinting
(boolean value) void
setSubtitle
(String subtitle) void
setTimeSinceRest
(int timeSinceRest) void
setTitleAnimationTimes
(int fadein, int duration, int fadeout) void
setUsingItem
(boolean value) void
setViewDistance
(int distance) void
void
setWhitelisted
(boolean value) 把这个玩家加入白名单,或者取消这个玩家的白名单。void
shakeCamera
(float intensity, float duration, CameraShakePacket.CameraShakeType shakeType, CameraShakePacket.CameraShakeAction shakeAction) void
void
showDialogWindow
(FormWindowDialog dialog) int
showFormWindow
(FormWindow window) Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEventint
showFormWindow
(FormWindow window, int id) Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEventvoid
showPlayer
(Player player) void
showXboxProfile
(String xuid) Show a window of a XBOX account's profileboolean
void
void
void
startFishing
(Item fishingRod) Start fishingvoid
void
stopFishing
(boolean click) Stop fishingvoid
boolean
switchLevel
(Level level) boolean
teleport
(Location location, PlayerTeleportEvent.TeleportCause cause) void
teleportImmediate
(Location location) void
teleportImmediate
(Location location, PlayerTeleportEvent.TeleportCause cause) toString()
void
transfer
(InetSocketAddress address) void
unloadChunk
(int x, int z) void
unloadChunk
(int x, int z, Level level) void
updateBossBar
(String text, int length, long bossBarId) 已过时。void
void
updateTrackingPositions
(boolean delayed) 从类继承的方法 cn.nukkit.entity.EntityHuman
despawnFrom, getBaseOffset, getEyeHeight, getHeight, getLength, getNetworkId, getRawUniqueId, getSkin, getSwimmingHeight, getUniqueId, getWidth
从类继承的方法 cn.nukkit.entity.EntityHumanType
applyNameTag, applyNameTag, calculateEnchantmentProtectionFactor, damageArmor, getEnderChestInventory, getInventory, getOffhandInventory, setOnFire
从类继承的方法 cn.nukkit.entity.EntityCreature
onInteract, playerApplyNameTag
从类继承的方法 cn.nukkit.entity.EntityLiving
blockedByShield, collidingWith, entityBaseTick, getAirTicks, getDrag, getGravity, getLineOfSight, getLineOfSight, getLineOfSight, getLineOfSight, getMovementSpeed, getTargetBlock, getTargetBlock, getTargetBlock, hasLineOfSight, isBlocking, isPersistent, knockBack, knockBack, postAttack, preAttack, setAirTicks, setBlocking, setPersistent
从类继承的方法 cn.nukkit.entity.Entity
addEffect, addFreezingTicks, addMotion, addTag, applyEntityCollision, attack, broadcastLinkPacket, canBeMovedByCurrents, canBePushed, canClimb, canClimbWalls, canCollide, canPassThrough, canTriggerWalking, checkObstruction, collideWithBlock, containTag, createAddEntityPacket, createEntity, createEntity, createEntity, createEntity, despawnFromAll, dismountEntity, dismountEntity, extinguish, fall, getAbsorption, getAllTags, 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, getFreezingEffectStrength, getFreezingTicks, getHealth, getHorizontalFacing, getId, getKnownEntityIds, getLastDamageCause, getLocation, getMaxHealth, getMotion, getMountedOffset, getNameTag, getPassenger, getPassengers, getPosition, getRiding, getSaveId, getSaveId, getSaveId, getSaveIds, getScale, getScoreTag, getSeatPosition, getStepHeight, getViewers, getVisibleName, handleLavaMovement, hasControllingPassenger, hasCustomName, hasEffect, hasWaterAt, heal, heal, 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, onPushByPiston, onStruckByLightning, recalculateBoundingBox, recalculateBoundingBox, recalculateEffectColor, registerEntity, registerEntity, removeAllEffects, removeEffect, removeTag, respawnToAll, scheduleUpdate, sendData, sendData, sendData, sendData, sendPotionEffects, setAbsorption, setCanClimb, setCanClimb, setCanClimbWalls, setCanClimbWalls, setDataFlag, setDataFlag, setDataProperty, setDataProperty, setFreezingEffectStrength, setFreezingTicks, setGliding, setGliding, setImmobile, setImmobile, setLastDamageCause, setNameTag, setNameTagAlwaysVisible, setNameTagAlwaysVisible, setNameTagVisible, setNameTagVisible, setNoClip, setPosition, setPositionAndRotation, setPositionAndRotation, setRotation, setRotation, setScale, setScoreTag, setSeatPosition, setSneaking, setSneaking, setSpinAttacking, setSpinAttacking, setSprinting, setSwimming, setSwimming, spawnToAll, teleport, teleport, teleport, teleport, teleport, updateFallState, updateMovement, updatePassengerPosition, updatePassengers
从类继承的方法 cn.nukkit.level.Location
abs, add, add, add, add, ceil, clone, divide, floor, fromObject, fromObject, fromObject, fromObject, fromObject, getHeadYaw, getPitch, getYaw, multiply, round, setPitch, setYaw, subtract, subtract, subtract, subtract, subtract
从类继承的方法 cn.nukkit.level.Position
getChunk, getLevel, getLevelBlock, getLevelBlockAround, getLevelBlockAtLayer, getLevelBlockEntity, getLevelBlockState, getLevelBlockState, getLevelName, getSide, getSide, getTypedBlockEntity, getValidLevel, isValid, setComponents, setComponents, setLevel, setStrong, setWeak
从类继承的方法 cn.nukkit.positiontracking.NamedPosition
matchesNamedPosition
从类继承的方法 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, setX, setY, setZ, south, south, up, up, west, west
从接口继承的方法 cn.nukkit.level.ChunkLoader
getLevel, getPosition, getX, getZ
从接口继承的方法 cn.nukkit.command.CommandSender
getLocation, getPosition
从接口继承的方法 cn.nukkit.entity.EntityNameable
getNameTag, isNameTagVisible, isPersistent, playerApplyNameTag, setNameTag, setNameTagVisible, setPersistent
从接口继承的方法 cn.nukkit.inventory.InventoryHolder
getInventory
从接口继承的方法 cn.nukkit.IPlayer
getUniqueId
-
字段详细资料
-
EMPTY_ARRAY
-
SURVIVAL
public static final int SURVIVAL- 另请参阅:
-
CREATIVE
public static final int CREATIVE- 另请参阅:
-
ADVENTURE
public static final int ADVENTURE- 另请参阅:
-
SPECTATOR
public static final int SPECTATOR- 另请参阅:
-
VIEW
public static final int VIEW- 另请参阅:
-
SURVIVAL_SLOTS
public static final int SURVIVAL_SLOTS- 另请参阅:
-
CREATIVE_SLOTS
public static final int CREATIVE_SLOTS- 另请参阅:
-
CRAFTING_SMALL
public static final int CRAFTING_SMALL- 另请参阅:
-
CRAFTING_BIG
public static final int CRAFTING_BIG- 另请参阅:
-
CRAFTING_ANVIL
public static final int CRAFTING_ANVIL- 另请参阅:
-
CRAFTING_ENCHANT
public static final int CRAFTING_ENCHANT- 另请参阅:
-
CRAFTING_BEACON
public static final int CRAFTING_BEACON- 另请参阅:
-
CRAFTING_GRINDSTONE
- 另请参阅:
-
CRAFTING_STONECUTTER
- 另请参阅:
-
CRAFTING_CARTOGRAPHY
- 另请参阅:
-
CRAFTING_SMITHING
- 另请参阅:
-
DEFAULT_SPEED
public static final float DEFAULT_SPEED- 另请参阅:
-
MAXIMUM_SPEED
public static final float MAXIMUM_SPEED- 另请参阅:
-
PERMISSION_CUSTOM
public static final int PERMISSION_CUSTOM- 另请参阅:
-
PERMISSION_OPERATOR
public static final int PERMISSION_OPERATOR- 另请参阅:
-
PERMISSION_MEMBER
public static final int PERMISSION_MEMBER- 另请参阅:
-
PERMISSION_VISITOR
public static final int PERMISSION_VISITOR- 另请参阅:
-
ANVIL_WINDOW_ID
public static final int ANVIL_WINDOW_ID- 另请参阅:
-
ENCHANT_WINDOW_ID
public static final int ENCHANT_WINDOW_ID- 另请参阅:
-
BEACON_WINDOW_ID
public static final int BEACON_WINDOW_ID- 另请参阅:
-
GRINDSTONE_WINDOW_ID
-
SMITHING_WINDOW_ID
-
RESOURCE_PACK_CHUNK_SIZE
- 另请参阅:
-
interfaz
-
playedBefore
public boolean playedBefore -
spawned
public boolean spawned -
loggedIn
public boolean loggedIn -
locallyInitialized
-
gamemode
public int gamemode -
lastBreak
public long lastBreak -
windowCnt
protected int windowCnt -
windows
-
windowIndex
-
permanentWindows
-
closingWindowId
-
messageCounter
protected int messageCounter -
speed
-
achievements
-
craftingType
public int craftingType -
playerUIInventory
-
craftingGrid
-
craftingTransaction
-
enchantTransaction
-
repairItemTransaction
-
grindstoneTransaction
-
smithingTransaction
-
creationTime
public long creationTime -
randomClientId
protected long randomClientId -
forceMovement
-
teleportPosition
-
connected
protected boolean connected -
socketAddress
-
removeFormat
protected boolean removeFormat -
username
-
iusername
-
displayName
-
startAction
protected int startAction -
sleeping
-
clientID
-
stepHeight
protected float stepHeight -
usedChunks
-
chunkLoadCount
protected int chunkLoadCount -
loadQueue
-
nextChunkOrderRun
protected int nextChunkOrderRun -
newPosition
-
chunkRadius
protected int chunkRadius -
viewDistance
protected int viewDistance -
chunksPerTick
protected final int chunksPerTick -
spawnThreshold
protected final int spawnThreshold -
spawnPosition
-
spawnBlockPosition
-
inAirTicks
protected int inAirTicks -
startAirTicks
protected int startAirTicks -
adventureSettings
-
checkMovement
protected boolean checkMovement -
foodData
-
enableClientCommand
protected boolean enableClientCommand -
lastEnderPearl
protected int lastEnderPearl -
lastChorusFruitTeleport
protected int lastChorusFruitTeleport -
breakingBlock
-
pickedXPOrb
public int pickedXPOrb -
formWindowCount
protected int formWindowCount -
formWindows
-
serverSettings
-
dialogWindows
@PowerNukkitXOnly @Since("1.6.0.0-PNX") protected com.google.common.cache.Cache<String,FormWindowDialog> dialogWindows我们使用google的cache来存储NPC对话框发送信息 原因是发送过去的对话框客户端有几率不响应,在特定情况下我们无法清除这些对话框,这会导致内存泄漏 5分钟后未响应的对话框会被清除 -
dummyBossBars
-
shouldLogin
protected boolean shouldLogin -
fishing
-
lastSkinChange
public long lastSkinChange -
lastRightClickTime
protected double lastRightClickTime -
lastRightClickPos
-
lastPlayerdLevelUpSoundTime
-
-
构造器详细资料
-
Player
-
Player
-
-
方法详细资料
-
getSoulSpeedMultiplier
public float getSoulSpeedMultiplier() -
getStartActionTick
public int getStartActionTick() -
startAction
public void startAction() -
stopAction
public void stopAction() -
getLastEnderPearlThrowingTick
public int getLastEnderPearlThrowingTick() -
onThrowEnderPearl
public void onThrowEnderPearl() -
getLastChorusFruitTeleport
public int getLastChorusFruitTeleport() -
onChorusFruitTeleport
public void onChorusFruitTeleport() -
getViewingEnderChest
-
setViewingEnderChest
-
getLeaveMessage
-
getClientSecret
-
getClientId
已过时。This might disappear in the future. Please use getUniqueId() instead (IP + clientId + name combo, in the future it'll change to real UUID for online auth)- 返回:
- random client id
-
isBanned
public boolean isBanned()从接口复制的说明:IPlayer
返回这个玩家是否被封禁(ban)。
Returns if this player is banned. -
setBanned
public void setBanned(boolean value) 从接口复制的说明:IPlayer
设置这个玩家是否被封禁(ban)。
Sets this player to be banned or to be pardoned. -
isWhitelisted
public boolean isWhitelisted()从接口复制的说明:IPlayer
返回这个玩家是否已加入白名单。
Returns if this player is pardoned by whitelist.- 指定者:
isWhitelisted
在接口中IPlayer
- 返回:
- 这个玩家是否已加入白名单。
If this player is pardoned by whitelist. - 另请参阅:
-
setWhitelisted
public void setWhitelisted(boolean value) 从接口复制的说明:IPlayer
把这个玩家加入白名单,或者取消这个玩家的白名单。
Adds this player to the white list, or removes it from the whitelist.- 指定者:
setWhitelisted
在接口中IPlayer
- 参数:
value
- 如果为true
,把玩家加入白名单。如果为false
,取消这个玩家的白名单。
true
for add andfalse
for remove.- 另请参阅:
-
getPlayer
从接口复制的说明:IPlayer
得到这个接口的Player
对象。
Returns aPlayer
object for this interface. -
getFirstPlayed
从接口复制的说明:IPlayer
得到这个玩家第一次游戏的时间。
Returns the time this player first played in this server.- 指定者:
getFirstPlayed
在接口中IPlayer
- 返回:
- Unix时间(以秒为单位。
Unix time in seconds.
-
getLastPlayed
从接口复制的说明:IPlayer
得到这个玩家上次加入游戏的时间。
Returns the time this player last joined in this server.- 指定者:
getLastPlayed
在接口中IPlayer
- 返回:
- Unix时间(以秒为单位。
Unix time in seconds.
-
hasPlayedBefore
public boolean hasPlayedBefore()从接口复制的说明:IPlayer
返回这个玩家以前是否来过服务器。
Returns if this player has played in this server before.如果想得到这个玩家是不是第一次玩,可以使用:
If you want to know if this player is the first time playing in this server, you can use:
if(!player.hasPlayerBefore()) {...}
- 指定者:
hasPlayedBefore
在接口中IPlayer
- 返回:
- 这个玩家以前是不是玩过游戏。
If this player has played in this server before.
-
getAdventureSettings
-
setAdventureSettings
-
resetInAirTicks
public void resetInAirTicks() -
setAllowFlight
已过时。 -
getAllowFlight
已过时。 -
setAllowModifyWorld
public void setAllowModifyWorld(boolean value) -
setAllowInteract
public void setAllowInteract(boolean value) -
setAllowInteract
public void setAllowInteract(boolean value, boolean containers) -
setAutoJump
已过时。 -
hasAutoJump
已过时。 -
spawnTo
- 覆盖:
spawnTo
在类中EntityHuman
-
getServer
从接口复制的说明:CommandSender
EntitySelector 返回命令发送者所在的服务器。
Returns the server of the command sender. -
getRemoveFormat
public boolean getRemoveFormat() -
setRemoveFormat
public void setRemoveFormat() -
setRemoveFormat
public void setRemoveFormat(boolean remove) -
canSee
-
hidePlayer
-
showPlayer
-
canCollideWith
- 覆盖:
canCollideWith
在类中Entity
-
resetFallDistance
public void resetFallDistance()- 覆盖:
resetFallDistance
在类中Entity
-
isOnline
public boolean isOnline()从接口复制的说明:IPlayer
返回这个玩家是否在线。
Returns if this player is online. -
isOp
public boolean isOp()从接口复制的说明:ServerOperator
返回这个对象是不是服务器管理员。
Returns if this object is an operator.- 指定者:
isOp
在接口中ServerOperator
- 返回:
- 这个对象是不是服务器管理员。
if this object is an operator.
-
setOp
public void setOp(boolean value) 从接口复制的说明:ServerOperator
把这个对象设置成服务器管理员。
Sets this object to be an operator or not to be.- 指定者:
setOp
在接口中ServerOperator
- 参数:
value
-true
为授予管理员,false
为取消管理员。
true
for giving this operator orfalse
for cancelling.
-
isPermissionSet
- 指定者:
isPermissionSet
在接口中Permissible
-
isPermissionSet
- 指定者:
isPermissionSet
在接口中Permissible
-
hasPermission
- 指定者:
hasPermission
在接口中Permissible
-
hasPermission
- 指定者:
hasPermission
在接口中Permissible
-
addAttachment
- 指定者:
addAttachment
在接口中Permissible
-
addAttachment
- 指定者:
addAttachment
在接口中Permissible
-
addAttachment
- 指定者:
addAttachment
在接口中Permissible
-
removeAttachment
- 指定者:
removeAttachment
在接口中Permissible
-
recalculatePermissions
public void recalculatePermissions()- 指定者:
recalculatePermissions
在接口中Permissible
-
isEnableClientCommand
public boolean isEnableClientCommand() -
setEnableClientCommand
public void setEnableClientCommand(boolean enable) -
sendCommandData
public void sendCommandData() -
getEffectivePermissions
- 指定者:
getEffectivePermissions
在接口中Permissible
-
initEntity
protected void initEntity()- 覆盖:
initEntity
在类中EntityHuman
-
isPlayer
public boolean isPlayer()- 指定者:
isPlayer
在接口中CommandSender
-
asPlayer
- 指定者:
asPlayer
在接口中CommandSender
-
isEntity
public boolean isEntity()- 指定者:
isEntity
在接口中CommandSender
- 返回:
- whether the sender is an entity
please use this method to check whether the sender is an entity instead of using code"xxx instanceof Entity"
because the sender may not an instance of"Entity"
but in fact it is executing commands identity as an entity(eg:"ExecutorCommandSender"
)
-
asEntity
- 指定者:
asEntity
在接口中CommandSender
-
removeAchievement
-
hasAchievement
-
isConnected
public boolean isConnected() -
getDisplayName
-
setDisplayName
-
setSkin
- 覆盖:
setSkin
在类中EntityHuman
-
getAddress
-
getPort
public int getPort() -
getSocketAddress
-
getNextPosition
-
isSleeping
public boolean isSleeping() -
getInAirTicks
public int getInAirTicks() -
isUsingItem
public boolean isUsingItem()Returns whether the player is currently using an item (right-click and hold).- 返回:
- bool
-
setUsingItem
public void setUsingItem(boolean value) -
getButtonText
-
setButtonText
-
unloadChunk
public void unloadChunk(int x, int z) -
unloadChunk
-
isInOverWorld
public boolean isInOverWorld() -
getSpawn
-
getSpawnBlock
The block that holds the player respawn position. May be null when unknown.- 返回:
- The position of a bed, respawn anchor, or null when unknown.
-
setSpawnBlock
Sets the position of the block that holds the player respawn position. May be null when unknown.- 参数:
spawnBlock
- The position of a bed or respawn anchor
-
sendChunk
-
sendChunk
public void sendChunk(int x, int z, int subChunkCount, byte[] payload) -
sendNextChunk
protected void sendNextChunk() -
doFirstSpawn
protected void doFirstSpawn() -
updateTrackingPositions
-
updateTrackingPositions
-
orderChunks
protected boolean orderChunks() -
batchDataPacket
@DeprecationDetails(by="Cloudburst Nukkit", since="1.4.0.0-PN", replaceWith="dataPacket(DataPacket)", reason="Batching packet is now handled near the RakNet layer") @Deprecated public boolean batchDataPacket(DataPacket packet) 已过时。 -
dataPacket
0 is true -1 is false other is identifer- 参数:
packet
- packet to send- 返回:
- packet successfully sent
-
dataPacket
@DeprecationDetails(by="Cloudburst Nukkit", since="2019-05-08", replaceWith="dataPacket(DataPacket)", reason="ACKs are handled by the RakNet layer only") @PowerNukkitDifference(since="1.4.0.0-PN", info="Cloudburst changed the return values from 0/-1 to 1/0, breaking backward compatibility for no reason, we reversed that.") @Deprecated public int dataPacket(DataPacket packet, boolean needACK) 已过时。 -
directDataPacket
@Deprecated @DeprecationDetails(by="Cloudburst Nukkit", since="1.4.0.0-PN", replaceWith="dataPacket(DataPacket)", reason="Direct packets are no longer allowed") public boolean directDataPacket(DataPacket packet) 已过时。0 is true -1 is false other is identifer- 参数:
packet
- packet to send- 返回:
- packet successfully sent
-
directDataPacket
@DeprecationDetails(by="Cloudburst Nukkit", since="2019-05-08", replaceWith="dataPacket(DataPacket)", reason="ACK are handled by the RakNet layer and direct packets are no longer allowed") @PowerNukkitDifference(since="1.4.0.0-PN", info="Cloudburst changed the return values from 0/-1 to 1/0, breaking backward compatibility for no reason, we reversed that.") @Deprecated public int directDataPacket(DataPacket packet, boolean needACK) 已过时。 -
getPing
public int getPing() -
sleepOn
-
setSpawn
-
stopSleep
public void stopSleep() -
awardAchievement
-
getGamemode
public int getGamemode() -
setGamemode
public boolean setGamemode(int gamemode) -
setGamemode
public boolean setGamemode(int gamemode, boolean clientSide) -
setGamemode
-
sendSettings
已过时。 -
isSurvival
public boolean isSurvival() -
isCreative
public boolean isCreative() -
isSpectator
public boolean isSpectator() -
isAdventure
public boolean isAdventure() -
getDrops
- 覆盖:
getDrops
在类中EntityHumanType
-
fastMove
public boolean fastMove(double dx, double dy, double dz) -
checkGroundState
protected void checkGroundState(double movX, double movY, double movZ, double dx, double dy, double dz) - 覆盖:
checkGroundState
在类中Entity
-
reCalcOffsetBoundingBox
-
checkBlockCollision
protected void checkBlockCollision()- 覆盖:
checkBlockCollision
在类中Entity
-
checkNearEntities
protected void checkNearEntities() -
processMovement
protected void processMovement(int tickDiff) -
addMovement
public void addMovement(double x, double y, double z, double yaw, double pitch, double headYaw) - 覆盖:
addMovement
在类中EntityHuman
-
setMotion
-
sendAttributes
public void sendAttributes() -
onUpdate
public boolean onUpdate(int currentTick) -
entityBaseTick
public boolean entityBaseTick(int tickDiff) - 覆盖:
entityBaseTick
在类中EntityLiving
-
checkInteractNearby
public void checkInteractNearby() -
getEntityPlayerLookingAt
Returns the Entity the player is looking at currently- 参数:
maxDistance
- the maximum distance to check for entities- 返回:
- Entity|null either NULL if no entity is found or an instance of the entity
-
checkNetwork
public void checkNetwork() -
canInteract
-
canInteract
-
processLogin
protected void processLogin() -
completeLoginSequence
protected void completeLoginSequence() -
handleDataPacket
-
chat
Sends a chat message as this player. If the message begins with a / (forward-slash) it will be treated as a command.- 参数:
message
- message to send- 返回:
- successful
-
kick
public boolean kick() -
kick
-
kick
-
kick
-
kick
-
kick
-
kick
-
setViewDistance
public void setViewDistance(int distance) -
getViewDistance
public int getViewDistance() -
sendMessage
从接口复制的说明:CommandSender
给命令发送者返回信息。
Sends a message to the command sender.- 指定者:
sendMessage
在接口中CommandSender
- 参数:
message
- 要发送的信息。
Message to send.- 另请参阅:
-
sendMessage
从接口复制的说明:CommandSender
给命令发送者返回信息。
Sends a message to the command sender.- 指定者:
sendMessage
在接口中CommandSender
- 参数:
message
- 要发送的信息。
Message to send.
-
sendRawTextMessage
-
sendTranslation
-
sendTranslation
-
sendChat
-
sendChat
-
sendPopup
-
sendPopup
-
sendTip
-
clearTitle
public void clearTitle() -
resetTitleSettings
public void resetTitleSettings()Resets both title animation times and subtitle for the next shown title -
setSubtitle
-
setRawTextSubTitle
-
setTitleAnimationTimes
public void setTitleAnimationTimes(int fadein, int duration, int fadeout) -
setRawTextTitle
-
sendTitle
-
sendTitle
-
sendTitle
-
sendActionBar
-
sendActionBar
-
setRawTextActionBar
-
setRawTextActionBar
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setRawTextActionBar(RawText text, int fadein, int duration, int fadeout) -
close
public void close()- 覆盖:
close
在类中EntityHuman
-
close
-
close
-
close
-
close
-
close
-
close
-
save
public void save() -
saveNBT
public void saveNBT()- 覆盖:
saveNBT
在类中EntityHuman
-
save
public void save(boolean async) -
getOriginalName
从类复制的说明:Entity
The name that English name of the type of this entity.- 覆盖:
getOriginalName
在类中EntityHuman
-
getName
从类复制的说明:Entity
The current name used by this entity in the name tag, or the static name if the entity don't have nametag.- 指定者:
getName
在接口中CommandSender
- 指定者:
getName
在接口中IPlayer
- 覆盖:
getName
在类中EntityHuman
- 返回:
- 命令发送者的名称。
the name of the command sender. - 另请参阅:
-
kill
public void kill()- 覆盖:
kill
在类中EntityLiving
-
isValidRespawnBlock
-
respawn
@PowerNukkitDifference(info="will force using the spawnposition if the value spawnBlock is null,to fix the bug of command /spawnpoint", since="1.6.0.0-PNX") protected void respawn() -
setHealth
public void setHealth(float health) - 覆盖:
setHealth
在类中EntityLiving
-
setMaxHealth
public void setMaxHealth(int maxHealth) - 覆盖:
setMaxHealth
在类中Entity
-
getExperience
public int getExperience() -
getExperienceLevel
public int getExperienceLevel() -
addExperience
public void addExperience(int add) -
addExperience
-
calculateRequireExperience
public static int calculateRequireExperience(int level) -
setExperience
public void setExperience(int exp) -
setExperience
public void setExperience(int exp, int level) -
setExperience
-
sendExperience
public void sendExperience() -
sendExperience
public void sendExperience(int exp) -
sendExperienceLevel
public void sendExperienceLevel() -
sendExperienceLevel
public void sendExperienceLevel(int level) -
setAttribute
-
setMovementSpeed
public void setMovementSpeed(float speed) - 覆盖:
setMovementSpeed
在类中EntityLiving
-
setMovementSpeed
public void setMovementSpeed(float speed, boolean send) -
sendMovementSpeed
-
getKiller
-
attack
- 覆盖:
attack
在类中EntityHumanType
-
dropItem
Drops an item on the ground in front of the player. Returns if the item drop was successful.- 参数:
item
- to drop- 返回:
- bool if the item was dropped or if the item was null
-
dropAndGetItem
Drops an item on the ground in front of the player. Returns the dropped item.- 参数:
item
- to drop- 返回:
- EntityItem if the item was dropped or null if the item was null
-
sendPosition
-
sendPosition
-
sendPosition
-
sendPosition
-
sendPosition
-
checkChunks
protected void checkChunks()- 覆盖:
checkChunks
在类中Entity
-
checkTeleportPosition
protected boolean checkTeleportPosition() -
sendPlayStatus
protected void sendPlayStatus(int status) -
sendPlayStatus
protected void sendPlayStatus(int status, boolean immediate) -
teleport
-
forceSendEmptyChunks
protected void forceSendEmptyChunks() -
teleportImmediate
-
teleportImmediate
-
showFormWindow
Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEvent- 参数:
window
- to show- 返回:
- form id to use in
PlayerFormRespondedEvent
-
showFormWindow
Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEvent- 参数:
window
- to showid
- form id- 返回:
- form id to use in
PlayerFormRespondedEvent
-
showDialogWindow
-
addServerSettings
Shows a new setting page in game settings You can find out settings result by listening to PlayerFormRespondedEvent- 参数:
window
- to show on settings page- 返回:
- form id to use in
PlayerFormRespondedEvent
-
createBossBar
已过时。Creates and sends a BossBar to the player- 参数:
text
- The BossBar messagelength
- The BossBar percentage- 返回:
- bossBarId The BossBar ID, you should store it if you want to remove or update the BossBar later
-
createBossBar
Creates and sends a BossBar to the player- 参数:
dummyBossBar
- DummyBossBar Object (Instantiate it by the Class Builder)- 返回:
- bossBarId The BossBar ID, you should store it if you want to remove or update the BossBar later
- 另请参阅:
-
getDummyBossBar
Get a DummyBossBar object- 参数:
bossBarId
- The BossBar ID- 返回:
- DummyBossBar object
- 另请参阅:
-
getDummyBossBars
Get all DummyBossBar objects- 返回:
- DummyBossBars Map
-
updateBossBar
已过时。Updates a BossBar- 参数:
text
- The new BossBar messagelength
- The new BossBar lengthbossBarId
- The BossBar ID
-
removeBossBar
public void removeBossBar(long bossBarId) Removes a BossBar- 参数:
bossBarId
- The BossBar ID
-
getWindowId
-
getWindowById
-
addWindow
-
addWindow
-
addWindow
-
addWindow
-
getTopWindow
-
removeWindow
-
removeWindow
-
sendAllInventories
public void sendAllInventories() -
addDefaultWindows
protected void addDefaultWindows() -
getUIInventory
-
getCursorInventory
-
getCraftingGrid
-
setCraftingGrid
-
resetCraftingGridType
public void resetCraftingGridType() -
removeAllWindows
public void removeAllWindows() -
removeAllWindows
public void removeAllWindows(boolean permanent) -
getClosingWindowId
-
setMetadata
- 指定者:
setMetadata
在接口中Metadatable
- 覆盖:
setMetadata
在类中Entity
-
getMetadata
- 指定者:
getMetadata
在接口中Metadatable
- 覆盖:
getMetadata
在类中Entity
-
hasMetadata
- 指定者:
hasMetadata
在接口中Metadatable
- 覆盖:
hasMetadata
在类中Entity
-
removeMetadata
- 指定者:
removeMetadata
在接口中Metadatable
- 覆盖:
removeMetadata
在类中Entity
-
onChunkChanged
- 指定者:
onChunkChanged
在接口中ChunkLoader
-
onChunkLoaded
- 指定者:
onChunkLoaded
在接口中ChunkLoader
-
onChunkPopulated
- 指定者:
onChunkPopulated
在接口中ChunkLoader
-
onChunkUnloaded
- 指定者:
onChunkUnloaded
在接口中ChunkLoader
-
onBlockChanged
- 指定者:
onBlockChanged
在接口中ChunkLoader
-
getLoaderId
public int getLoaderId()- 指定者:
getLoaderId
在接口中ChunkLoader
-
isLoaderActive
public boolean isLoaderActive()- 指定者:
isLoaderActive
在接口中ChunkLoader
-
getChunkCacheFromData
public static BatchPacket getChunkCacheFromData(int chunkX, int chunkZ, int subChunkCount, byte[] payload) -
isFoodEnabled
public boolean isFoodEnabled() -
setFoodEnabled
public void setFoodEnabled(boolean foodEnabled) -
getFoodData
-
switchLevel
- 覆盖:
switchLevel
在类中Entity
-
setCheckMovement
public void setCheckMovement(boolean checkMovement) -
isCheckingMovement
public boolean isCheckingMovement()- 从以下版本开始:
- 1.2.1.0-PN
-
setLocale
-
getLocale
-
setSprinting
public void setSprinting(boolean value) - 覆盖:
setSprinting
在类中Entity
-
transfer
-
getLoginChainData
-
pickupEntity
-
hashCode
public int hashCode() -
equals
-
isBreakingBlock
public boolean isBreakingBlock() -
showXboxProfile
Show a window of a XBOX account's profile- 参数:
xuid
- XUID
-
startFishing
Start fishing- 参数:
fishingRod
- fishing rod item
-
stopFishing
public void stopFishing(boolean click) Stop fishing- 参数:
click
- clicked or forced
-
doesTriggerPressurePlate
public boolean doesTriggerPressurePlate()从类复制的说明:Entity
Whether the entity can active pressure plates. Used forEntityBat
s only.- 覆盖:
doesTriggerPressurePlate
在类中Entity
- 返回:
- triggers pressure plate
-
onBlock
- 覆盖:
onBlock
在类中EntityHuman
-
getNoShieldTicks
-
setNoShieldTicks
-
toString
-
giveItem
Adds the items to the main player inventory and drops on the floor any excess.- 参数:
items
- The items to give to the player.
-
getTimeSinceRest
-
setTimeSinceRest
-
sendPopupJukebox
-
sendSystem
-
sendWhisper
-
sendWhisper
-
sendAnnouncement
-
sendAnnouncement
-
completeUsingItem
-
isShowingCredits
-
setShowingCredits
-
showCredits
-
hasSeenCredits
-
setHasSeenCredits
-
dataPacketImmediately
-
dataResourcePacket
-
sendScoreboard
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public void sendScoreboard(Scoreboard scoreboard, DisplaySlot slot) -
clearScoreboardSlot
-
shakeCamera
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public void shakeCamera(float intensity, float duration, CameraShakePacket.CameraShakeType shakeType, CameraShakePacket.CameraShakeAction shakeAction) -
sendToast
-