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

minecraft:environment_sensor

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

Overview

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

FieldTypeDefaultDescription
triggersListnoneList 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": {}
  }
}

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