Skip to content

Commit 0b1124c

Browse files
bluelhfsovdeeth
andcommitted
fix(docs): improvements to examples
applies changes from code review Co-authored-by: sovde <10354869+sovdeeth@users.noreply.github.com>
1 parent 7b66b26 commit 0b1124c

14 files changed

Lines changed: 47 additions & 58 deletions

src/main/java/ch/njol/skript/conditions/CondChatFiltering.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@Description("Checks whether a player has chat filtering enabled.")
1111
@Example("""
1212
if player doesn't have chat filtering enabled:
13-
send "<gray>This server may contain mature chat messages. You have been warned!" to player
13+
send "<gray>This server may contain mature chat messages. You have been warned!" to player
1414
""")
1515
@Since("2.10")
1616
public class CondChatFiltering extends PropertyCondition<Player> {

src/main/java/ch/njol/skript/conditions/CondElytraBoostConsume.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@Example("""
1616
on elytra boost:
1717
if the used firework will be consumed:
18-
prevent the used firework from being consume
18+
prevent the used firework from being consumed
1919
""")
2020
@Since("2.10")
2121
public class CondElytraBoostConsume extends Condition {

src/main/java/ch/njol/skript/effects/EffExit.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919

2020
@Name("Exit")
2121
@Description("Exits a given amount of loops and conditionals, or the entire trigger.")
22-
@Example("""
23-
if player has any ore:
24-
stop
25-
message "%player% has no ores!"
26-
""")
2722
@Example("""
2823
loop blocks above the player:
2924
loop-block is not air:

src/main/java/ch/njol/skript/effects/EffToggleCanPickUpItems.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@Example("send \"You can no longer pick up items!\" to player")
2020
@Example("""
2121
on drop:
22-
if player can't pick up items:
22+
if player can't pick up items:
2323
allow player to pick up items
2424
""")
2525
@Since("2.8.0")

src/main/java/ch/njol/skript/effects/EffTransform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
""")
4646
@Example("""
4747
# set all existing values of a list to 0:
48-
transform {_list::*} to 0
48+
transform {_list::*} with 0
4949
""")
5050
@Since("2.10")
5151
@Keywords("input")

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
"e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned."
2828
})
2929
@Example("""
30-
# Set targeted crop to fully grown crop
31-
set age of targeted block to maximum age of targeted block
32-
""")
30+
# Set targeted crop to fully grown crop
31+
set age of targeted block to maximum age of targeted block
32+
""")
3333
@Example("""
34-
# Spawn a baby cow that will only need 1 minute to become an adult
35-
spawn a baby cow at player
36-
set age of last spawned entity to -1200 # in ticks = 60 seconds
37-
""")
34+
# Spawn a baby cow that will only need 1 minute to become an adult
35+
spawn a baby cow at player
36+
set age of last spawned entity to -1200 # in ticks = 60 seconds
37+
""")
3838
@Since("2.7")
3939
public class ExprAge extends SimplePropertyExpression<Object, Integer> {
4040

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
@Name("Character Codepoint")
1414
@Description("Returns the Unicode codepoint of a character")
1515
@Example("""
16-
function is_in_order(letters: strings) :: boolean:
17-
loop {_letters::*}:
18-
set {_codepoint} to codepoint of lowercase loop-value
16+
function is_in_order(letters: strings) :: boolean:
17+
loop {_letters::*}:
18+
set {_codepoint} to codepoint of lowercase loop-value
1919
20-
return false if {_codepoint} is not set # 'loop-value is not a single character'
20+
return false if {_codepoint} is not set # 'loop-value is not a single character'
2121
22-
if:
23-
{_previous-codepoint} is set
24-
# if the codepoint of the current character is not
25-
# 1 more than the codepoint of the previous character
26-
# then the letters are not in order
27-
{_codepoint} - {_previous-codepoint} is not 1
28-
then:
29-
return false
22+
if:
23+
{_previous-codepoint} is set
24+
# if the codepoint of the current character is not
25+
# 1 more than the codepoint of the previous character
26+
# then the letters are not in order
27+
{_codepoint} - {_previous-codepoint} is not 1
28+
then:
29+
return false
3030
31-
set {_previous-codepoint} to {_codepoint}
32-
return true
31+
set {_previous-codepoint} to {_codepoint}
32+
return true
3333
""")
3434
@Since("2.9.0")
3535
public class ExprCodepoint extends SimplePropertyExpression<String, Integer> {

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
@Example("command \"op\"'s permission message")
4242
@Example("command \"sk\"'s plugin owner")
4343
@Example("""
44-
command /greet <player>:
45-
usage: /greet <target>
46-
trigger:
47-
if arg-1 is sender:
48-
send "&cYou can't greet yourself! Usage: %the usage%"
49-
stop
50-
send "%sender% greets you!" to arg-1
51-
send "You greeted %arg-1%!"
52-
""")
44+
command /greet <player>:
45+
usage: /greet <target>
46+
trigger:
47+
if arg-1 is sender:
48+
send "&cYou can't greet yourself! Usage: %the usage%"
49+
stop
50+
send "%sender% greets you!" to arg-1
51+
send "You greeted %arg-1%!"
52+
""")
5353
@Since("2.6")
5454
public class ExprCommandInfo extends SimpleExpression<String> {
5555

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"As of Minecraft 1.21.4, the compass is controlled by the resource pack and by default will not point to " +
2121
"this compass target when used outside of the overworld dimension."})
2222
@Example("""
23-
# make all player's compasses target a player stored in {compass::target::%player%}
24-
every 5 seconds:
25-
loop all players:
26-
set the loop-player's compass target to location of {compass::target::%%loop-player%}
23+
# make all player's compasses target a player stored in {compass::target::%player%}
24+
every 5 seconds:
25+
loop all players:
26+
set the loop-player's compass target to location of {compass::target::%%loop-player%}
2727
""")
2828
@Since("2.0")
2929
public class ExprCompassTarget extends SimplePropertyExpression<Player, Location> {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0)."
2424
})
2525
@Example("""
26-
function domesticateAndTame(horse: entity, p: offline player, i: int = 10):
27-
add {_i} to domestication level of {_horse}
28-
if domestication level of {_horse} >= max domestication level of {_horse}:
29-
tame {_horse}
30-
set tamer of {_horse} to {_p}
31-
""")
26+
function domesticateAndTame(horse: entity, p: offline player, i: int = 10):
27+
add {_i} to domestication level of {_horse}
28+
if domestication level of {_horse} >= max domestication level of {_horse}:
29+
tame {_horse}
30+
set tamer of {_horse} to {_p}
31+
""")
3232
@Since("2.10")
3333
public class ExprDomestication extends SimplePropertyExpression<LivingEntity, Integer> {
3434

0 commit comments

Comments
 (0)