minecraft:environment_sensor for you with a switch.Get GodCraftOverview
minecraft:environment_sensor is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Fires events when conditions around the entity become true, like being in water or the time of day. Use it to switch behaviors based on surroundings.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
triggers | List | none | List of filter and event pairs to check. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:environment_sensor": {
"triggers": {}
}
}