Hi everyone. I have a lobby at lets say 50 0 50 I need there to be an easy way for anyone to get there from anywhere in the world. What the best way of doing this?
Let's think of this as like an "Escape Rope" in Pokemon. The user uses an item and get's teleported to the last Poke Center.
Let's rename a Lead to "Escape Rope" and give it some lore so people can't make these in an anvil:
/give @p minecraft:lead 1 0 {display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}
Now all you need to do is tag a player that has "used" the item, tp them, and remove the item.
Make an always active repeating command chain with these commands:
/scoreboard players tag @a[tag=escape] remove escape
/scoreboard players tag @a add escape {Inventory:{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}
Now if someone has any amount more than 1 stacked together when they press F, nothing will happen. If we didn't have this check, a player would lose the whole stack instead of just one. Otherwise, it will take the Escape Rope, and teleport them back to the lobby.
Let's think of this as like an "Escape Rope" in Pokemon. The user uses an item and get's teleported to the last Poke Center.
Let's rename a Lead to "Escape Rope" and give it some lore so people can't make these in an anvil:
/give @p minecraft:lead 1 0 {display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}
Now all you need to do is tag a player that has "used" the item, tp them, and remove the item.
Make an always active repeating command chain with these commands:
/scoreboard players tag @a[tag=escape] remove escape
/scoreboard players tag @a add escape {Inventory:{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}
Now if someone has any amount more than 1 stacked together when they press F, nothing will happen. If we didn't have this check, a player would lose the whole stack instead of just one. Otherwise, it will take the Escape Rope, and teleport them back to the lobby.
I don't understand how do you use the rope to get back to spawn? What will Pressing 'F' do?
is it a problem that i used lots of repeating command blocks instead of chain ones?
I used both chain and repeating and it didn't work. This was the out put of the command block holding this command:
/scoreboard players tag @a add escape {Inventory:{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}
The output: [01:33:15] The dataTag does not match for BluePC1
Hello? I had a lead in my off key inventory with a lore of "Press 'F' to warp to spawn!" I had this command in a repeating command block: Press 'F' to warp to spawn! But whenever I tested it it always came out with this output: The output: [01:33:15] The dataTag does not match for BluePC1
Sorry, I messed up the command, it should look like this:
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}]}
Sorry, I messed up the command, it should look like this:
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}]}
My pleasure. Also to answer your other question. This should all be connected to only one single repeating command block. The rest should all be unconditional chain commands with the arrows pointing to the next command.
Using multiple repeating command blocks is just bad practice, can cause unwanted lag, and is much more difficult to get the order of execution correct. It also makes it much harder for someone to figure out what you are even trying to do.
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}]}
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}]}
I'm not sure what could be going wrong, perhaps minecraft doesn't like the single quotes around the F? Try without them on the item and in the test and if it works, great. I'll eventually get around to physically trying this in game and get back to you probably later tonight or tomorrow.
In my experience the easiest way to do this is with triggers. It only takes 3 commands and is incredibly simple. First make a trigger scoreboard.
/scoreboard objectives add spawn trigger
This will create a scoreboard objective name `spawn` which can be edited by non-ops using the /trigger command.
If you have not used triggers before, here is a general run down:
Triggers are scoreboard objectives whose value can be edited by any player using the /trigger command. For a player to use the trigger, it must be enabled for them using `scoreboard players enable` and every time they use the trigger, it is disabled for them.
Now for the commands:
After making the trigger scoreboard, make a clock with these 3 commands in this order:
scoreboard players enable @a spawn
tp @a[score_spawn_min=1] X Y Z
scoreboard players set @a spawn 0
What this does is simple:
Firstly it enables the trigger for all users constantly. This way any player can use it at any time. When the player sets their score to 1 or above, they are tp-ed to the given coords. Then their score is set back to 0.
I'm not sure what could be going wrong, perhaps minecraft doesn't like the single quotes around the F? Try without them on the item and in the test and if it works, great. I'll eventually get around to physically trying this in game and get back to you probably later tonight or tomorrow.
The error is in the NBT you are trying to use. When using the Inventory list, the items data is not all stored in the root of the entry. It isn't the quotes. If you want to test for NBT using the Inventory list you need to use `tag:{}` and put the items data into that compound. The correct command is:
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,tag:{display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}]}
The error is in the NBT you are trying to use. When using the Inventory list, the items data is not all stored in the root of the entry. It isn't the quotes. If you want to test for NBT using the Inventory list you need to use `tag:{}` and put the items data into that compound. The correct command is:
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,tag:{display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}]}
Thank you very much! I will test this today. I think in the scenario that I have this problem the escape rope will be easyer to use. But thanks for teaching me how to use the /trigge command. I will probably use that some other time when I need it. Thanks!
Hi everyone. I have a lobby at lets say 50 0 50 I need there to be an easy way for anyone to get there from anywhere in the world. What the best way of doing this?
Use this command. "/tp @p 50 0 50".
This will instantly teleport the nearest player (or whoever's typing the command) to said location.
Replace @p with @a to target all players, @r to target a random player, and @e to target all the mobs in the world.
I think it should be
This will teleport the nearest player at 50 0 50 in the radius of 3 to a random player. You can change @r to @r[type=<Mob>] it's all up to you
Let's think of this as like an "Escape Rope" in Pokemon. The user uses an item and get's teleported to the last Poke Center.
Let's rename a Lead to "Escape Rope" and give it some lore so people can't make these in an anvil:
/give @p minecraft:lead 1 0 {display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}
Now all you need to do is tag a player that has "used" the item, tp them, and remove the item.
Make an always active repeating command chain with these commands:
/scoreboard players tag @a[tag=escape] remove escape
/scoreboard players tag @a add escape {Inventory:{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}
/replaceitem entity @a[tag=escape] slot.weapon.offhand minecraft:air
/tp @a[tag=escape] 50 0 50
Now if someone has any amount more than 1 stacked together when they press F, nothing will happen. If we didn't have this check, a player would lose the whole stack instead of just one. Otherwise, it will take the Escape Rope, and teleport them back to the lobby.
This is for my server and users of it can not use commands. Other wise i would have done something as simple as that.
I don't understand how do you use the rope to get back to spawn? What will Pressing 'F' do?
F is the default key to put an item in your offhand.
Oh I understand! Thanks
is it a problem that i used lots of repeating command blocks instead of chain ones?
I used both chain and repeating and it didn't work. This was the out put of the command block holding this command:
/scoreboard players tag @a add escape {Inventory:{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}}
The output: [01:33:15] The dataTag does not match for BluePC1
I don't get why it wasn't working?
Hello? I had a lead in my off key inventory with a lore of "Press 'F' to warp to spawn!" I had this command in a repeating command block: Press 'F' to warp to spawn! But whenever I tested it it always came out with this output: The output: [01:33:15] The dataTag does not match for BluePC1
Sorry, I messed up the command, it should look like this:
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}]}
Thanks So much! I'll test it soon.
My pleasure. Also to answer your other question. This should all be connected to only one single repeating command block. The rest should all be unconditional chain commands with the arrows pointing to the next command.
Using multiple repeating command blocks is just bad practice, can cause unwanted lag, and is much more difficult to get the order of execution correct. It also makes it much harder for someone to figure out what you are even trying to do.
Ok. Thanks so much!
I got this output:
[01:33:15] The dataTag does not match for BluePC1
With this command not working:
/scoreboard players tag @a add escape {Inventory:[{Slot:-106b,id:"minecraft:lead",Count:1b,display:{Name:"Escape Rope",Lore:["Press 'F' to warp to spawn!"]}}]}
I'm not sure what could be going wrong, perhaps minecraft doesn't like the single quotes around the F? Try without them on the item and in the test and if it works, great. I'll eventually get around to physically trying this in game and get back to you probably later tonight or tomorrow.
Thanks! I'll try it later today.
In my experience the easiest way to do this is with triggers. It only takes 3 commands and is incredibly simple. First make a trigger scoreboard.
This will create a scoreboard objective name `spawn` which can be edited by non-ops using the /trigger command.
If you have not used triggers before, here is a general run down:
Triggers are scoreboard objectives whose value can be edited by any player using the /trigger command. For a player to use the trigger, it must be enabled for them using `scoreboard players enable` and every time they use the trigger, it is disabled for them.
Now for the commands:
After making the trigger scoreboard, make a clock with these 3 commands in this order:
What this does is simple:
Firstly it enables the trigger for all users constantly. This way any player can use it at any time. When the player sets their score to 1 or above, they are tp-ed to the given coords. Then their score is set back to 0.
All a player needs to do is run this command;
and they will be teleported to coords.
The error is in the NBT you are trying to use. When using the Inventory list, the items data is not all stored in the root of the entry. It isn't the quotes. If you want to test for NBT using the Inventory list you need to use `tag:{}` and put the items data into that compound. The correct command is:
Thank you very much! I will test this today. I think in the scenario that I have this problem the escape rope will be easyer to use. But thanks for teaching me how to use the /trigge command. I will probably use that some other time when I need it. Thanks!