Core - Filters Module
anvil.lib.filters
Filter
all_of(*filters)
staticmethod
Returns true when all of the filters evaluate to true.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*filters
|
Filter
|
Variable number of filter conditions |
()
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter group requiring all conditions to be true |
Example
Filter.all_of( Filter.is_family("monster"), Filter.is_difficulty(Difficulty.Hard) )
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filterlist
all_slots_empty(value=FilterEquipmentDomain.Any, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the designated equipment location for the subject entity is completely empty.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
FilterEquipmentDomain
|
The equipment location to test. Defaults to FilterEquipmentDomain.Any. |
Any
|
subject
|
FilterSubject
|
Subject to test the value against. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use in testing. Defaults to FilterOperation.Equals. |
Equals
|
any_of(*filters)
staticmethod
Returns true when any of the filters evaluate to true.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*filters
|
Filter
|
Variable number of filter conditions |
()
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter group requiring at least one condition to be true |
Example
Filter.any_of( Filter.is_family("monster"), Filter.is_family("creature") )
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filterlist
any_slot_empty(value=FilterEquipmentDomain.Any, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the designated equipment location for the subject entity has any empty slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
FilterEquipmentDomain
|
The equipment location to test. Defaults to FilterEquipmentDomain.Any. |
Any
|
subject
|
FilterSubject
|
Subject to test the value against. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use in testing. Defaults to FilterOperation.Equals. |
Equals
|
clock_time(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Compares the current time with a float value in the range (0.0, 1.0).
Time values: 0.0=Noon, 0.25=Sunset, 0.5=Midnight, 0.75=Sunrise
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
Time value between 0.0 and 1.0 |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing game time |
Example
Filter.clock_time(0.0) # Test for noon Filter.clock_time(0.5) # Test for midnight
Note
Use hourly_clock_time for integer-based time (0-24000 range)
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/clock_time
distance_to_nearest_player(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Compares the distance to the nearest Player with a float value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
The distance value to compare against (minimum 0.0) |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing distance to nearest player |
Example
Test if entity is within 10 blocks of nearest player
Filter.distance_to_nearest_player(10.0, operator=FilterOperation.LessEqual)
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/distance_to_nearest_player
has_ability(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity has the named ability.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
The ability type to test. Valid values: - "flySpeed", "flying", "instabuild", "invulnerable", - "lightning", "mayfly", "mute", "noclip", - "verticalFlySpeed", "walkSpeed", "worldbuilder" |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing player ability |
Example
Filter.has_ability("instabuild") # Test if player has creative mode Filter.has_ability("flying") # Test if player can fly
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_ability
has_biome_tag(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Checks if the entity is in a biome with the specified tag.
has_component(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity contains the named component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
The component identifier to test for (e.g., "minecraft:health") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing for component presence |
Example
Test if entity has health component
Filter.has_component("minecraft:health")
Test if target has tameable component
Filter.has_component("minecraft:tameable", subject=FilterSubject.Target)
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_component
has_container_open(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject Player entity has opened a container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether container is open |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing if player has container open |
Example
Filter.has_container_open(True) # Test if player has container open
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_container_open
has_mob_effect(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the Subject has the specified mob effect.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
The mob effect identifier (e.g., "poison", "regeneration") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing mob effect presence |
Example
Filter.has_mob_effect("poison") # Test if entity is poisoned Filter.has_mob_effect("regeneration") # Test if entity is regenerating
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_mob_effect
has_nametag(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject has been given a custom name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity has a nametag |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing nametag presence |
Example
Filter.has_nametag(True) # Test if entity has been named
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_nametag
has_ranged_weapon(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is holding a ranged weapon like a bow or crossbow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity has ranged weapon |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing ranged weapon possession |
Example
Filter.has_ranged_weapon(True) # Test if entity has bow/crossbow
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_ranged_weapon
has_silk_touch(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is holding an item with silk touch enchantment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether item has silk touch |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing silk touch presence |
Example
Filter.has_silk_touch(True) # Test if held item has silk touch
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_silk_touch
has_trade_supply(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the target has any trade supply left.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity has trade supply |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing trade supply availability |
Example
Filter.has_trade_supply(True) # Test if villager has trades available
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/has_trade_supply
hourly_clock_time(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Compares the current 24 hour time with an int value in the range [0, 24000].
This is an updated version of clock_time that uses integers based on in-game time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
int
|
Time value between 0 and 24000 (0=dawn, 6000=noon, 12000=sunset, 18000=midnight) |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing game time in ticks |
Example
Filter.hourly_clock_time(6000) # Test for noon Filter.hourly_clock_time(18000) # Test for midnight
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/hourly_clock_time
in_block(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is inside a specified Block type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Block identifier (e.g., "minecraft:water", "minecraft:lava") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing if entity is inside block |
Example
Filter.in_block("minecraft:water") # Test if entity is in water block Filter.in_block("minecraft:lava") # Test if entity is in lava
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_block
in_caravan(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is in a caravan.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in caravan |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing caravan membership |
Example
Filter.in_caravan(True) # Test if llama is in caravan
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_caravan
in_clouds(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is in the clouds.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in clouds |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing cloud height |
Example
Filter.in_clouds(True) # Test if entity is at cloud level
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_clouds
in_contact_with_water(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity in contact with any water: water, rain, splash water bottle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in contact with water |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing water contact |
Example
Filter.in_contact_with_water(True) # Test if entity touches any water source
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_contact_with_water
in_lava(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is in lava.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in lava |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing lava immersion |
Example
Filter.in_lava(True) # Test if entity is in lava
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_lava
in_nether(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is in Nether dimension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in Nether |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing Nether dimension |
Example
Filter.in_nether(True) # Test if entity is in Nether
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_nether
in_overworld(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is in Overworld dimension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in Overworld |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing Overworld dimension |
Example
Filter.in_overworld(True) # Test if entity is in Overworld
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_overworld
in_water_or_rain(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is in water or rain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in water or rain |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing water or rain exposure |
Example
Filter.in_water_or_rain(True) # Test if entity is wet
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/in_water_or_rain
inactivity_timer(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the specified duration in seconds of inactivity for despawning has been reached.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
int
|
Inactivity duration in seconds |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing inactivity timer |
Example
Filter.inactivity_timer(300, operator=FilterOperation.GreaterEqual) # 5+ minutes inactive
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/inactivity_timer
is_altitude(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests the current altitude against a provided value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
int
|
Y-coordinate altitude to test |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing altitude/Y position |
Example
Filter.is_altitude(64, operator=FilterOperation.Greater) # Above sea level
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_altitude
is_avoiding_mobs(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is fleeing from other mobs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is avoiding mobs |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing avoidance behavior |
Example
Filter.is_avoiding_mobs(True) # Test if entity is fleeing
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_avoiding_mobs
is_baby(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is a baby.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is baby |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing baby state |
Example
Filter.is_baby(True) # Test if entity is baby/child
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_baby
is_block(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the block has the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
BlockDescriptor | Identifier
|
Block descriptor or identifier to test |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing block type |
Example
Filter.is_block("minecraft:stone") # Test if block is stone
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_block
is_brightness(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests the current brightness against a provided value in the range (0.0f, 1.0f).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
Brightness value between 0.0 (darkest) and 1.0 (brightest) |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing brightness level |
Example
Filter.is_brightness(0.5, operator=FilterOperation.Less) # Test if dim
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_brightness
is_climbing(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is climbing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is climbing |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing climbing state |
Example
Filter.is_climbing(True) # Test if entity is on ladder/vines
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_climbing
is_color(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is the named color.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Color name (e.g., "red", "blue", "white", etc.) |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing entity color |
Example
Filter.is_color("red") # Test if sheep is red Filter.is_color("white") # Test if wolf is white
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_color
is_family(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is a member of the named family.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
The family name to test for (e.g., "monster", "player", "mob") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing family membership |
Example
Test if entity is a monster
Filter.is_family("monster")
Test if target is not a player
Filter.is_family("player", subject=FilterSubject.Target, operator=FilterOperation.Not)
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_family
is_game_rule(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether a named game rule is active.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Game rule name (e.g., "doMobSpawning", "keepInventory") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing game rule state |
Example
Filter.is_game_rule("doMobSpawning") # Test if mob spawning enabled
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_game_rule
is_humid(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the Subject is in an area with humidity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether area is humid |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing humidity level |
Example
Filter.is_humid(True) # Test if in humid biome (jungle, swamp)
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_humid
is_immobile(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is immobile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is immobile |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing immobility state |
Example
Filter.is_immobile(True) # Test if entity cannot move
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_immobile
is_in_village(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the Subject is inside the bounds of a village.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is in village |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing village bounds |
Example
Filter.is_in_village(True) # Test if entity is within village
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_in_village
is_leashed(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is leashed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is leashed |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing leash state |
Example
Filter.is_leashed(True) # Test if mob is on leash
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_leashed
is_leashed_to(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity leashed to the calling entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether subject is leashed to caller |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing leash connection |
Example
Filter.is_leashed_to(True, subject=FilterSubject.Target) # Test if target is leashed to cls
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_leashed_to
is_missing_health(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is not at full health.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is missing health |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing damaged state |
Example
Filter.is_missing_health(True) # Test if entity is damaged
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_missing_health
is_moving(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is moving.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
The movement state to test for |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing movement state |
Example
Filter.is_moving(True) # Test if entity is moving
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_moving
is_navigating(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is currently pathfinding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is pathfinding |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing navigation state |
Example
Filter.is_navigating(True) # Test if mob is pathfinding to destination
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_navigating
is_persistent(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject's persistence matches the bool value passed in.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Persistence state to test |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing persistence |
Example
Filter.is_persistent(True) # Test if entity won't despawn
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_persistent
is_riding_self(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is riding the calling entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether subject is riding caller |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing rider relationship |
Example
Filter.is_riding_self(True, subject=FilterSubject.Target) # Test if target is riding cls
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_riding_self
is_sleeping(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the Subject is sleeping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is sleeping |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing sleep state |
Example
Filter.is_sleeping(True) # Test if villager is sleeping in bed
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_sleeping
is_sneak_held(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity has the sneak input held.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether sneak input is held |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing sneak input |
Example
Filter.is_sneak_held(True) # Test if player is holding sneak button
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_sneak_held
is_sneaking(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject entity is sneaking.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is sneaking |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing sneak state |
Example
Filter.is_sneaking(True) # Test if player is sneaking
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_sneaking
is_snow_covered(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the Subject is in an area with snow cover.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether area has snow cover |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing snow coverage |
Example
Filter.is_snow_covered(True) # Test if in snowy biome
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_snow_covered
is_temperature_type(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests whether the current temperature is a given type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Temperature type ("cold", "mild", "ocean", "warm") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing temperature category |
Example
Filter.is_temperature_type("cold") # Test if in cold biome
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_temperature_type
is_temperature_value(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests the current temperature against a provided value in the range (0.0, 1.0).
Where 0.0 is the coldest temp and 1.0 is the hottest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
Temperature value between 0.0 (coldest) and 1.0 (hottest) |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing temperature value |
Example
Filter.is_temperature_value(0.8, operator=FilterOperation.Greater) # Test if very hot
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_temperature_value
is_underground(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is underground.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is underground |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing underground state |
Example
Filter.is_underground(True) # Test if entity is below surface
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_underground
is_vehicle_family(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity's vehicle is a member of the named family.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Vehicle family name to test |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing vehicle family |
Example
Filter.is_vehicle_family("boat") # Test if riding boat
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_vehicle_family
is_waterlogged(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject block is submerged in water.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether block is waterlogged |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing waterlogged state |
Example
Filter.is_waterlogged(True, subject=FilterSubject.Block) # Test if block is waterlogged
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/is_waterlogged
light_level(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the mob is outside of the specified light level range (0, 16).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
int
|
Light level value between 0 and 16 |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing light level |
Example
Filter.light_level(7, operator=FilterOperation.Less) # Test if dark enough for mob spawning
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/light_level
moon_intensity(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Compares the current moon intensity with a float value in the range (0.0, 1.0).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
Moon intensity between 0.0 and 1.0 |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing moon brightness |
Example
Filter.moon_intensity(1.0) # Test for full moon
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/moon_intensity
moon_phase(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Compares the current moon phase with an integer value in the range (0, 7).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
int
|
Moon phase between 0 and 7 (0=full moon, 4=new moon) |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing moon phase |
Example
Filter.moon_phase(0) # Test for full moon Filter.moon_phase(4) # Test for new moon
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/moon_phase
none_of(*filters)
staticmethod
Returns true when none of the filters evaluate to true.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*filters
|
Filter
|
Variable number of filter conditions |
()
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter group requiring no conditions to be true |
Example
Filter.none_of( Filter.is_family("player"), Filter.has_tag("peaceful") )
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filterlist
on_fire(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is on fire.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is on fire |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing fire state |
Example
Filter.on_fire(True) # Test if entity is burning
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/on_fire
on_hot_block(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is on a hot block (like magma).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is on hot block |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing hot block contact |
Example
Filter.on_hot_block(True) # Test if standing on magma block
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/on_hot_block
on_ladder(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true when the subject entity is on a ladder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is on ladder |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing ladder state |
Example
Filter.on_ladder(True) # Test if entity is climbing ladder
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/on_ladder
surface_mob(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is a surface mob.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is surface mob |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing surface mob classification |
Example
Filter.surface_mob(True) # Test if mob spawns on surface
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/surface_mob
taking_fire_damage(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests if the subject is taking fire damage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity is taking fire damage |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing fire damage |
Example
Filter.taking_fire_damage(True) # Test if entity is burning and taking damage
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/taking_fire_damage
trusts(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns true if the subject is trusted by entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
bool
|
Whether entity trusts subject |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing trust relationship |
Example
Filter.trusts(True, subject=FilterSubject.Player) # Test if entity trusts player
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/trusts
weather(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests the current weather in the dimension against a provided weather value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Weather type ("clear", "rain", "thunder") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing weather conditions |
Example
Filter.weather("rain") # Test if raining Filter.weather("thunder") # Test if thunderstorm
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/weather
weather_at_position(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Tests the current weather, at the actor's position, against a provided weather value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
Weather type ("clear", "rain", "thunder") |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing local weather conditions |
Example
Filter.weather_at_position("rain") # Test if raining at exact position
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/weather_at_position
y_rotation(value, *, subject=FilterSubject.Self, operator=FilterOperation.Equals)
classmethod
Returns the Y rotation of this entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
Y rotation value in degrees |
required |
subject
|
FilterSubject
|
Subject to test. Defaults to FilterSubject.Self. |
Self
|
operator
|
FilterOperation
|
Operation to use. Defaults to FilterOperation.Equals. |
Equals
|
Returns:
Name | Type | Description |
---|---|---|
dict |
Filter testing Y rotation |
Example
Filter.y_rotation(0.0, operator=FilterOperation.Less) # Test if facing north-ish
Reference
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/filters/y_rotation