Player
¶
文档版本:1.21.60.21
Player
类,扩展自Entity
。script_api.minecraft/server.player.description
属性¶
camera
camera
:Camera
- script_api.minecraft/server.player.camera.description
isEmoting
isEmoting
:boolean
- script_api.minecraft/server.player.isemoting.description
isFlying
isFlying
:boolean
- script_api.minecraft/server.player.isflying.description
isGliding
isGliding
:boolean
- script_api.minecraft/server.player.isgliding.description
isJumping
isJumping
:boolean
- script_api.minecraft/server.player.isjumping.description
level
level
:int32
- script_api.minecraft/server.player.level.description
name
name
:string
- script_api.minecraft/server.player.name.description
onScreenDisplay
onScreenDisplay
:ScreenDisplay
- script_api.minecraft/server.player.onscreendisplay.description
totalXpNeededForNextLevel
totalXpNeededForNextLevel
:int32
- script_api.minecraft/server.player.totalxpneededfornextlevel.description
xpEarnedAtCurrentLevel
xpEarnedAtCurrentLevel
:int32
- script_api.minecraft/server.player.xpearnedatcurrentlevel.description
方法¶
addExperience
script_api.minecraft/server.player.addexperience.description
amount
:int32
∈[-16777216
,16777216
]- script_api.minecraft/server.player.addexperience.amount.description
- 返回值:
uint32
- script_api.minecraft/server.player.addexperience.return
addLevels
script_api.minecraft/server.player.addlevels.description
amount
:int32
∈[-16777216
,16777216
]- script_api.minecraft/server.player.addlevels.amount.description
- 返回值:
int32
- script_api.minecraft/server.player.addlevels.return
getSpawnPoint
script_api.minecraft/server.player.getspawnpoint.description
- 返回值:
DimensionLocation
|undefined
- script_api.minecraft/server.player.getspawnpoint.return
getTotalXp
script_api.minecraft/server.player.gettotalxp.description
- 返回值:
uint32
- script_api.minecraft/server.player.gettotalxp.return
playSound
script_api.minecraft/server.player.playsound.description
soundId
:string
- script_api.minecraft/server.player.playsound.soundid.description
soundOptions
?:PlayerSoundOptions
=null
- script_api.minecraft/server.player.playsound.soundoptions.description
- 返回值:
void
- script_api.minecraft/server.player.playsound.return
resetLevel
script_api.minecraft/server.player.resetlevel.description
- 返回值:
void
- script_api.minecraft/server.player.resetlevel.return
sendMessage
script_api.minecraft/server.player.sendmessage.description
message
:(RawMessage | string)[]
|RawMessage
|string
- script_api.minecraft/server.player.sendmessage.message.description
- 返回值:
void
- script_api.minecraft/server.player.sendmessage.return
setSpawnPoint
script_api.minecraft/server.player.setspawnpoint.description
spawnPoint
?:DimensionLocation
=null
- script_api.minecraft/server.player.setspawnpoint.spawnpoint.description
- 返回值:
void
- script_api.minecraft/server.player.setspawnpoint.return