Portals
Portals teleport a player that enters the specified region to an exact location, by a certain offset amount or to a random location inside a region.
The position and direction attributes of a portal are relative to the players location and where they are looking.
Prefix these values with an at symbol @
to specify absolute values.
Portals can be restricted to certain teams by defining their filter attribute.
Portals respond to any player move event, this allows almost instant teleportation as soon as the player matches the portals filter.
Copy the yaw and pitch from the Debug screen (F3
) in Minecraft (the Facing: Direction (Axis) (Yaw/Pitch)
line).
Element | Description |
---|---|
<portals> </portals> | Node containing the portals on this map. |
Sub-elements | Value/Children | |
---|---|---|
<portal> | An individual portal node. | Portal Sub-elements |
Portal Attributes
Attribute | Description | Value | Default |
---|---|---|---|
x ,y ,z | Offset the players X,Y,Z position by the amount specified. | Number | |
region | PropertyRegion where this portals entrance is located. Cannot combine an entrance region with forward or transit properties. | Region | |
destination | PropertyDestination of the portal, teleports players to a random point inside the region. Cannot combine an exit region with reverse or transit properties. | Randomize-able Region | |
filter | PropertyFilter portal player access. | Filter | always |
sound | Play the portal sound. | true/false | true |
protect | Protect the portal entrance and exit regions. | true/false | false |
bidirectional | Creates a dual-linked portal that goes both ways. This can only be used when all coordinates and directions are relative. | true/false | false |
smooth | Smoothly teleport players. | true/false | false |
yaw | Specify the direction the player is looking horizontally from -180° to 180°. South 0°, East -90°, North 180°, and West 90°. | Number | |
pitch | Specify the direction the player is looking vertically from -90° to 90°. -90° is straight up, 90° is straight down. | Number | |
forward | PropertyApply forward transform on rising edge. | Dynamic Filter | |
reverse | PropertyApply reverse transform on rising edge. | Dynamic Filter | |
transit | PropertyApply forward transform on rising edge and reverse transform on falling edge. Cannot combine transit property with forward or reverse properties. | Dynamic Filter | |
observers | PropertyFilter portal observer access. | Filter |
Examples
<portals>
<!-- Moves the player to exactly X:10 Y:8 Z:45, pitch & yaw remain unchanged -->
<portal x="@10" y="@8" z="@45">
<region>
<cuboid min="-56,33,-1" max="-55,35,2"/>
</region>
</portal>
<!-- Adds 12 to the players Z position, turning them to face east and 10° up -->
<portal z="12" pitch="@10" yaw="@-90">
<region>
<cuboid min="-56,33,-1" max="-55,35,2"/>
</region>
</portal>
<!-- Teleport the player from portal-entrance to a random point inside portal-exit -->
<portal region="portal-entrance" destination="portal-exit"/>
<!-- Teleports players on the Red Team from score-box to red-spawn, facing west -->
<portal filter="only-red" yaw="@90" region="score-box" destination="red-spawn"/>
</portals>
Dynamic Portals
Dynamic portals are portals that use Dynamic Filters to determine who is allowed entrance to a portal. Dynamic portals will always track when a condition is met, rather than standard portals, which can only track when a condition is met at the moment a player enters the portal. This means that dynamic portals can, for example, immediately teleport players 10 minutes into a match.
In this example, the dynamic portal will teleport red players inside the red-rear
region
to the red-front
region five minutes into the match. Red players who enter and remain in the region
before the five minutes will still be teleported.
<portals>
<!-- A one-way (entrance to destination) Dynamic Portal -->
<!-- forward takes a dynamic filter as input -->
<portal forward="dynamic-filter-red" destination="red-front"/>
</portals>
<filters>
<all id="dynamic-filter-red">
<team>red-team</team>
<time>5m</time>
<!-- The entrance region is described inside the filter -->
<region id="red-rear"/>
</all>
</filters>
<regions>
<cuboid id="red-rear" min="10,20,30" max="15,25,35"/>
<cuboid id="red-front" min="50,20,30" max="55,25,35"/>
</regions>