Skip to content

Commit eea1fcd

Browse files
authored
Clarify Create Virtual WorldBorder docs and behavior (SkriptLang#7838)
1 parent 2a9f923 commit eea1fcd

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

src/main/java/ch/njol/skript/expressions/ExprSecCreateWorldBorder.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import ch.njol.skript.lang.SkriptParser.ParseResult;
1212
import ch.njol.skript.registrations.EventValues;
1313
import ch.njol.skript.variables.Variables;
14+
import ch.njol.skript.doc.Example;
1415
import ch.njol.util.Kleenean;
1516
import org.bukkit.Bukkit;
1617
import org.bukkit.WorldBorder;
@@ -23,16 +24,25 @@
2324
import java.util.concurrent.atomic.AtomicBoolean;
2425

2526
@Name("Create WorldBorder")
26-
@Description("Create a virtual worldborder. You can make this a real border by setting a world's worldborder to a virtual border.")
27-
@Examples({
28-
"set player's worldborder to a virtual worldborder",
29-
"",
30-
"on join:",
31-
"\tset {_border} to a worldborder:",
32-
"\t\tset worldborder radius to 25",
33-
"\t\tset worldborder warning distance of event-worldborder to 5",
34-
"\tset worldborder of player to {_border}"
27+
@Description({
28+
"Creates a new, unused world border. World borders can be assigned to either worlds or specific players.",
29+
"Borders assigned to worlds apply to all players in that world.",
30+
"Borders assigned to players apply only to those players, and different players can have different borders."
3531
})
32+
@Example("""
33+
on join:
34+
set {_location} to location of player
35+
set worldborder of player to a virtual worldborder:
36+
set worldborder radius to 25
37+
set world border center of event-worldborder to {_location}
38+
""")
39+
@Example("""
40+
on load:
41+
set worldborder of world "world" to a worldborder:
42+
set worldborder radius of event-worldborder to 200
43+
set worldborder center of event-worldborder to location(0, 64, 0)
44+
set worldborder warning distance of event-worldborder to 5
45+
""")
3646
@Since("2.11")
3747
public class ExprSecCreateWorldBorder extends SectionExpression<WorldBorder> {
3848

@@ -80,7 +90,7 @@ public Class<WorldBorder> getReturnType() {
8090

8191
@Override
8292
public String toString(@Nullable Event event, boolean debug) {
83-
return "a worldborder";
93+
return "a virtual worldborder";
8494
}
8595

8696
public static class CreateWorldborderEvent extends Event {

0 commit comments

Comments
 (0)