minecraft:entity_sensor for you with a switch.Get GodCraftOverview
minecraft:entity_sensor is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Watches for other entities nearby and fires events when they match your conditions. Each subsensor has its own range and event.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
find_players_only | Boolean | "false" | Only look for players in every subsensor. |
relative_range | Boolean | "true" | Adds the entity's own size to each subsensor range. |
subsensors | List | none | List of sensors, each with range, conditions and the event to fire. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:entity_sensor": {
"find_players_only": "false",
"relative_range": "true",
"subsensors": {}
}
}