I'm here today for advert you about a thing. I AM ****ING DUMB.
Yeah, you gonna say "I knew it from the bottom on my ass. But why today ?"
So, let me tell you a story.
For a server, I have to save a place the player want and when the time will come, teleport this player at this place. So I thought about like a million ways to do it, with an armor stand that holds an Item with player's UUID, and some other dumb ways... But HEY MAN, WHAT ABOUT SCOREBOARD, YOU KNOW, LIKE WHAT YOU USE EVERYTIME !
And to that I answered "Meh, you can't use scoreboard to teleport a player in a specific place with one command"
HOW FOOLISH OF ME ! Maybe I can't do it in 1 command, but with like full of tp @s ~1 ~ ~ YOU CAN DO THAT !
Sooooooo, here come my commands, that I did in like 20 minutes, even if I search since days !
I have decomposed it into 8 files, all stocked in a folder "save_et_tp" (So frenglish) in my function folder.
Save.mcfunction is for save your coordinates, and retour.mcfunction for return to the coordinates saved.
1) save.mcfunction
scoreboard objectives add save_x dummy
scoreboard objectives add save_y dummy
scoreboard objectives add save_z dummy
scoreboard objectives add x_min dummy
scoreboard objectives add y_min dummy
scoreboard objectives add z_min dummy
execute store result score @s save_x run data get entity @s Pos[0]
execute store result score @s save_y run data get entity @s Pos[1]
execute store result score @s save_z run data get entity @s Pos[2]
2) retour.mcfunction (So french)
scoreboard objectives add save_x_2 dummy
scoreboard objectives add save_y_2 dummy
scoreboard objectives add save_z_2 dummy
scoreboard objectives add save_x_3 dummy
scoreboard objectives add save_y_3 dummy
scoreboard objectives add save_z_3 dummy
scoreboard players set #1 save_x -1
scoreboard players set @s x_min 0
scoreboard players set @s y_min 0
scoreboard players set @s z_min 0
execute store result score @s save_x_2 run data get entity @s Pos[0]
execute store result score @s save_y_2 run data get entity @s Pos[1]
execute store result score @s save_z_2 run data get entity @s Pos[2]
scoreboard players operation @s save_x_3 = @s save_x
scoreboard players operation @s save_y_3 = @s save_y
scoreboard players operation @s save_z_3 = @s save_z
scoreboard players operation @s save_x_3 -= @s save_x_2
scoreboard players operation @s save_y_3 -= @s save_y_2
scoreboard players operation @s save_z_3 -= @s save_z_2
execute if score @s save_x_3 matches ..0 run scoreboard players add @s x_min 1
execute if score @s save_y_3 matches ..0 run scoreboard players add @s y_min 1
execute if score @s save_z_3 matches ..0 run scoreboard players add @s z_min 1
execute if score @s save_x_3 matches ..0 run scoreboard players operation @s save_x_3 *= #1 save_x
execute if score @s save_y_3 matches ..0 run scoreboard players operation @s save_y_3 *= #1 save_x
execute if score @s save_z_3 matches ..0 run scoreboard players operation @s save_z_3 *= #1 save_x
function datapack:save_et_tp/recurs_x
function datapack:save_et_tp/recurs_y
function datapack:save_et_tp/recurs_z
3) recurs_x.mcfunction
execute if score @s save_x_3 matches 1.. run function datapack:save_et_tp/retour_x
scoreboard players remove @s save_x_3 1
execute if score @s save_x_3 matches 1.. run function datapack:save_et_tp/recurs_x
4) recurs_y.mcfunction
execute if score @s save_y_3 matches 1.. run function datapack:save_et_tp/retour_y
scoreboard players remove @s save_y_3 1
execute if score @s save_y_3 matches 1.. run function datapack:save_et_tp/recurs_y
5) recurs_z.mcfunction
execute if score @s save_z_3 matches 1.. run function datapack:save_et_tp/retour_z
scoreboard players remove @s save_z_3 1
execute if score @s save_z_3 matches 1.. run function datapack:save_et_tp/recurs_z
6) retour_x.mcfunction
execute at @s if score @s x_min matches 0 run tp @s ~1 ~ ~
execute at @s if score @s x_min matches 1 run tp @s ~-1 ~ ~
7) retour_y.mcfunction
execute at @s if score @s y_min matches 0 run tp @s ~ ~1 ~
execute at @s if score @s y_min matches 1 run tp @s ~ ~-1 ~
8) retour_z.mcfunction
execute at @s if score @s z_min matches 0 run tp @s ~ ~ ~1
execute at @s if score @s z_min matches 1 run tp @s ~ ~ ~-1
That's all... Maybe I thought that it will be jerky (don't sure about what google trad gave me) if I tp block per block... But it so smooth :'o
Why don't I test that before ??
So you wanted to tp to precise coords? You would have been better to tell it earlier, lol
Of course, standard ways can not do that using armor stands, as once you teleport the armor stand, it could be no longer loaded by the world then you couldn't target it for teleportation...
However, I discovered a little trick that might help you (it have probably been found before, everything have been found...)
1. summon an armor stand.
2. run this :
execute as @e[type=minecraft:armor_stand] at @s run function #function#
#function content (you HAVE to make it as function, command blocks doesn't work for that) :
data modify entity @s Pos set value [50000.0,1.0,0.0]
execute at @s run tp @p ~ ~ ~
Even though 50 000 / 1 / 0 have not been generated, running this as a function will still consider the armor stand when it comes to teleportation.
Contrary to command blocks, the whole function targets the same armor stand.
I guess minecraft keeps targeting the armor stand until the function have been fully ran, and so it is still considered when you want to teleport the player at it.
You would only have to modify the armor stand Pos by copying player's "home" coords stored in scoreboard.
Should be quite less trouble than your big system...
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I guess you could use a "for" function... something like :
Function X:
execute as @a["GoingHome:1",limit=1] run [home tp @s stuff, and remove "GoingHome" tag]
execute if entity @a["GoingHome:1"] run function X
That way, there is only one home tp at a time. If by any chance, 2 players tp on the exact same tick, the function will teleport them one after other
As long as there are people in queue for teleportation, the function will run again and again until all requests are fulfilled.
Hope it could help to simplify your system
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
scoreboard objectives add save_x dummy
scoreboard objectives add save_y dummy
scoreboard objectives add save_z dummy
scoreboard objectives add save_rx dummy
scoreboard objectives add save_rz dummy
execute store result score @s save_x run data get entity @s Pos[0]
execute store result score @s save_y run data get entity @s Pos[1]
execute store result score @s save_z run data get entity @s Pos[2]
execute store result score @s save_rx run data get entity @s Rotation[0]
execute store result score @s save_rz run data get entity @s Rotation[1]
2) retour.mcfunction
summon armor_stand ~ ~ ~ {Tags:["move"],Invisible:1b,Invulnerable:1b}
execute store result entity @e[tag=move,limit=1] Pos[0] int 1 run scoreboard players get @s save_x
execute store result entity @e[tag=move,limit=1] Pos[1] int 1 run scoreboard players get @s save_y
execute store result entity @e[tag=move,limit=1] Pos[2] int 1 run scoreboard players get @s save_z
execute store result entity @e[tag=move,limit=1] Rotation[0] float 1 run scoreboard players get @s save_rx
execute store result entity @e[tag=move,limit=1] Rotation[1] float 1 run scoreboard players get @s save_rz
tp @s @e[limit=1,tag=move]
tag @s remove GoingHome
kill @e[tag=move]
and in the every_tick.mcfunction :
execute as @a[tag=GoingHome,limit=1] run function datapack:save_et_tp/retour
You don't need to store rotation for the teleportation :
Doing /execute at %stand% run tp @s ~ ~ ~ keeps player rotation, instead of /tp @s %stand%
Also, the way you made it only check to 1 player per tick...
Here are the functions I thought of (duh I cant put code on phone >:-(
&every_tick
execute if entity @a[tag=GoingHome] run function datapack:save_et_tp/target_retour
&target_retour
execute as @a[tag=GoingHome,limit=1] at @s run function retour
execute if entity @a[tag=GoingHome] run function target_retour
Adding target_retour function, you would complete all requests in one tick
Also is your retour function working?
I thought we had to run it as the armor stand, to keep it targetted...
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Oh, I didn't thought about make it in only 1 tick, thanks !
For the player rotation, I want to keep his rotation when he saved the position, not the position when he run the function !
Thanks anyways, I do it in 1 tick now !
So, here my commands :
1) tp.mcfunction
execute as @a[tag=GoingHome,limit=1] run function datapack:tp/tp_back
execute if entity @a[tag=GoingHome] run function datapack:tp/tp
2) save.mcfunction
scoreboard objectives add save_x dummy
scoreboard objectives add save_y dummy
scoreboard objectives add save_z dummy
scoreboard objectives add save_rx dummy
scoreboard objectives add save_rz dummy
execute store result score @s save_x run data get entity @s Pos[0]
execute store result score @s save_y run data get entity @s Pos[1]
execute store result score @s save_z run data get entity @s Pos[2]
execute store result score @s save_rx run data get entity @s Rotation[0]
execute store result score @s save_rz run data get entity @s Rotation[1]
3) tp_back.mcfunction
summon armor_stand ~ ~1 ~ {Tags:["move"],Invisible:1b,Invulnerable:1b}
execute store result entity @e[tag=move,limit=1] Pos[0] int 1 run scoreboard players get @s save_x
execute store result entity @e[tag=move,limit=1] Pos[1] int 1 run scoreboard players get @s save_y
execute store result entity @e[tag=move,limit=1] Pos[2] int 1 run scoreboard players get @s save_z
execute store result entity @e[tag=move,limit=1] Rotation[0] float 1 run scoreboard players get @s save_rx
execute store result entity @e[tag=move,limit=1] Rotation[1] float 1 run scoreboard players get @s save_rz
tp @s @e[limit=1,tag=move]
tag @s remove GoingHome
kill @e[tag=move]
4) every_tick.mcfunction
execute if entity @a[tag=GoingHome] run function datapack:tp/tp
I'm on my computer right now, gonna make the same system cause I'm yet not convinced lol (sorry about bothering you that much about this,,,)
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Oh don't worry, you absolutely don't bothering me, you helped me so much, if you have something that tickles you (Je sais pas si ça se dit, ça), just tell me !
At best I will learn something and at worse, I will not ^^
Hello everyone.
I'm here today for advert you about a thing. I AM ****ING DUMB.
Yeah, you gonna say "I knew it from the bottom on my ass. But why today ?"
So, let me tell you a story.
For a server, I have to save a place the player want and when the time will come, teleport this player at this place. So I thought about like a million ways to do it, with an armor stand that holds an Item with player's UUID, and some other dumb ways... But HEY MAN, WHAT ABOUT SCOREBOARD, YOU KNOW, LIKE WHAT YOU USE EVERYTIME !
And to that I answered "Meh, you can't use scoreboard to teleport a player in a specific place with one command"
HOW FOOLISH OF ME ! Maybe I can't do it in 1 command, but with like full of tp @s ~1 ~ ~ YOU CAN DO THAT !
Sooooooo, here come my commands, that I did in like 20 minutes, even if I search since days !
I have decomposed it into 8 files, all stocked in a folder "save_et_tp" (So frenglish) in my function folder.
Save.mcfunction is for save your coordinates, and retour.mcfunction for return to the coordinates saved.
1) save.mcfunction
2) retour.mcfunction (So french)
3) recurs_x.mcfunction
4) recurs_y.mcfunction
5) recurs_z.mcfunction
6) retour_x.mcfunction
7) retour_y.mcfunction
8) retour_z.mcfunction
That's all... Maybe I thought that it will be jerky (don't sure about what google trad gave me) if I tp block per block... But it so smooth :'o
Why don't I test that before ??
I'm going to cry now, see you later.
I like trains... OF CHAIN COMMAND BLOCKS !
So you wanted to tp to precise coords? You would have been better to tell it earlier, lol
Of course, standard ways can not do that using armor stands, as once you teleport the armor stand, it could be no longer loaded by the world then you couldn't target it for teleportation...
However, I discovered a little trick that might help you (it have probably been found before, everything have been found...)
1. summon an armor stand.
2. run this :
#function content (you HAVE to make it as function, command blocks doesn't work for that) :
Even though 50 000 / 1 / 0 have not been generated, running this as a function will still consider the armor stand when it comes to teleportation.
Contrary to command blocks, the whole function targets the same armor stand.
I guess minecraft keeps targeting the armor stand until the function have been fully ran, and so it is still considered when you want to teleport the player at it.
You would only have to modify the armor stand Pos by copying player's "home" coords stored in scoreboard.
Should be quite less trouble than your big system...
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I think you misunderstood what I want to do.
I want all players to have a point where they can go by using a function (point choose by the player)
With your commands, only the nearest player will be teleport and not the player who ran the function.
The thing is if 2 or more players use the function at the same time, there's always a way that will cause an error.
I like trains... OF CHAIN COMMAND BLOCKS !
I guess you could use a "for" function... something like :
Function X:
execute as @a["GoingHome:1",limit=1] run [home tp @s stuff, and remove "GoingHome" tag]
execute if entity @a["GoingHome:1"] run function X
That way, there is only one home tp at a time. If by any chance, 2 players tp on the exact same tick, the function will teleport them one after other
As long as there are people in queue for teleportation, the function will run again and again until all requests are fulfilled.
Hope it could help to simplify your system
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Once again, you're great help <3
I didn't thought about put it in every tick function !
Thanks
I like trains... OF CHAIN COMMAND BLOCKS !
Here my commands now, it's a little shorter.
1) save.mcfunction
2) retour.mcfunction
and in the every_tick.mcfunction :
I like trains... OF CHAIN COMMAND BLOCKS !
If I can help to make it even shorter lol...
You don't need to store rotation for the teleportation :
Doing /execute at %stand% run tp @s ~ ~ ~ keeps player rotation, instead of /tp @s %stand%
Also, the way you made it only check to 1 player per tick...
Here are the functions I thought of (duh I cant put code on phone >:-(
&every_tick
execute if entity @a[tag=GoingHome] run function datapack:save_et_tp/target_retour
&target_retour
execute as @a[tag=GoingHome,limit=1] at @s run function retour
execute if entity @a[tag=GoingHome] run function target_retour
Adding target_retour function, you would complete all requests in one tick
Also is your retour function working?
I thought we had to run it as the armor stand, to keep it targetted...
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Oh, I didn't thought about make it in only 1 tick, thanks !
For the player rotation, I want to keep his rotation when he saved the position, not the position when he run the function !
Thanks anyways, I do it in 1 tick now !
So, here my commands :
1) tp.mcfunction
2) save.mcfunction
3) tp_back.mcfunction
4) every_tick.mcfunction
I like trains... OF CHAIN COMMAND BLOCKS !
I'm on my computer right now, gonna make the same system cause I'm yet not convinced lol (sorry about bothering you that much about this,,,)
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Uh ok never mind, I thought you wanted to keep player's rotation at the moment of the tp.
Just figured out you were keeping the rotation of when the player had sethome, not the moment before it teleports... dumb me...
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Oh don't worry, you absolutely don't bothering me, you helped me so much, if you have something that tickles you (Je sais pas si ça se dit, ça), just tell me !
At best I will learn something and at worse, I will not ^^
I like trains... OF CHAIN COMMAND BLOCKS !