The Meaning of Life, the Universe, and Everything.
Join Date:
12/25/2017
Posts:
47
Member Details
The title covers most of it.
I need a command to stop a specific person from entering a radius. Lets call this player 'Bob'. I need Bob to not be able to entering an area.
I have tried clock running into '/testfor Bob [r=2]' and run that into a comparator, to tp them elsewhere, yet that didnt work. I also tried /execute @e[type=Bob] ~ ~ ~ /testfor @a[r=2] yet that would find entities with that name, not players.
All help is appreciated
Rollback Post to RevisionRollBack
Minecraft Command Artist
And when it comes to art, there's only happy little mistakes.
After seeing this, I decided to play around and attempt to create something like this with pretty good results actually. It almost works just like a barrier.
I have it set up so if you get within range, it will rubberband you back to your xprevious and zprevious positions.
first I created an invisible, invulnerable, marker, NoGravity, custom named "Oldpos" to mark the player's previous position.
The idea is to teleport the player to the armor stand if within range, which should be a tick behind in position from the player at the time as long as the armor stand's position is updated last in the tick.
on a repeating command block: in 1.13
/execute as @p[distance=..5] at @s as @e[name=Oldpos] at @s run tp @p ~ ~ ~
or in 1.12:
/execute @p[r=5] ~ ~ ~ tp @s @e[name=Oldpos]
(or something like that, I'll need to check. It's been some time since I worked with 1.12.2 commands)
On an unconditional, always on chain command block linked to the repeating block in 1.13:
/execute as @p at @p run teleport @e[name=Oldpos] ~ ~ ~
or 1.12.2:
/tp @e[name=Oldpos] @p
If you accidentally end up with this on with Oldpos also in range, you will get stuck, and will need to manually teleport Oldpos away
also, this would be for single player.
you would have to adjust it for multiplayer to have player create the armor stand, and be more specific in the player targeting.
The title covers most of it.
I need a command to stop a specific person from entering a radius. Lets call this player 'Bob'. I need Bob to not be able to entering an area.
I have tried clock running into '/testfor Bob [r=2]' and run that into a comparator, to tp them elsewhere, yet that didnt work. I also tried /execute @e[type=Bob] ~ ~ ~ /testfor @a[r=2] yet that would find entities with that name, not players.
All help is appreciated
Minecraft Command Artist
And when it comes to art, there's only happy little mistakes.
After seeing this, I decided to play around and attempt to create something like this with pretty good results actually. It almost works just like a barrier.
I have it set up so if you get within range, it will rubberband you back to your xprevious and zprevious positions.
first I created an invisible, invulnerable, marker, NoGravity, custom named "Oldpos" to mark the player's previous position.
The idea is to teleport the player to the armor stand if within range, which should be a tick behind in position from the player at the time as long as the armor stand's position is updated last in the tick.
on a repeating command block: in 1.13
or in 1.12:
(or something like that, I'll need to check. It's been some time since I worked with 1.12.2 commands)
On an unconditional, always on chain command block linked to the repeating block in 1.13:
or 1.12.2:
If you accidentally end up with this on with Oldpos also in range, you will get stuck, and will need to manually teleport Oldpos away
also, this would be for single player.
you would have to adjust it for multiplayer to have player create the armor stand, and be more specific in the player targeting.
You might be happy to know i solved it out after hours if trying. I eventually started to add pieces from different forums to get the attached image.
Minecraft Command Artist
And when it comes to art, there's only happy little mistakes.