In-game Name : NJ_Alpha
Discord Name: NJ_Alpha#2818
Teleportation:
Whether it’s for moderating your own world , or for gameplay purposes, Teleportation is very helpful.
This tutorial will teach you on how to code different kinds of teleportation.
1: Self- Teleportation
This type of teleportation basically allows you to choose your location of teleportation, and teleport
there.
Here is the step - by - step instructions on coding self-teleportation.
Player Event MOVE (Use this when you want to move on a block in order to activate the teleportation, like in
Parkours) or Player Event CHAT EVENT (Use this when you want a command to activate the
Teleportation, for moderation or other games.)
In the case of Right Click event:
If player is standing on block (Select block that will set the teleport location)
In the case of Chat Event:
If player message = (Select command that will set the teleport location)
SET VARIABLE =
On the topmost box, put a dynamic variable that says %player%_tplocation (the name can be anything)
Below that, on the huge box shown put a GAME variable and select Entity Values - Player Location.
With that, you have set your location. You can add an action bar message to show that the teleport location has been set , like (&eTeleport Location Set) (Optional)
You then need a way to TP to your selected location.
For Parkours, this is generally PLAYER EVENT RIGHT CLICK
If player is holding item (Select item that will initiate teleportation)
Player Action TELEPORT (Dynamic Variable %player%_tplocation (must be the same
variable as before))
In other cases , you can use the CHAT EVENT and use a special command to activate it.
(Optional) You can add a message that shows the successful teleportation.
And with that, we are done with the first type of Teleportation.
2:Teleporting to ANOTHER player
Now this is a different type of teleportation almost always used for moderation purposes.
I will provide the instructions as less complicated as possible.
PLAYER CHAT EVENT:
If player Name = (Insert you and other staff names)
If player Message = (Insert command, preferably @tpa or @teleport)
Game Action WAIT (1 Tick)
Set Variable =
Dynamic Var on top (%player%_tpnext?) for example
Book Var below (Yes) for example
Player action Title: (Optional but helpful)
On the Subtitle, write (Who do you want to teleport to?) but anything works.
Then, Type the accurate spelling of the player you want to TP to (In- Game after you perform the command)
SECOND:
PLAYER CHAT EVENT
If Variable =
Top : Dynamic Var (%player%_tpnext?)
Bottom: Book Var (Yes)
Set Variable :
Top: Dynamic Var (%player%_tpnext?)
Bottom: Book Var (NO)
Set Variable :
Top : Dynamic Var (%player%_tpname)
Bottom : Game Var ( Event Value ------) Player Message)
Game Action WAIT (1 Tick)
Select Players by Condition
If player Name = (%player%_tpname DYNAMIC VARIABLE)
Set Variable =
Top : Dynamic Variable (%player%_tpplayerloc for example)
Bottom : Game Variable (Entity Value ------) Player Location)
Teleport DEFAULT
Dynamic Variable (%player%_tpplayerloc)
(Optional) Send Action Bar message (Selection)
“%default has teleported to you!”
(Optional) Send Action Bar Message (Default)
“Successfully Teleported!”
Hope these 2 codes help you!
Bye