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
isClimbing
isClimbing
:boolean
- script_api.minecraft/server.entity.isclimbing.description
isFalling
isFalling
:boolean
- script_api.minecraft/server.entity.isfalling.description
isInWater
isInWater
:boolean
- script_api.minecraft/server.entity.isinwater.description
isOnGround
isOnGround
:boolean
- script_api.minecraft/server.entity.isonground.description
isSleeping
isSleeping
:boolean
- script_api.minecraft/server.entity.issleeping.description
isSneaking
isSneaking
:boolean
- script_api.minecraft/server.entity.issneaking.description
isSprinting
isSprinting
:boolean
- script_api.minecraft/server.entity.issprinting.description
isSwimming
isSwimming
:boolean
- script_api.minecraft/server.entity.isswimming.description
location
location
:Vector3
- script_api.minecraft/server.entity.location.description
nameTag
nameTag
:string
- script_api.minecraft/server.entity.nametag.description
scoreboardIdentity
scoreboardIdentity
:ScoreboardIdentity
|undefined
- script_api.minecraft/server.entity.scoreboardidentity.description
target
target
:Entity
|undefined
- script_api.minecraft/server.entity.target.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
clearDynamicProperties
script_api.minecraft/server.entity.cleardynamicproperties.description
- 返回值:
void
- script_api.minecraft/server.entity.cleardynamicproperties.return
clearVelocity
script_api.minecraft/server.entity.clearvelocity.description
- 返回值:
void
- script_api.minecraft/server.entity.clearvelocity.return
extinguishFire
script_api.minecraft/server.entity.extinguishfire.description
useEffects
:boolean
=True
- script_api.minecraft/server.entity.extinguishfire.useeffects.description
- 返回值:
boolean
- script_api.minecraft/server.entity.extinguishfire.return
getBlockFromViewDirection
script_api.minecraft/server.entity.getblockfromviewdirection.description
options
?:BlockRaycastOptions
=null
- script_api.minecraft/server.entity.getblockfromviewdirection.options.description
- 返回值:
BlockRaycastHit
|undefined
- script_api.minecraft/server.entity.getblockfromviewdirection.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
getDynamicProperty
script_api.minecraft/server.entity.getdynamicproperty.description
identifier
:string
- script_api.minecraft/server.entity.getdynamicproperty.identifier.description
- 返回值:
boolean
|double
|float
|string
|Vector3
|undefined
- script_api.minecraft/server.entity.getdynamicproperty.return
getDynamicPropertyIds
script_api.minecraft/server.entity.getdynamicpropertyids.description
- 返回值:
string[]
- script_api.minecraft/server.entity.getdynamicpropertyids.return
getDynamicPropertyTotalByteCount
script_api.minecraft/server.entity.getdynamicpropertytotalbytecount.description
- 返回值:
int32
- script_api.minecraft/server.entity.getdynamicpropertytotalbytecount.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
getEntitiesFromViewDirection
script_api.minecraft/server.entity.getentitiesfromviewdirection.description
options
?:EntityRaycastOptions
=null
- script_api.minecraft/server.entity.getentitiesfromviewdirection.options.description
getHeadLocation
script_api.minecraft/server.entity.getheadlocation.description
- 返回值:
Vector3
- script_api.minecraft/server.entity.getheadlocation.return
getProperty
script_api.minecraft/server.entity.getproperty.description
identifier
:string
- script_api.minecraft/server.entity.getproperty.identifier.description
- 返回值:
boolean
|float
|string
|undefined
- script_api.minecraft/server.entity.getproperty.return
getRotation
script_api.minecraft/server.entity.getrotation.description
- 返回值:
Vector2
- script_api.minecraft/server.entity.getrotation.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
isValid
script_api.minecraft/server.entity.isvalid.description
- 返回值:
boolean
- script_api.minecraft/server.entity.isvalid.return
kill
script_api.minecraft/server.entity.kill.description
- 返回值:
boolean
- script_api.minecraft/server.entity.kill.return
lookAt
script_api.minecraft/server.entity.lookat.description
targetLocation
:Vector3
- script_api.minecraft/server.entity.lookat.targetlocation.description
- 返回值:
void
- script_api.minecraft/server.entity.lookat.return
matches
script_api.minecraft/server.entity.matches.description
options
:EntityQueryOptions
- script_api.minecraft/server.entity.matches.options.description
- 返回值:
boolean
- script_api.minecraft/server.entity.matches.return
playAnimation
script_api.minecraft/server.entity.playanimation.description
animationName
:string
- script_api.minecraft/server.entity.playanimation.animationname.description
options
?:PlayAnimationOptions
=null
- script_api.minecraft/server.entity.playanimation.options.description
- 返回值:
void
- script_api.minecraft/server.entity.playanimation.return
remove
script_api.minecraft/server.entity.remove.description
- 返回值:
void
- script_api.minecraft/server.entity.remove.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
resetProperty
script_api.minecraft/server.entity.resetproperty.description
identifier
:string
- script_api.minecraft/server.entity.resetproperty.identifier.description
- 返回值:
boolean
|float
|string
- script_api.minecraft/server.entity.resetproperty.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
setDynamicProperty
script_api.minecraft/server.entity.setdynamicproperty.description
identifier
:string
- script_api.minecraft/server.entity.setdynamicproperty.identifier.description
value
?:boolean
|double
|float
|string
|Vector3
=null
- script_api.minecraft/server.entity.setdynamicproperty.value.description
- 返回值:
void
- script_api.minecraft/server.entity.setdynamicproperty.return
setOnFire
script_api.minecraft/server.entity.setonfire.description
seconds
:int32
- script_api.minecraft/server.entity.setonfire.seconds.description
useEffects
:boolean
=True
- script_api.minecraft/server.entity.setonfire.useeffects.description
- 返回值:
boolean
- script_api.minecraft/server.entity.setonfire.return
setProperty
script_api.minecraft/server.entity.setproperty.description
identifier
:string
- script_api.minecraft/server.entity.setproperty.identifier.description
value
:boolean
|float
|string
- script_api.minecraft/server.entity.setproperty.value.description
- 返回值:
void
- script_api.minecraft/server.entity.setproperty.return
setRotation
script_api.minecraft/server.entity.setrotation.description
rotation
:Vector2
- script_api.minecraft/server.entity.setrotation.rotation.description
- 返回值:
void
- script_api.minecraft/server.entity.setrotation.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
triggerEvent
script_api.minecraft/server.entity.triggerevent.description
eventName
:string
- script_api.minecraft/server.entity.triggerevent.eventname.description
- 返回值:
void
- script_api.minecraft/server.entity.triggerevent.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