1

Execute for players at y-dy (SOLVED)

SortaSnowy's Avatar SortaSnowy5/2/19 8:28 am
1 emeralds 672 6
5/2/2019 11:59 pm
SortaSnowy's Avatar SortaSnowy
So I'm trying to execute a tp command when a player falls below y5 and above y0, but all the other inquiries I've seen online are outdated and I'm not great at getting execute commands to work properly, rip. Any suggestions?

note: I'm using a command block to run the command
Posted by SortaSnowy's Avatar
SortaSnowy
Level 28 : Expert Artist
7

Create an account or sign in to comment.

6

2
05/02/2019 10:30 am
Level 2 : Apprentice Network
kebe3
kebe3's Avatar
You do something like:

execute at @a as @p[y=0,distance=..5] run CMD
1
05/02/2019 8:19 pm
Level 28 : Expert Artist
SortaSnowy
SortaSnowy's Avatar
works! ty :)
1
05/02/2019 9:23 am
Level 59 : Grandmaster Engineer
resistance_is_futile
resistance_is_futile's Avatar
the selector should be about this:
  execute as @e[type=player,y=0..5] at @s run #command that shall be executed
1
05/02/2019 9:36 am
Level 28 : Expert Artist
SortaSnowy
SortaSnowy's Avatar
y=0..5 gives invalid doubles error, the rest works apart from that though
1
05/02/2019 9:46 am
Level 59 : Grandmaster Engineer
resistance_is_futile
resistance_is_futile's Avatar
I made something similar, but i used a workaround:
scoreboard players set @s y_pos 0
execute store result score @s y_pos run data get entity @s Pos[1]
execute if score @s y_pos matches 0..5 run #whatever you want to run

this should work definetl.y
1
05/02/2019 10:21 amhistory
Level 28 : Expert Artist
SortaSnowy
SortaSnowy's Avatar
how did you set this up? I can't seem to get it to work either :/
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome