#Make a function run only if a target is in the void
1 messages · Page 1 of 1 (latest)
i think
execute as @a[y=-65,dy=-200] run function <your function>
or
execute if entity @a[y=-65,dy=-200] run function <your function>
the 1st one runs the function individually once for and as each player in the void
the 2nd one runs it just once per tick if there is a player in the void
you can make the dy lower i.e. -1000 if you really need the scanning area to be that far below bedrock
cool, I'll try it out 😄
so that doesn't work, it's targeting entities which are well above y=-64, I'm guessing that entire y position check is busted
in minecraft I mean
your code should work
You could rip it apart, does the following work?
execute as @a at @s positioned ~ -65 ~ if entity @s[dy=-1000] run say in void
ig you could copy y-positions of players in a scoreboard and test if the value is below -65
😔
you need help? haha
I was using needs redstone for this
bruh
it's working now
oh- still weird that it didnt work with command blocks tho lol
yeah. Basically what I'm trying to do is make all entities within a few x and z chunks of an end crystal teleport back to said crystal once being lower than y=0 in the end
it's not going well 😭
lmao dont lose hope
yes
Suggestion: when i normally do stuff like this I like working with scoreboards and just store their position, then execute based on the score and it has never failed me (there are definitely better ways of doing it, but i like scoreboards, and i know it works)
yup, thats what i offered right here
i still dont understand using x, dx, etc in selectors which is embarassing
okay so is this solved?
@paper ice have you found a solution
he said it works now sooo
The command was working, but I couldn't figure out how to make it work with my intended use.
Try to use this predicate :
[
{
"condition": "minecraft:location_check",
"predicate": {
"position": {
"y": {
"max": 0
}
}
}
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:location_check",
"predicate": {
"block": {}
}
}
}
]
First part test if you are under y=0 and second part test if there is no block at your position. If both tests are true, then you are under the world
resolved?
I'll be honest, I'm very new to this and don't know how to use predicates