Molang
src.anvil.api.molang
Query
Bases: _molang
AboveTopSolid(x, z)
classmethod
Returns the height of the block immediately above the highest solid block at the input (x,z) position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
int
|
X position. |
required |
z
|
int
|
Y position. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ActorCount()
classmethod
Returns the number of actors rendered in the last frame.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
All(query, *args)
classmethod
Requires at least 3 arguments. Evaluates the first argument, then returns 1.0 if all of the following arguments evaluate to the same value as the first. Otherwise it returns 0.0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
int
|
Query to evaluate. |
required |
args
|
int
|
arguments to test against. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AllAnimationsFinished()
classmethod
Only valid in an animation controller. Returns 1.0 if all animations in the current animation controller state have played through at least once, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AllTags(*tags)
classmethod
Returns 1.0 if the item or block has all of the tags specified, else it return 0.0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tags
|
str
|
entity tags to test for. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AngerLevel()
classmethod
If available, returns the anger level of the actor as an integer value from 0 to 1 less than the 'max_anger' defined on the actor, otherwise returns 0. Only returns a non-zero value in behavior packs.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AnimTime()
classmethod
Returns the time in seconds since the current animation started, else 0.0 if not called within an animation.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Any(query, *args)
classmethod
Requires at least 3 arguments. Evaluates the first argument, then returns 1.0 if any of the following arguments evaluate to the same value as the first. Otherwise it returns 0.0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
int
|
Query to evaluate. |
required |
args
|
int
|
arguments to test against. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AnyAnimationFinished()
classmethod
Only valid in an animation controller. Returns 1.0 if any animation in the current animation controller state has played through at least once, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AnyTag(*tags)
classmethod
Returns 1.0 if the item or block has any of the tags specified, else it returns 0.0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tags
|
str
|
entity tags to test for. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ApproxEq(*args)
classmethod
Returns 1.0 if all of the arguments are within 0.000000 of each other, else it returns 0.0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args
|
Any
|
Arguments to test for approximate equality. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ArmorColorSlot(index)
classmethod
Takes the armor slot index as a parameter and returns the color of the armor in the requested slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
Armour slot index. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ArmorMaterialSlot(index)
classmethod
Takes the armor slot index as a parameter and returns the armor material type in the requested armor slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
Armour slot index. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ArmorSlotDamage(slot, slot_id=0)
classmethod
Returns the damage of the item in the specified armor slot name and slot id, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ArmorTextureSlot(index)
classmethod
Takes the armor slot index as a parameter and returns the texture type of the requested slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
Armour slot index. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
AverageFrameTime(frame=0)
classmethod
Returns the time in seconds of the average frame time over the last 'n' frames. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query.
frame = 0 will return the frame time of the frame before the current one. frame = 1 will return the average frame time of the previous two frames.
Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frame
|
int
|
Frame number. |
0
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BlockFace()
classmethod
Returns the block face for this (only valid for certain triggers such as placing blocks, or interacting with block) (Down=0.0, Up=1.0, North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BlockHasAllTags(x, y, z, *tags)
classmethod
Takes a world-origin-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has all of the tags provided.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BlockHasAnyTags(x, y, z, *tags)
classmethod
Takes a world-origin-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has any of the tags provided.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BlockNeighborHasAllTags(x, y, z, *tags)
classmethod
Takes a block-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has all of the tags provided.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BlockNeighborHasAnyTags(x, y, z, *tags)
classmethod
Takes a block-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has any of the tags provided.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BlockState(state)
classmethod
Returns the value of the associated block's Block State.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
str
|
The block state to query, no namespace. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Blocking()
classmethod
Returns 1.0 if the entity is blocking, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BodyXRotation()
classmethod
Returns the body pitch rotation if called on an actor, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BodyYRotation()
classmethod
Returns the body yaw rotation if called on an actor, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BoneAabb()
classmethod
Returns the axis aligned bounding box of a bone as a struct with members '.min', '.max', along with '.x', '.y', and '.z' values for each.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BoneOrientationMatrix(bone_name)
classmethod
Takes the name of the bone as an argument. Returns the bone orientation (as a matrix) of the desired bone provided it exists in the queryable geometry of the entity, else this returns the identity matrix and throws a content error.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BoneOrientationTrs(bone_name)
classmethod
TRS stands for 'Translate/Rotate/Scale.' Takes the name of the bone as an argument. Returns the bone orientation matrix decomposed into the component translation/rotation/scale parts of the desired bone provided it exists in the queryable geometry of the entity, else this returns the identity matrix and throws a content error. The returned value is returned as a variable of type struct with members .t, .r, and .s, each with members .x, .y, and .z, and can be accessed as per this example: v.my_variable = q.bone_orientation_trs('rightarm'); return v.my_variable.r.x;
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BoneOrigin()
classmethod
Returns the initial (from the .geo) pivot of a bone as a struct with members '.x', '.y', and '.z'.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
BoneRotation()
classmethod
Returns the initial (from the .geo) rotation of a bone as a struct with members '.x', '.y', and '.z' in degrees.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CameraDistanceRangeLerp(d1, d2)
classmethod
Takes two distances (any order) and return a number from 0 to 1 based on the camera distance between the two ranges clamped to that range.
For example, 'query.camera_distance_range_lerp(10, 20)' will return 0 for any distance less than or equal to 10, 0.2 for a distance of 12, 0.5 for 15, and 1 for 20 or greater. If you pass in (20, 10), a distance of 20 will return 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CameraRotation(axis)
classmethod
Returns the rotation of the camera. Requires one argument representing the rotation axis you would like.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
axis
|
int
|
0 for x, 1 for y |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CanClimb()
classmethod
Returns 1.0 if the entity can climb, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CanDamageNearbyMobs()
classmethod
Returns 1.0 if the entity can damage nearby mobs, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CanFly()
classmethod
Returns 1.0 if the entity can fly, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CanPowerJump()
classmethod
Returns 1.0 if the entity can power jump, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CanSwim()
classmethod
Returns 1.0 if the entity can swim, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CanWalk()
classmethod
Returns 1.0 if the entity can walk, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CapeFlapAmount()
classmethod
Returns value between 0.0 and 1.0 with 0.0 meaning "cape is fully down" and 1.0 means "cape is fully up."
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CardinalBlockFacePlacedOn()
classmethod
DEPRECATED (please use query.block_face instead) Returns the block face for this (only valid for on_placed_by_player trigger) (Down=0.0, Up=1.0, North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CardinalFacing()
classmethod
Returns the current facing of the player
- Down=0.0
- Up=1.0
- North=2.0
- South=3.0
- West=4.0
- East=5.0
- Undefined=6.0
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CardinalFacing2D()
classmethod
Returns the current facing of the player ignoring up/down part of the direction
- North=2.0
- South=3.0
- West=4.0
- East=5.0
- Undefined=6.0
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CardinalPlayerFacing()
classmethod
Returns the current facing of the player
- Down=0.0
- Up=1.0
- North=2.0
- South=3.0
- West=4.0
- East=5.0
- Undefined=6.0
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ClientMaxRenderDistance()
classmethod
Returns the max render distance in chunks of the current client. Available on the Client (Resource Packs) only.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ClientMemoryTier()
classmethod
Returns a number representing the client RAM memory tier, 0 = 'Undetermined', 1 = 'SuperLow', 2 = 'Low', 3 = 'Mid', 4 = 'High', or 5 = 'SuperHigh'. Available on the Client (Resource Packs) only.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CombineEntities()
classmethod
Combines any valid entity references from all arguments into a single array. Note that order is not preserved, and duplicates and invalid values are removed.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CooldownTime(slot, slot_id=0)
classmethod
Returns the total cooldown time in seconds for the item held or worn by the specified equipment slot name (and if required second numerical slot id), otherwise returns 0. Uses the same name and id that the replaceitem command takes when querying entities.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CooldownTimeRemaining(slot, slot_id=0)
classmethod
Returns the cooldown time remaining in seconds for specified cooldown type or the item held or worn by the specified equipment slot name (and if required second numerical slot id), otherwise returns 0. Uses the same name and id that the replaceitem command takes when querying entities. Returns highest cooldown if no parameters are supplied.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Count(*element)
classmethod
Counts the number of things passed to it (arrays are counted as the number of elements they contain; non-arrays count as 1).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
CurrentSquishValue()
classmethod
Returns the squish value for the current entity, or 0.0 if this doesn't make sense.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Day()
classmethod
Returns the day of the current level.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
DeathTicks()
classmethod
Returns the elapsed ticks since the mob started dying.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
DebugOutput()
classmethod
Server Client
Debug log a value to the output debug window for builds that have one.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
DeltaTime()
classmethod
Returns the time in seconds since the previous frame.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
DistanceFromCamera()
classmethod
Returns the distance of the root of this actor or particle emitter from the camera.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EffectEmitterCount()
classmethod
Returns the total number of active emitters of the callee's particle effect type.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EffectParticleCount()
classmethod
Returns the total number of active particles of the callee's particle effect type.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EquipmentCount()
classmethod
Returns the number of equipped armor pieces for an actor from 0 to 4, not counting items held in hands. (To query for hand slots, use query.is_item_equipped or query.is_item_name_any).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EquippedItemAllTags(slot, *tags)
classmethod
Takes a slot name followed by any tag you want to check for in the form of 'tag_name' and returns 1 if all of the tags are on that equipped item, 0 otherwise.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EquippedItemAnyTag(slot, *tags)
classmethod
Takes a slot name followed by any tag you want to check for in the form of 'tag_name' and returns 0 if none of the tags are on that equipped item or 1 if at least 1 tag exists.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EquippedItemIsAttachable(hand=0)
classmethod
Takes the desired hand slot as a parameter and returns whether the item is an attachable or not.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hand
|
int
|
0 for main hand, 1 for off hand |
0
|
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EyeTargetXRotation()
classmethod
Returns the X eye rotation of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
EyeTargetYRotation()
classmethod
Returns the Y eye rotation of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
FacingTargetToRangeAttack()
classmethod
Returns 1.0 if the entity is attacking from range (minecraft:behavior.ranged_attack), else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
FrameAlpha()
classmethod
Returns the ratio (from 0 to 1) of how much between AI ticks this frame is being rendered.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetActorInfoId()
classmethod
Returns the integer ID of an actor by its string name.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetAnimationFrame()
classmethod
Returns the current texture of the item.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetDefaultBonePivot()
classmethod
Gets the specified axis of the specified bone orientation pivot.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetEquippedItemName(hand_slot, index=0)
classmethod
DEPRECATED (Use query.is_item_name_any instead if possible so names can be changed later without breaking content.) Takes one optional hand slot as a parameter (0 or 'main_hand' for main hand, 1 or 'off_hand' for off hand), and a second parameter (0=default) if you would like the equipped item or any non-zero number for the currently rendered item, and returns the name of the item in the requested slot (defaulting to the main hand if no parameter is supplied) if there is one, otherwise returns ''.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetLocatorOffset()
classmethod
Gets specified axis of the specified locator offset.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetName()
classmethod
DEPRECATED (Use query.is_name_any instead if possible so names can be changed later without breaking content.) Get the name of the mob if there is one, otherwise return ''.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GetRootLocatorOffset()
classmethod
Gets specified axis of the specified locator offset of the root model.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
GroundSpeed()
classmethod
Returns the ground speed of the entity in meters/second.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HadComponentGroup(component_group)
classmethod
Server Only.
Usable only in behavior packs when determining the default value for an entity's Property. Requires one string argument. If the entity is being loaded from data that was last saved with a component_group with the specified name, returns 1.0, otherwise returns 0.0. The purpose of this query is to allow entity definitions to change and still be able to load the correct state of entities.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasAnyFamily(*family)
classmethod
Returns 1 if the entity has any of the specified families, else 0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasArmorSlot(slot)
classmethod
Takes the armor slot index as a parameter and returns 1.0 if the entity has armor in the requested slot, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasBiomeTag(tag)
classmethod
Returns whether or not a Block Placement Target has a specific biome tag.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasCape()
classmethod
Returns 1.0 if the player has a cape, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasCollision()
classmethod
Returns 1.0 if the entity has collisions enabled, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasGravity()
classmethod
Returns 1.0 if the entity is affected by gravity, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasOwner()
classmethod
Returns true if the entity has an owner ID, else it returns false.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasPlayerRider()
classmethod
Returns 1.0 if the entity has a player rider, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasProperty(property)
classmethod
Returns true if the entity has the property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
property
|
str
|
The block property to query, no namespace. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasRider()
classmethod
Returns 1.0 if the entity has a rider, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HasTarget()
classmethod
Returns 1.0 if the entity has a target, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HeadRollAngle()
classmethod
Returns the roll angle of the head of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HeadXRotation(head_number=0)
classmethod
Takes one argument as a parameter. Returns the nth head x rotation of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HeadYRotation(head_number=0)
classmethod
Takes one argument as a parameter. Returns the nth head y rotation of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Health()
classmethod
Returns the health of the entity, or 0.0 if it doesn't make sense to call on this entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HeartbeatInterval()
classmethod
Returns the heartbeat interval of the actor in seconds. Returns 0 when the actor has no heartbeat.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HeartbeatPhase()
classmethod
Client Only
Returns the heartbeat phase of the actor. 0.0 if at start of current heartbeat, 1.0 if at the end. Returns 0 on errors or when the actor has no heartbeat.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Heightmap(x, z)
classmethod
Takes two arguments: X and Z world values. Returns the world height (Y value) of the terrain at the specified position.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HurtDirection()
classmethod
Returns the hurt direction for the actor, otherwise returns 0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
HurtTime()
classmethod
Returns the hurt time for the actor, otherwise returns 0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
InRange(value, min, max)
classmethod
Requires 3 numerical arguments: some value, a minimum, and a maximum. If the first argument is between the minimum and maximum (inclusive), returns 1.0. Otherwise it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
InvulnerableTicks()
classmethod
Returns the number of ticks of invulnerability the entity has left if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAdmiring()
classmethod
Returns 1.0 if the entity is admiring, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAlive()
classmethod
Returns 1.0 if the entity is alive, and 0.0 if it's dead.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAngry()
classmethod
Returns 1.0 if the entity is angry, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAttached()
classmethod
Client Only
Returns 1.0 if the entity is attached to another entity (such as being held or worn), else it will return 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAttachedToEntity()
classmethod
Returns 1.0 if the actor is attached to an entity, else it will return 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAvoidingBlock()
classmethod
Returns 1.0 if the entity is fleeing from a block, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsAvoidingMobs()
classmethod
Returns 1.0 if the entity is fleeing from mobs, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsBaby()
classmethod
Returns 1.0 if the entity is a baby, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsBreathing()
classmethod
Returns 1.0 if the entity is breathing, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsBribed()
classmethod
Returns 1.0 if the entity has been bribed, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCarryingBlock()
classmethod
Returns 1.0 if the entity is carrying a block, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCasting()
classmethod
Returns 1.0 if the entity is casting, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCelebrating()
classmethod
Returns 1.0 if the entity is celebrating, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCelebratingSpecial()
classmethod
Returns 1.0 if the entity is doing a special celebration, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCharged()
classmethod
Returns 1.0 if the entity is charged, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCharging()
classmethod
Returns 1.0 if the entity is charging, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsChested()
classmethod
Returns 1.0 if the entity has chests attached to it, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCooldownType(cooldown_name, slot, slot_id=0)
classmethod
Returns 1.0 if the specified held or worn item has the specified cooldown type name, otherwise returns 0.0. First argument is the cooldown name to check for, second argument is the equipment slot name, and if required third argument is the numerical slot id. For second and third arguments, uses the same name and id tha tthe replaceitem command takes when querying entities.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCritical()
classmethod
Returns 1.0 if the entity is critical, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsCroaking()
classmethod
Returns 1.0 if the entity is croaking, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsDancing()
classmethod
Returns 1.0 if the entity is dancing, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsDelayedAttacking()
classmethod
Returns 1.0 if the entity is attacking using the delayed attack, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsDigging()
classmethod
Returns 1.0 if the entity is digging, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsEating()
classmethod
Returns 1.0 if the entity is eating, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsEatingMob()
classmethod
Returns 1.0 if the entity is eating a mob, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsElder()
classmethod
Returns 1.0 if the entity is an elder version of it, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsEmerging()
classmethod
Returns 1.0 if the entity is emerging, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsEmoting()
classmethod
Returns 1.0 if the entity is emoting, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsEnchanted()
classmethod
Returns 1.0 if the entity is enchanted, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsFireImmune()
classmethod
Returns 1.0 if the entity is immune to fire, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsFirstPerson()
classmethod
Returns 1.0 if the entity is being rendered in first person mode, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsGhost()
classmethod
Returns 1.0 if an entity is a ghost, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsGliding()
classmethod
Returns 1.0 if the entity is gliding, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsGrazing()
classmethod
Returns 1.0 if the entity is grazing, or 0.0 if not.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsIdling()
classmethod
Returns 1.0 if the entity is idling, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsIgnited()
classmethod
Returns 1.0 if the entity is ignited, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsIllagerCaptain()
classmethod
Returns 1.0 if the entity is an illager captain, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInContactWithWater()
classmethod
Returns 1.0 if the entity is in contact with any water (water, rain, splash water bottle), else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInLove()
classmethod
Returns 1.0 if the entity is in love, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInUI()
classmethod
Returns 1.0 if the entity is rendered as part of the UI, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInWater()
classmethod
Returns 1.0 if the entity is in water, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInWaterOrRain()
classmethod
Returns 1.0 if the entity is in water or rain, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInterested()
classmethod
Returns 1.0 if the entity is interested, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsInvisible()
classmethod
Returns 1.0 if the entity is invisible, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsItemEquipped(hand=0)
classmethod
Takes one optional hand slot as a parameter and returns 1.0 if there is an item in the requested slot, otherwise returns 0.0.
- 0 = main_hand
- 1 = off_hand
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsItemNameAny(slot, index, *item_identifiers)
classmethod
Takes an equipment slot name (see the replaceitem command) and an optional slot index value. After that, takes one or more full name (with 'namespace:') strings to check for. Returns 1.0 if an item in the specified slot has any of the specified names, otherwise returns 0.0. An empty string '' can be specified to check for an empty slot. Note that querying slot.enderchest, slot.saddle, slot.armor, or slot.chest will only work in behavior packs. A preferred query to query.get_equipped_item_name, as it can be adjusted by Mojang to avoid breaking content if names are changed.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsJumping()
classmethod
Returns 1.0 if the entity is jumping, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsLayingDown()
classmethod
Returns 1.0 if the entity is laying down, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsLayingEgg()
classmethod
Returns 1.0 if the entity is laying an egg, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsLeashed()
classmethod
Returns 1.0 if the entity is leashed to something, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsLevitating()
classmethod
Returns 1.0 if the entity is levitating, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsLingering()
classmethod
Returns 1.0 if the entity is lingering, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsLocalPlayer()
classmethod
Client Only
Takes no arguments. Returns 1.0 if the entity is the local player for the current game window, else it returns 0.0. In splitscreen returns 0.0 for the other local players for other views. Always returns 0.0 if used in a behavior pack.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsMoving()
classmethod
Returns 1.0 if the entity is moving, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsNameAny(*names)
classmethod
Takes one or more arguments. If the entity's name is any of the specified string values, returns 1.0. Otherwise returns 0.0.
A preferred query to query.get_name, as it can be adjusted by Mojang to avoid breaking content if names are changed.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsOnFire()
classmethod
Returns 1.0 if the entity is on fire, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsOnGround()
classmethod
Returns 1.0 if the entity is on the ground, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsOnScreen()
classmethod
Returns 1.0 if this is called on an entity at a time when it is known if it is on screen, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsOnfire()
classmethod
Returns 1.0 if the entity is on fire, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsOrphaned()
classmethod
Returns 1.0 if the entity is orphaned, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsOwnerIdentifierAny()
classmethod
Takes one or more arguments. Returns whether the root actor identifier is any of the specified strings. A preferred query to query.owner_identifier, as it can be adjusted by Mojang to avoid breaking content if names are changed.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsPersonaOrPremiumSkin()
classmethod
Returns 1.0 if the player has a persona or premium skin, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsPlayingDead()
classmethod
Returns 1.0 if the entity is playing dead, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsPowered()
classmethod
Returns 1.0 if the entity is powered, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsPregnant()
classmethod
Returns 1.0 if the entity is pregnant, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsRamAttacking()
classmethod
Returns 1.0 if the entity is using a ram attack, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsResting()
classmethod
Returns 1.0 if the entity is resting, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsRiding()
classmethod
Returns 1.0 if the entity is riding, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsRoaring()
classmethod
Returns 1.0 if the entity is currently roaring, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsRolling()
classmethod
Returns 1.0 if the entity is rolling, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSaddled()
classmethod
Returns 1.0 if the entity has a saddle, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsScared()
classmethod
Returns 1.0 if the entity is scared, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSelectedItem()
classmethod
Returns true if the player has selected an item in the inventory, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsShaking()
classmethod
Returns 1.0 if the entity is casting, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsShakingWetness()
classmethod
Returns 1.0 if the entity is shaking water off, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSheared()
classmethod
Returns 1.0 if the entity is able to be sheared and is sheared, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsShieldPowered()
classmethod
Returns 1.0f if the entity has an active powered shield if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSilent()
classmethod
Returns 1.0 if the entity is silent, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSitting()
classmethod
Returns 1.0 if the entity is sitting, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSleeping()
classmethod
Returns 1.0 if the entity is sleeping, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSneaking()
classmethod
Returns 1.0 if the entity is sneaking, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSneezing()
classmethod
Returns 1.0 if the entity is sneezing, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSniffing()
classmethod
Returns 1.0 if the entity is sniffing, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSonicBoom()
classmethod
Returns 1.0 if the entity is using sonic boom, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSpectator()
classmethod
Returns 1.0 if the entity is a spectator, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSprinting()
classmethod
Returns 1.0 if the entity is sprinting, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsStackable()
classmethod
Returns 1.0 if the entity is stackable, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsStalking()
classmethod
Returns 1.0 if the entity is stalking, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsStanding()
classmethod
Returns 1.0 if the entity is standing, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsStunned()
classmethod
Returns 1.0 if the entity is currently stunned, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsSwimming()
classmethod
Returns 1.0 if the entity is swimming, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsTamed()
classmethod
Returns 1.0 if the entity is tamed, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsTransforming()
classmethod
Returns 1.0 if the entity is transforming, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsUsingItem()
classmethod
Returns 1.0 if the entity is using an item, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
IsWallClimbing()
classmethod
Returns 1.0 if the entity is climbing a wall, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ItemInUseDuration()
classmethod
Returns the amount of time an item has been in use in seconds up to the maximum duration, else 0.0 if it doesn't make sense.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ItemIsCharged(hand=0)
classmethod
Takes one optional hand slot as a parameter and returns 1.0 if the item is charged in the requested slot (defaulting to the main hand if no parameter is supplied), otherwise returns 0.0.
- 0 = main_hand
- 1 = off_hand
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ItemMaxUseDuration()
classmethod
Returns the maximum amount of time the item can be used, else 0.0 if it doesn't make sense.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ItemRemainingUseDuration(hand=0)
classmethod
Returns the amount of time an item has left to use, else 0.0 if it doesn't make sense. Time remaining is normalized using the normalization value, only if one is given, else it is returned in seconds.
- main_hand = 0
- off_hand = 1
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ItemSlotToBoneName(slot)
classmethod
Requires one parameter: the name of the equipment slot. This function returns the name of the bone this entity has mapped to that slot.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
KeyFrameLerpTime()
classmethod
Returns the ratio between the previous and next key frames
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
LastFrameTime(frame=0)
classmethod
Returns the time in seconds of the last frame. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query.
frame = 0 will return the frame time of the frame before the current one. frame = 1 will return the average frame time of the previous two frames.
Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
LastHitByPlayer()
classmethod
Server Only
Returns 1.0 if the entity was last hit by the player, else it returns 0.0. If called by the client always returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
LieAmount()
classmethod
Returns the lie down amount for the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
LifeSpan()
classmethod
Returns the limited life span of an entity, or 0.0 if it lives forever
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
LifeTime()
classmethod
Returns the time in seconds since the current animation started, else 0.0 if not called within an animation.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
LodIndex(d1, d2, d3)
classmethod
Takes an array of distances and returns the zero - based index of which range the actor is in based on distance from the camera.
For example, 'query.lod_index(10, 20, 30)' will return 0, 1, or 2 based on whether the mob is less than 10, 20, or 30 units away from the camera, or it will return 3 if it is greater than 30.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Log(query)
classmethod
Debug log a value to the content log.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MainHandItemMaxDuration()
classmethod
Returns the use time maximum duration for the main hand item if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MainHandItemUseDuration()
classmethod
Returns the use time for the main hand item.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MarkVariant()
classmethod
Returns the entity's mark variant.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MaxDurability()
classmethod
Returns the max durability an item can take.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MaxHealth()
classmethod
Returns the maximum health of the entity, or 0.0 if it doesn't make sense to call on this entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MaxTradeTier()
classmethod
Returns the maximum trade tier of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MaximumFrameTime(frame=0)
classmethod
Returns the time in seconds of the most expensive frame over the last 'n' frames. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query.
frame = 0 will return the frame time of the frame before the current one. frame = 1 will return the average frame time of the previous two frames.
Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MinimumFrameTime(frame=0)
classmethod
Returns the time in seconds of the least expensive frame over the last 'n' frames. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query.
frame = 0 will return the frame time of the frame before the current one. frame = 1 will return the average frame time of the previous two frames.
Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ModelScale()
classmethod
Returns the scale of the current entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ModifiedDistanceMoved()
classmethod
Returns the total distance the entity has moved horizontally in meters (since the entity was last loaded, not necessarily since it was originally created) modified along the way by status flags such as is_baby or on_fire.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ModifiedMoveSpeed()
classmethod
Returns the current walk speed of the entity modified by status flags such as is_baby or on_fire.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MoonBrightness()
classmethod
Returns the brightness of the moon
- FULL_MOON = 1.0
- WANING_GIBBOUS = 0.75
- FIRST_QUARTER = 0.5
- WANING_CRESCENT = 0.25
- NEW_MOON = 0.0
- WAXING_CRESCENT = 0.25
- LAST_QUARTER = 0.5
- WAXING_GIBBOUS = 0.75
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MoonPhase()
classmethod
Returns the phase of the moon
- FULL_MOON = 0
- WANING_GIBBOUS = 1
- FIRST_QUARTER = 2
- WANING_CRESCENT = 3
- NEW_MOON = 4
- WAXING_CRESCENT = 5
- LAST_QUARTER = 6
- WAXING_GIBBOUS = 7
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
MovementDirection(axis)
classmethod
Returns the specified axis of the normalized position delta of the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Noise()
classmethod
Queries Perlin Noise Map.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
OnFireTime()
classmethod
Returns the time that the entity is on fire, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
OutOfControl()
classmethod
Returns 1.0 if the entity is out of control, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
OverlayAlpha()
classmethod
DEPRECATED (Do not use - this function is deprecated and will be removed).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
OwnerIdentifier()
classmethod
DEPRECATED (Use query.is_owner_identifier_any instead if possible so names can be changed later without breaking content.) Returns the root actor identifier.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
PlayerLevel()
classmethod
Returns the players level if the actor is a player, otherwise returns 0
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Position(axis)
classmethod
Returns the absolute position of an actor. Takes one argument that represents the desired axis (0 == x-axis, 1 == y-axis, 2 == z-axis).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
PositionDelta(axis)
classmethod
Returns the position delta for an actor. Takes one argument that represents the desired axis (0 == x-axis, 1 == y-axis, 2 == z-axis).
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
PreviousSquishValue()
classmethod
Returns the previous squish value for the current entity, or 0.0 if this doesn't make sense.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Property(property)
classmethod
Returns the value of the associated property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
property
|
str
|
The block property to query, no namespace. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RelativeBlockHasAllTags(x, y, z, *tags)
classmethod
Takes an entity-relative position and one or more tag names, and returns either 0 or 1 based on if that block at that position has all of the tags provided.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RelativeBlockHasAnyTags(x, y, z, *tags)
classmethod
Takes an entity-relative position and one or more tag names, and returns either 0 or 1 based on if that block at that position has any of the tags provided.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RemainingDurability()
classmethod
Returns the how much durability an item has remaining.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RideBodyXRotation()
classmethod
Returns the body pitch world-rotation of the ride an entity, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RideBodyYRotation()
classmethod
Returns the body pitch world-rotation of a valid rider at the provided index if called on an entity, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RideHeadXRotation()
classmethod
Returns the head x world-rotation of the ride of an entity, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RideHeadYRotation(clamp=0)
classmethod
Takes one optional argument as a parameter. Returns the head y world-rotation of the ride of an entity, else it returns 0.0. First parameter only for horses, zombie horses, skeleton horses, donkeys and mules that clamps rotation in degrees.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RiderBodyXRotation()
classmethod
Returns the body pitch world-rotation of a valid rider at the provided index if called on an entity, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RiderBodyYRotation()
classmethod
Returns the body yaw world-rotation of a valid rider at the provided index if called on an entity, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RiderHeadXRotation(head=0)
classmethod
Takes one argument as a parameter. Returns the head x world-rotation of the rider entity at the provided index, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RiderHeadYRotation(head=0, clamp=0)
classmethod
Takes one or two arguments as parameters. Returns the head y world-rotation of the rider entity at the provided index, else it returns 0.0. Horses, zombie horses, skeleton horses, donkeys and mules require a second parameter that clamps rotation in degrees.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RollCounter()
classmethod
Returns the roll counter of the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
RotationToCamera(axis)
classmethod
Returns the rotation required to aim at the camera. Requires one argument representing the rotation axis you would like (0 for x, 1 for y)
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Scoreboard(score)
classmethod
Server Only
Returns the specified scoreboard value for this entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
score
|
str
|
The name of the scoreboard to query. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ServerMemoryTier()
classmethod
Returns a number representing the server RAM memory tier, 0 = 'SuperLow', 1 = 'Low', 2 = 'Mid', 3 = 'High', or 4 = 'SuperHigh'. Available on the server side (Behavior Packs) only.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ShakeAngle()
classmethod
Returns the shaking angle of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ShakeTime()
classmethod
Returns the shake time of the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ShieldBlockingBob()
classmethod
Returns the how much the offhand shield should translate down when blocking and being hit.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
ShowBottom()
classmethod
Returns 1.0 if we render the entity's bottom, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SitAmount()
classmethod
Returns the current sit amount of the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SkinId()
classmethod
Returns the entity's skin ID
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SleepRotation()
classmethod
Returns the rotation of the bed the player is sleeping on.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SneezeCounter()
classmethod
Returns the sneeze counter of the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Spellcolor()
classmethod
Returns a struct representing the entity spell color for the specified entity. The struct contains '.r' '.g' '.b' and '.a' members, each 0.0 to 1.0. If no actor is specified, each member value will be 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
StandingScale()
classmethod
Returns the scale of how standing up the entity is.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
StructuralIntegrity()
classmethod
Returns the structural integrity for the actor, otherwise returns 0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SurfaceParticleColor()
classmethod
Client Only
Returns the particle color for the block located in the surface below the actor (scanned up to 10 blocks down). The struct contains '.r' '.g' '.b' and '.a' members, each 0.0 to 1.0. If no actor is specified or if no surface is found, each member value is set to 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SurfaceParticleTextureCoordinate()
classmethod
Client Only
Returns the texture coordinate for generating particles for the block located in the surface below the actor (scanned up to 10 blocks down) in a struct with 'u' and 'v' keys. If no actor is specified or if no surface is found, u and v will be 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SurfaceParticleTextureSize()
classmethod
Client Only
Returns the texture size for generating particles for the block located in the surface below the actor (scanned up to 10 blocks down). If no actor is specified or if no surface is found, each member value will be 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SwellAmount()
classmethod
Returns how swollen the entity is.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SwellingDir()
classmethod
Returns the swelling direction of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
SwimAmount()
classmethod
Returns the amount the current entity is swimming.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TailAngle()
classmethod
Returns the angle of the tail of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TargetXRotation()
classmethod
Returns the x rotation required to aim at the entity's current target if it has one, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TargetYRotation()
classmethod
Returns the y rotation required to aim at the entity's current target if it has one, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TextureFrameIndex()
classmethod
Returns the icon index of the experience orb
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TimeOfDay()
classmethod
Returns the time of day (midnight=0.0, sunrise=0.25, noon=0.5, sunset=0.75) of the dimension the entity is in.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TimeSinceLastVibrationDetection()
classmethod
Client Only
Returns the time in seconds since the last vibration detected by the actor. On errors or if no vibration has been detected yet, returns -1.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TimeStamp()
classmethod
Returns the current time stamp of the level.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TimerFlag1()
classmethod
Returns the value of timer_flag_1 set by behavior.timer_flag_1
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TimerFlag2()
classmethod
Returns the value of timer_flag_2 set by behavior.timer_flag_2
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TimerFlag3()
classmethod
Returns the value of timer_flag_3 set by behavior.timer_flag_3
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TotalEmitterCount()
classmethod
Returns the total number of active emitters in the world.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TotalParticleCount()
classmethod
Returns the total number of active particles in the world.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
TradeTier()
classmethod
Returns the trade tier of the entity if it makes sense, else it returns 0.0.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
UnhappyCounter()
classmethod
Returns how unhappy the entity is.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
Variant()
classmethod
Returns the entity's variant index.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
VerticalSpeed()
classmethod
Returns the speed of the entity up or down in meters/second, where positive is up.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
WalkDistance()
classmethod
Returns the walk distance of the entity.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
WingFlapPosition()
classmethod
Returns the wing flap position of the entity, or 0.0 if this doesn't make sense.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
WingFlapSpeed()
classmethod
Returns the wing flap speed of the entity, or 0.0 if this doesn't make sense.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
YawSpeed()
classmethod
Returns the entity's yaw speed.
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |
has_block_state(state)
classmethod
Returns 1.0 if the associated block has the given block state or 0.0 if not.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
str
|
The block state to query, no namespace. |
required |
Returns:
Name | Type | Description |
---|---|---|
Molang |
_molang
|
A Molang Instance |