Molang/内置变量

来自Minecraft基岩版开发Wiki

Mojang为游戏内置了一些硬编码的变量,这些变量可以在对应的地方起特殊作用。

实体变量[编辑]

名称
描述
variable.aabb.x
variable.aabb.y
variable.aabb.z
variable.aabb_dimension.x
variable.aabb_dimension.y
variable.actor.speed
variable.cloud_lifetime
variable.cloud_radius
variable.color.a
variable.color.b
variable.color.g
variable.color.r
variable.direction.x
variable.direction_x
variable.direction.y
variable.direction_y
variable.direction.z
variable.direction_z
variable.direction_vector.x
variable.direction_vector.y
variable.direction_vector.z
variable.emitter_age Age since the current loop started for the emitter
variable.emitter_intensity
variable.emitter_lifetime How long the current loop lasts for the emitter
variable.emitter_radius
variable.emitter_random_1 A random from 0.0 to 1.0 that is constant for the current loop of the emitter
variable.emitter_random_2 Another random from 0.0 to 1.0 that is constant for the current loop of the emitter
variable.emitter_random_3 A third random from 0.0 to 1.0 that is constant for the current loop of the emitter
variable.emitter_random_4 A fourth random from 0.0 to 1.0 that is constant for the current loop of the emitter
variable.emitter_texture_coordinate.u
variable.EmitterTextureCoord.u
variable.emitter_texture_coordinate.v
variable.EmitterTextureCoord.u
variable.emitter_texture_size.u
variable.EmitterTextureSize.u
variable.emitter_texture_size.v
variable.EmitterTextureSize.u
variable.entity_scale When the effect is attached to an entity, this value is the scale of the entity
variable.is_outside_water
variable.particlecount
variable.particlesize
variable.particle_age How long the particle has lived
variable.particle_lifetime

How long the particle lives for

variable.particle_multiplier
variable.particle_random_1 A random from 0.0 to 1.0 that is constant for the lifetime of the particle
variable.particle_random_2 Another random from 0.0 to 1.0 that is constant for the lifetime of the particle
variable.particle_random_3 A third random from 0.0 to 1.0 that is constant for the lifetime of the particle
variable.particle_random_4 A fourth random from 0.0 to 1.0 that is constant for the lifetime of the particle
variable.size_modifier
variable.speed_modifier
variable.velocity_scalar

上下文变量[编辑]

名称 描述
context.is_first_person
context.item_slot
context.player_offhand_arm_height
context.other