1. Wiki
  2. /Entities
  3. /minecraft:entity_sensor

minecraft:entity_sensor

Don't want to write this by hand? GodCraft sets minecraft:entity_sensor for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
find_players_onlyBoolean"false"Only look for players in every subsensor.
relative_rangeBoolean"true"Adds the entity's own size to each subsensor range.
subsensorsListnoneList 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": {}
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more