Player
¶
文档版本:1.21.60.21
Player
类,扩展自Entity
。script_api.minecraft/server.player.description
属性¶
camera
camera
:Camera
- script_api.minecraft/server.player.camera.description
clientSystemInfo
clientSystemInfo
:ClientSystemInfo
- script_api.minecraft/server.player.clientsysteminfo.description
inputInfo
inputInfo
:InputInfo
- script_api.minecraft/server.player.inputinfo.description
inputPermissions
inputPermissions
:PlayerInputPermissions
- script_api.minecraft/server.player.inputpermissions.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
selectedSlotIndex
selectedSlotIndex
:int32
- script_api.minecraft/server.player.selectedslotindex.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
eatItem
script_api.minecraft/server.player.eatitem.description
itemStack
:ItemStack
- script_api.minecraft/server.player.eatitem.itemstack.description
- 返回值:
void
- script_api.minecraft/server.player.eatitem.return
getGameMode
script_api.minecraft/server.player.getgamemode.description
- 返回值:
GameMode
- script_api.minecraft/server.player.getgamemode.return
getItemCooldown
script_api.minecraft/server.player.getitemcooldown.description
cooldownCategory
:string
- script_api.minecraft/server.player.getitemcooldown.cooldowncategory.description
- 返回值:
int32
- script_api.minecraft/server.player.getitemcooldown.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
isOp
script_api.minecraft/server.player.isop.description
- 返回值:
boolean
- script_api.minecraft/server.player.isop.return
playMusic
script_api.minecraft/server.player.playmusic.description
trackId
:string
- script_api.minecraft/server.player.playmusic.trackid.description
musicOptions
?:MusicOptions
=null
- script_api.minecraft/server.player.playmusic.musicoptions.description
- 返回值:
void
- script_api.minecraft/server.player.playmusic.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
postClientMessage
script_api.minecraft/server.player.postclientmessage.description
id
:string
- script_api.minecraft/server.player.postclientmessage.id.description
value
:string
- script_api.minecraft/server.player.postclientmessage.value.description
- 返回值:
void
- script_api.minecraft/server.player.postclientmessage.return
queueMusic
script_api.minecraft/server.player.queuemusic.description
trackId
:string
- script_api.minecraft/server.player.queuemusic.trackid.description
musicOptions
?:MusicOptions
=null
- script_api.minecraft/server.player.queuemusic.musicoptions.description
- 返回值:
void
- script_api.minecraft/server.player.queuemusic.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
setGameMode
script_api.minecraft/server.player.setgamemode.description
gameMode
?:GameMode
=null
- script_api.minecraft/server.player.setgamemode.gamemode.description
- 返回值:
void
- script_api.minecraft/server.player.setgamemode.return
setOp
script_api.minecraft/server.player.setop.description
isOp
:boolean
- script_api.minecraft/server.player.setop.isop.description
- 返回值:
void
- script_api.minecraft/server.player.setop.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
spawnParticle
script_api.minecraft/server.player.spawnparticle.description
effectName
:string
- script_api.minecraft/server.player.spawnparticle.effectname.description
location
:Vector3
- script_api.minecraft/server.player.spawnparticle.location.description
molangVariables
?:MolangVariableMap
=null
- script_api.minecraft/server.player.spawnparticle.molangvariables.description
- 返回值:
void
- script_api.minecraft/server.player.spawnparticle.return
startItemCooldown
script_api.minecraft/server.player.startitemcooldown.description
cooldownCategory
:string
- script_api.minecraft/server.player.startitemcooldown.cooldowncategory.description
tickDuration
:int32
∈[0
,32767
]- script_api.minecraft/server.player.startitemcooldown.tickduration.description
- 返回值:
void
- script_api.minecraft/server.player.startitemcooldown.return
stopMusic
script_api.minecraft/server.player.stopmusic.description
- 返回值:
void
- script_api.minecraft/server.player.stopmusic.return