1

Execute if light level < 10

Skem 10/7/22 1:00 pm
154
10/7/2022 1:46 pm
I need to make it so that a command executes if the light level at the player is less than 10, ive figured id probably need a execute as @a at @s but i dont know what to put after to sense the light level
Posted by
Skem
Level 1 : New Miner
0

  Have something to say?

JoinSign in

1

Spuduking
10/07/2022 1:46 pm
Level 34 : Artisan Procrastinator
history
You'll need a predicate in a data pack, probably something like this:

{
"condition": "minecraft:entity_properties",
"entity": "this",
  "predicate": {
    "location": {
      "light": {
        "light": {
        "min": 0,
        "max": 9
        }
      }
    }
  }
}

then you can do:
/execute as @a at @s if predicate namespace:light_predicate run <command>
2

Welcome