Skip to content

Commit

Permalink
Fix example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus committed Jan 13, 2025
1 parent 377e7c1 commit 5afa624
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/scripts/-examples/commands.sk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ command /home <text> [<text>]:

aliases:
# Creates an alias `blacklisted` for this list of items.
blacklisted = TNT, bedrock, obsidian, mob spawner, lava, lava bucket
blacklisted = TNT, bedrock, obsidian, spawner, lava, lava bucket

command /item <items>:
description: Give yourself some items.
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/scripts/-examples/functions.sk
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ command /appleexample:
# Please note that self-calling functions can loop infinitely, so use with caution.
#

function destroyOre(source: block) :: blocks:
function destroyGold(source: block) :: blocks:
add {_source} to {_found::*}
break {_source} naturally using an iron pickaxe
loop blocks in radius 1 of {_source}:
loop-block is any ore
loop-block is tagged as minecraft block tag "gold_ores"
break loop-block naturally using an iron pickaxe
if {_found::*} does not contain loop-block:
add destroyOre(loop-block) to {_found::*}
add destroyGold(loop-block) to {_found::*}
return {_found::*}

command /oreexample:
permission: skript.example.ore
trigger:
if player's target block is any ore:
if the player's target block is tagged as minecraft block tag "gold_ores":
send "Destroying all connected ore."
set {_found::*} to destroyOre(player's target block)
set {_found::*} to destroyGold(player's target block)
send "Destroyed %size of {_found::*}% connected ores!"
else:
send "<red>You must be looking at an ore block!"
2 changes: 1 addition & 1 deletion src/main/resources/scripts/-examples/loops.sk
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ command /anotherloopexample:

loop blocks in radius 2 of player:
loop-block is a chest
loop items of types ore and log: # Loop-block comes from the first loop, loop-item from the second.
loop the tag contents of minecraft item tag "logs": # Loop-block comes from the first loop, loop-item from the second.
inventory of loop-block contains loop-item
remove loop-item from the inventory of loop-block
send "Destroyed a %loop-item%!"
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/scripts/-examples/options and meta.sk
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ on join:
#

variables:
score::%player% = 100
some variable = "Hello"
{score::%player%} = 100
{some variable} = "Hello"

command /variabletest:
permission: skript.example.variables
Expand Down

0 comments on commit 5afa624

Please sign in to comment.