Skip to content

Commit

Permalink
Examples Update (SkriptLang#6510)
Browse files Browse the repository at this point in the history
* ExprAnvilText - fix docs

* DefaultFunctions - better location examples

---------

Co-authored-by: Moderocky <[email protected]>
  • Loading branch information
ShaneBeee and Moderocky authored Mar 26, 2024
1 parent a44ed2f commit 7a79d87
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions src/main/java/ch/njol/skript/classes/data/DefaultFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,28 @@ public Location[] execute(FunctionEvent<?> e, Object[][] params) {
}
}.description("Creates a location from a world and 3 coordinates, with an optional yaw and pitch.",
"If for whatever reason the world is not found, it will fallback to the server's main world.")
.examples("location(0, 128, 0)",
"location(player's x-coordinate, player's y-coordinate + 5, player's z-coordinate, player's world, 0, 90)",
"location(0, 64, 0, world \"world_nether\")",
"location(100, 110, -145, world(\"my_custom_world\"))")
.examples("# TELEPORTING",
"teleport player to location(1,1,1, world \"world\")",
"teleport player to location(1,1,1, world \"world\", 100, 0)",
"teleport player to location(1,1,1, world \"world\", yaw of player, pitch of player)",
"teleport player to location(1,1,1, world of player)",
"teleport player to location(1,1,1, world(\"world\"))",
"teleport player to location({_x}, {_y}, {_z}, {_w}, {_yaw}, {_pitch})",
"# SETTING BLOCKS",
"set block at location(1,1,1, world \"world\") to stone",
"set block at location(1,1,1, world \"world\", 100, 0) to stone",
"set block at location(1,1,1, world of player) to stone",
"set block at location(1,1,1, world(\"world\")) to stone",
"set block at location({_x}, {_y}, {_z}, {_w}) to stone",
"# USING VARIABLES",
"set {_l1} to location(1,1,1)",
"set {_l2} to location(10,10,10)",
"set blocks within {_l1} and {_l2} to stone",
"if player is within {_l1} and {_l2}:",
"# OTHER",
"kill all entities in radius 50 around location(1,65,1, world \"world\")",
"delete all entities in radius 25 around location(50,50,50, world \"world_nether\")",
"ignite all entities in radius 25 around location(1,1,1, world of player)")
.since("2.2"));

Functions.registerFunction(new SimpleJavaFunction<Date>("date", new Parameter[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Examples({
"on inventory click:",
"\ttype of event-inventory is anvil inventory",
"\tif the anvil input text of the event-inventory is \"FREE OP\":",
"\tif the anvil text input of the event-inventory is \"FREE OP\":",
"\t\tban player"
})
@Since("2.7")
Expand Down

0 comments on commit 7a79d87

Please sign in to comment.