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
1
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>
{
"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>
