I am building a map in java version that rely's on the player staying in the light. i have invisible armor stands named light placed where the light sources are and i have tried for a few days to detect them within a radius of the player but cant seem to figure it out.
I have a clock running that subtracts from the scoreboard light till it hits 0 and deals damage to the player so they can spend a few seconds in the dark. I need to test for day/night(i can figure that out) and test if the player is underground which ill figure out later(or if anyone has any ideas on that) and then issue this command if the player is in the dark
The line of code i basically need is /execute if player(s) are within 10 blocks of entity armor stand custom name light set scoreboard light to 200,
It needs to test and set each player individual also
I am building a map in java version that rely's on the player staying in the light. i have invisible armor stands named light placed where the light sources are and i have tried for a few days to detect them within a radius of the player but cant seem to figure it out.
I have a clock running that subtracts from the scoreboard light till it hits 0 and deals damage to the player so they can spend a few seconds in the dark. I need to test for day/night(i can figure that out) and test if the player is underground which ill figure out later(or if anyone has any ideas on that) and then issue this command if the player is in the dark
The line of code i basically need is /execute if player(s) are within 10 blocks of entity armor stand custom name light set scoreboard light to 200,
It needs to test and set each player individual also
Thanks you for reading this!
So I am in bedrock and this is how I would do this I think you can figure it out for the most part. Utilize your target selectors.
i.e.
/execute @e[name=light,r=10] ~~~ effect @e[tag=player1] blindness
I changed all the stuff to java version but it didnt work
Ive tried variations of all of these but nothing happens
/execute if entity @e[name="\"Garry\"",distance=5,tag=Jasutt] at @a run say hey
/execute at @a if entity @e[name="\"Garry\"",distance=5] at @a run say hey
/execute at @a if entity @e[name=Garry,distance=5] at @a run say hey
/execute as @a if entity @e[name=Garry,distance=5] at @a run say hey
/execute if entity @e[name=Garry,distance=5] run say hey
I just happened to have a armor stand named Garry near by
The solution is that if you are using distance you need these periods before the number [distance=..x]
execute at @p if entity @e[type=minecraft:armor_stand,name=Light,distance=..5] run say hey