Entity
¶
文档版本:1.21.60.21
Entity
类。script_api.minecraft/server.entity.description
属性¶
dimension
dimension
:Dimension
- script_api.minecraft/server.entity.dimension.description
id
id
:string
- script_api.minecraft/server.entity.id.description
location
location
:Vector3
- script_api.minecraft/server.entity.location.description
nameTag
nameTag
:string
- script_api.minecraft/server.entity.nametag.description
typeId
typeId
:string
- script_api.minecraft/server.entity.typeid.description
方法¶
addEffect
script_api.minecraft/server.entity.addeffect.description
addEffect(effectType: EffectType | string, duration: int32, options?: EntityEffectOptions): Effect | undefined
effectType
:EffectType
|string
- script_api.minecraft/server.entity.addeffect.effecttype.description
duration
:int32
∈[1
,20000000
]- script_api.minecraft/server.entity.addeffect.duration.description
options
?:EntityEffectOptions
=null
- script_api.minecraft/server.entity.addeffect.options.description
- 返回值:
Effect
|undefined
- script_api.minecraft/server.entity.addeffect.return
addTag
script_api.minecraft/server.entity.addtag.description
tag
:string
- script_api.minecraft/server.entity.addtag.tag.description
- 返回值:
boolean
- script_api.minecraft/server.entity.addtag.return
applyDamage
script_api.minecraft/server.entity.applydamage.description
applyDamage(amount: float, options?: EntityApplyDamageByProjectileOptions | EntityApplyDamageOptions): boolean
amount
:float
- script_api.minecraft/server.entity.applydamage.amount.description
options
?:EntityApplyDamageByProjectileOptions
|EntityApplyDamageOptions
=null
- script_api.minecraft/server.entity.applydamage.options.description
- 返回值:
boolean
- script_api.minecraft/server.entity.applydamage.return
applyImpulse
script_api.minecraft/server.entity.applyimpulse.description
vector
:Vector3
- script_api.minecraft/server.entity.applyimpulse.vector.description
- 返回值:
void
- script_api.minecraft/server.entity.applyimpulse.return
applyKnockback
script_api.minecraft/server.entity.applyknockback.description
applyKnockback(directionX: float, directionZ: float, horizontalStrength: float, verticalStrength: float): void
directionX
:float
- script_api.minecraft/server.entity.applyknockback.directionx.description
directionZ
:float
- script_api.minecraft/server.entity.applyknockback.directionz.description
horizontalStrength
:float
- script_api.minecraft/server.entity.applyknockback.horizontalstrength.description
verticalStrength
:float
- script_api.minecraft/server.entity.applyknockback.verticalstrength.description
- 返回值:
void
- script_api.minecraft/server.entity.applyknockback.return
clearVelocity
script_api.minecraft/server.entity.clearvelocity.description
- 返回值:
void
- script_api.minecraft/server.entity.clearvelocity.return
getComponent
script_api.minecraft/server.entity.getcomponent.description
componentId
:string
- script_api.minecraft/server.entity.getcomponent.componentid.description
- 返回值:
EntityComponent
|undefined
- script_api.minecraft/server.entity.getcomponent.return
getComponents
script_api.minecraft/server.entity.getcomponents.description
- 返回值:
EntityComponent[]
- script_api.minecraft/server.entity.getcomponents.return
getEffect
script_api.minecraft/server.entity.geteffect.description
effectType
:EffectType
|string
- script_api.minecraft/server.entity.geteffect.effecttype.description
- 返回值:
Effect
|undefined
- script_api.minecraft/server.entity.geteffect.return
getEffects
script_api.minecraft/server.entity.geteffects.description
- 返回值:
Effect[]
- script_api.minecraft/server.entity.geteffects.return
getHeadLocation
script_api.minecraft/server.entity.getheadlocation.description
- 返回值:
Vector3
- script_api.minecraft/server.entity.getheadlocation.return
getTags
script_api.minecraft/server.entity.gettags.description
- 返回值:
string[]
- script_api.minecraft/server.entity.gettags.return
getVelocity
script_api.minecraft/server.entity.getvelocity.description
- 返回值:
Vector3
- script_api.minecraft/server.entity.getvelocity.return
getViewDirection
script_api.minecraft/server.entity.getviewdirection.description
- 返回值:
Vector3
- script_api.minecraft/server.entity.getviewdirection.return
hasComponent
script_api.minecraft/server.entity.hascomponent.description
componentId
:string
- script_api.minecraft/server.entity.hascomponent.componentid.description
- 返回值:
boolean
- script_api.minecraft/server.entity.hascomponent.return
hasTag
script_api.minecraft/server.entity.hastag.description
tag
:string
- script_api.minecraft/server.entity.hastag.tag.description
- 返回值:
boolean
- script_api.minecraft/server.entity.hastag.return
kill
script_api.minecraft/server.entity.kill.description
- 返回值:
boolean
- script_api.minecraft/server.entity.kill.return
removeEffect
script_api.minecraft/server.entity.removeeffect.description
effectType
:EffectType
|string
- script_api.minecraft/server.entity.removeeffect.effecttype.description
- 返回值:
boolean
- script_api.minecraft/server.entity.removeeffect.return
removeTag
script_api.minecraft/server.entity.removetag.description
tag
:string
- script_api.minecraft/server.entity.removetag.tag.description
- 返回值:
boolean
- script_api.minecraft/server.entity.removetag.return
runCommand
script_api.minecraft/server.entity.runcommand.description
commandString
:string
- script_api.minecraft/server.entity.runcommand.commandstring.description
- 返回值:
CommandResult
- script_api.minecraft/server.entity.runcommand.return
runCommandAsync
script_api.minecraft/server.entity.runcommandasync.description
commandString
:string
- script_api.minecraft/server.entity.runcommandasync.commandstring.description
- 返回值:
Promise<CommandResult>
- script_api.minecraft/server.entity.runcommandasync.return
teleport
script_api.minecraft/server.entity.teleport.description
location
:Vector3
- script_api.minecraft/server.entity.teleport.location.description
teleportOptions
?:TeleportOptions
=null
- script_api.minecraft/server.entity.teleport.teleportoptions.description
- 返回值:
void
- script_api.minecraft/server.entity.teleport.return
tryTeleport
script_api.minecraft/server.entity.tryteleport.description
location
:Vector3
- script_api.minecraft/server.entity.tryteleport.location.description
teleportOptions
?:TeleportOptions
=null
- script_api.minecraft/server.entity.tryteleport.teleportoptions.description
- 返回值:
boolean
- script_api.minecraft/server.entity.tryteleport.return