diff --git a/src/main/java/ch/njol/skript/conditions/CondAI.java b/src/main/java/ch/njol/skript/conditions/CondAI.java index 960ef2cb0d4..da7c896917b 100644 --- a/src/main/java/ch/njol/skript/conditions/CondAI.java +++ b/src/main/java/ch/njol/skript/conditions/CondAI.java @@ -4,13 +4,13 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Has AI") @Description("Checks whether an entity has AI.") -@Examples("target entity has ai") +@Example("target entity has ai") @Since("2.5") public class CondAI extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondAllayCanDuplicate.java b/src/main/java/ch/njol/skript/conditions/CondAllayCanDuplicate.java index 8262c34a6cf..683ee6b78f8 100644 --- a/src/main/java/ch/njol/skript/conditions/CondAllayCanDuplicate.java +++ b/src/main/java/ch/njol/skript/conditions/CondAllayCanDuplicate.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Allay; @@ -10,10 +10,10 @@ @Name("Allay Can Duplicate") @Description("Checks to see if an allay is able to duplicate naturally.") -@Examples({ - "if last spawned allay can duplicate:", - "\tdisallow last spawned to duplicate" -}) +@Example(""" + if last spawned allay can duplicate: + disallow last spawned to duplicate + """) @Since("2.11") public class CondAllayCanDuplicate extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondAlphanumeric.java b/src/main/java/ch/njol/skript/conditions/CondAlphanumeric.java index f20e7467bd5..dc1e0f91243 100644 --- a/src/main/java/ch/njol/skript/conditions/CondAlphanumeric.java +++ b/src/main/java/ch/njol/skript/conditions/CondAlphanumeric.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -18,8 +18,10 @@ @Name("Alphanumeric") @Description({"Checks if the given string is alphanumeric."}) -@Examples({"if the argument is not alphanumeric:", - " send \"Invalid name!\""}) +@Example(""" + if the argument is not alphanumeric: + send "Invalid name!" + """) @Since("2.4") public class CondAlphanumeric extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondAnchorWorks.java b/src/main/java/ch/njol/skript/conditions/CondAnchorWorks.java index 783f85085e5..0f1b51b8363 100644 --- a/src/main/java/ch/njol/skript/conditions/CondAnchorWorks.java +++ b/src/main/java/ch/njol/skript/conditions/CondAnchorWorks.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -16,7 +16,7 @@ @Name("Do Respawn Anchors Work") @Description("Checks whether or not respawn anchors work in a world.") -@Examples("respawn anchors work in world \"world_nether\"") +@Example("respawn anchors work in world \"world_nether\"") @RequiredPlugins("Minecraft 1.16+") @Since("2.7") public class CondAnchorWorks extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondCanFly.java b/src/main/java/ch/njol/skript/conditions/CondCanFly.java index 8dd1a201854..5a4c248a0e6 100644 --- a/src/main/java/ch/njol/skript/conditions/CondCanFly.java +++ b/src/main/java/ch/njol/skript/conditions/CondCanFly.java @@ -4,13 +4,13 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Can Fly") @Description("Whether a player is allowed to fly.") -@Examples("player can fly") +@Example("player can fly") @Since("2.3") public class CondCanFly extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondCanHold.java b/src/main/java/ch/njol/skript/conditions/CondCanHold.java index bfbcd70af9e..dd377b9818d 100644 --- a/src/main/java/ch/njol/skript/conditions/CondCanHold.java +++ b/src/main/java/ch/njol/skript/conditions/CondCanHold.java @@ -10,7 +10,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -25,8 +25,8 @@ */ @Name("Can Hold") @Description("Tests whether a player or a chest can hold the given item.") -@Examples({"block can hold 200 cobblestone", - "player has enough space for 64 feathers"}) +@Example("block can hold 200 cobblestone") +@Example("player has enough space for 64 feathers") @Since("1.0") public class CondCanHold extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java b/src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java index 1bfb6d0aeac..17b0b82d8e9 100644 --- a/src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java +++ b/src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java @@ -2,21 +2,22 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @Name("Can Pick Up Items") @Description("Whether living entities are able to pick up items off the ground or not.") -@Examples({ - "if player can pick items up:", - "\tsend \"You can pick up items!\" to player", - "", - "on drop:", - "\tif player can't pick up items:", - "\t\tsend \"Be careful, you won't be able to pick that up!\" to player" -}) +@Example(""" + if player can pick items up: + send "You can pick up items!" to player + """) +@Example(""" + on drop: + if player can't pick up items: + send "Be careful, you won't be able to pick that up!" to player + """) @Since("2.8.0") public class CondCanPickUpItems extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondCanSee.java b/src/main/java/ch/njol/skript/conditions/CondCanSee.java index 0cc4b2359e1..1000dfc46c0 100644 --- a/src/main/java/ch/njol/skript/conditions/CondCanSee.java +++ b/src/main/java/ch/njol/skript/conditions/CondCanSee.java @@ -15,13 +15,14 @@ @Name("Can See") @Description("Checks whether the given players can see the provided entities.") -@Examples({ - "if sender can't see the player-argument:", - "\tmessage \"who dat?\"", - "", - "if the player can see the last spawned entity:", - "\tmessage \"hello there!\"" -}) +@Example(""" + if sender can't see the player-argument: + message "who dat?" + """) +@Example(""" + if the player can see the last spawned entity: + message "hello there!" + """) @Since("2.3, 2.10 (entities)") @RequiredPlugins("Minecraft 1.19+ (entities)") public class CondCanSee extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondCancelled.java b/src/main/java/ch/njol/skript/conditions/CondCancelled.java index 29e98ae3c54..7096d814bac 100644 --- a/src/main/java/ch/njol/skript/conditions/CondCancelled.java +++ b/src/main/java/ch/njol/skript/conditions/CondCancelled.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -15,10 +15,11 @@ @Name("Event Cancelled") @Description("Checks whether or not the event is cancelled.") -@Examples({"on click:", - "\tif event is cancelled:", - "\t\tbroadcast \"no clicks allowed!\"" -}) +@Example(""" + on click: + if event is cancelled: + broadcast "no clicks allowed!" + """) @Since("2.2-dev36") public class CondCancelled extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondChance.java b/src/main/java/ch/njol/skript/conditions/CondChance.java index 1b2326adafb..0bf1ac8541d 100644 --- a/src/main/java/ch/njol/skript/conditions/CondChance.java +++ b/src/main/java/ch/njol/skript/conditions/CondChance.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -19,10 +19,12 @@ @Name("Chance") @Description({"A condition that randomly succeeds or fails.", "Valid values are between 0% and 100%, or if the percent sign is omitted between 0 and 1."}) -@Examples({"chance of 50%:", - "\tdrop a diamond", - "chance of {chance}% # {chance} between 0 and 100", - "chance of {chance} # {chance} between 0 and 1"}) +@Example(""" + chance of 50%: + drop a diamond + """) +@Example("chance of {chance}% # {chance} between 0 and 100") +@Example("chance of {chance} # {chance} between 0 and 1") @Since("1.0") public class CondChance extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondChatColors.java b/src/main/java/ch/njol/skript/conditions/CondChatColors.java index 556f9814a66..05023b1a800 100644 --- a/src/main/java/ch/njol/skript/conditions/CondChatColors.java +++ b/src/main/java/ch/njol/skript/conditions/CondChatColors.java @@ -8,12 +8,12 @@ @Name("Can See Chat Colors") @Description("Checks whether a player can see chat colors.") -@Examples({ - "if player can see chat colors:", - "\tsend \"Find the red word in this message.\"", - "else:", - "\tsend \"You cannot partake in finding the colored word.\"" -}) +@Example(""" + if player can see chat colors: + send "Find the red word in this message." + else: + send "You cannot partake in finding the colored word." + """) @Since("2.10") public class CondChatColors extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondChatFiltering.java b/src/main/java/ch/njol/skript/conditions/CondChatFiltering.java index 5d38c8fcf3f..34148cd069f 100644 --- a/src/main/java/ch/njol/skript/conditions/CondChatFiltering.java +++ b/src/main/java/ch/njol/skript/conditions/CondChatFiltering.java @@ -8,11 +8,10 @@ @Name("Has Chat Filtering") @Description("Checks whether a player has chat filtering enabled.") -@Examples({ - "if player doesn't have chat filtering enabled:", - "send \"This server may contain mature chat messages. You have been warned!\" to player", -}) - +@Example(""" + if player doesn't have chat filtering enabled: + send "This server may contain mature chat messages. You have been warned!" to player + """) @Since("2.10") public class CondChatFiltering extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondChatVisibility.java b/src/main/java/ch/njol/skript/conditions/CondChatVisibility.java index 00be4a99c6c..906f2911440 100644 --- a/src/main/java/ch/njol/skript/conditions/CondChatVisibility.java +++ b/src/main/java/ch/njol/skript/conditions/CondChatVisibility.java @@ -13,14 +13,18 @@ @Name("Can See Messages") @Description("Checks whether a player can see specific message types in chat.") -@Examples({ - "if player can see all messages:", - "\tsend \"You can see all messages.\"", - "if player can only see commands:", - "\tsend \"This game doesn't work with commands-only chat.\"", - "if player can't see any messages:", - "\tsend action bar \"Server shutting down in 5 minutes!\"" -}) +@Example(""" + if player can see all messages: + send "You can see all messages." + """) +@Example(""" + if player can only see commands: + send "This game doesn't work with commands-only chat." + """) +@Example(""" + if player can't see any messages: + send action bar "Server shutting down in 5 minutes!" + """) @Since("2.10") public class CondChatVisibility extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondCompare.java b/src/main/java/ch/njol/skript/conditions/CondCompare.java index b7ec5aee9c7..567faea6e76 100644 --- a/src/main/java/ch/njol/skript/conditions/CondCompare.java +++ b/src/main/java/ch/njol/skript/conditions/CondCompare.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.ClassInfo; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -38,9 +38,9 @@ "Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, " + "but with (was|were) or will be instead of (is|are) respectively, " + "which check different time states of the first expression."}) -@Examples({"the clicked block is a stone slab or a double stone slab", - "time in the player's world is greater than 8:00", - "the creature is not an enderman or an ender dragon"}) +@Example("the clicked block is a stone slab or a double stone slab") +@Example("time in the player's world is greater than 8:00") +@Example("the creature is not an enderman or an ender dragon") @Since("1.0") public class CondCompare extends Condition implements VerboseAssert { diff --git a/src/main/java/ch/njol/skript/conditions/CondContains.java b/src/main/java/ch/njol/skript/conditions/CondContains.java index 95b5f0646fc..cfcbec97576 100644 --- a/src/main/java/ch/njol/skript/conditions/CondContains.java +++ b/src/main/java/ch/njol/skript/conditions/CondContains.java @@ -4,7 +4,7 @@ import ch.njol.skript.SkriptConfig; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -38,9 +38,9 @@ @Description("Checks whether an inventory contains an item, a text contains another piece of text, " + "a container contains something, " + "or a list (e.g. {list variable::*} or 'drops') contains another object.") -@Examples({"block contains 20 cobblestone", - "player has 4 flint and 2 iron ingots", - "{list::*} contains 5"}) +@Example("block contains 20 cobblestone") +@Example("player has 4 flint and 2 iron ingots") +@Example("{list::*} contains 5") @Since("1.0") @Deprecated(since="2.13", forRemoval = true) public class CondContains extends Condition implements VerboseAssert { diff --git a/src/main/java/ch/njol/skript/conditions/CondDamageCause.java b/src/main/java/ch/njol/skript/conditions/CondDamageCause.java index 62733ab3dbe..492a0ba702c 100644 --- a/src/main/java/ch/njol/skript/conditions/CondDamageCause.java +++ b/src/main/java/ch/njol/skript/conditions/CondDamageCause.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -20,19 +20,23 @@ */ @Name("Damage Cause") @Description("Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.") -@Examples({"# make players use their potions of fire resistance whenever they take any kind of fire damage", - "on damage:", - "\tdamage was caused by lava, fire or burning", - "\tvictim is a player", - "\tvictim has a potion of fire resistance", - "\tcancel event", - "\tapply fire resistance to the victim for 30 seconds", - "\tremove 1 potion of fire resistance from the victim", - "# prevent mobs from dropping items under certain circumstances", - "on death:", - "\tentity is not a player", - "\tdamage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison", - "\tclear drops"}) +@Example(""" + # make players use their potions of fire resistance whenever they take any kind of fire damage + on damage: + damage was caused by lava, fire or burning + victim is a player + victim has a potion of fire resistance + cancel event + apply fire resistance to the victim for 30 seconds + remove 1 potion of fire resistance from the victim + """) +@Example(""" + # prevent mobs from dropping items under certain circumstances + on death: + entity is not a player + damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison + clear drops + """) @Since("2.0") public class CondDamageCause extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondDate.java b/src/main/java/ch/njol/skript/conditions/CondDate.java index 88b0086b596..f5d3192c7ca 100644 --- a/src/main/java/ch/njol/skript/conditions/CondDate.java +++ b/src/main/java/ch/njol/skript/conditions/CondDate.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -22,13 +22,15 @@ */ @Name("Time") @Description("Tests whether a given real time was more or less than some time span ago.") -@Examples({"command /command-with-cooldown:", - " trigger:", - " {command::%player's uuid%::last-usage} was less than a minute ago:", - " message \"Please wait a minute between uses of this command.\"", - " stop", - " set {command::%player's uuid%::last-usage} to now", - " # ... actual command trigger here ..."}) +@Example(""" + command /command-with-cooldown: + trigger: + {command::%player's uuid%::last-usage} was less than a minute ago: + message "Please wait a minute between uses of this command." + stop + set {command::%player's uuid%::last-usage} to now + # ... actual command trigger here ... + """) @Since("2.0") public class CondDate extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondElytraBoostConsume.java b/src/main/java/ch/njol/skript/conditions/CondElytraBoostConsume.java index c5610a84775..fb3d079d0ac 100644 --- a/src/main/java/ch/njol/skript/conditions/CondElytraBoostConsume.java +++ b/src/main/java/ch/njol/skript/conditions/CondElytraBoostConsume.java @@ -12,11 +12,11 @@ @Name("Will Consume Boosting Firework") @Description("Checks to see if the firework used in an 'elytra boost' event will be consumed.") -@Examples({ - "on elytra boost:", - "\tif the used firework will be consumed:", - "\t\tprevent the used firework from being consume" -}) +@Example(""" + on elytra boost: + if the used firework will be consumed: + prevent the used firework from being consumed + """) @Since("2.10") public class CondElytraBoostConsume extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondEndermanStaredAt.java b/src/main/java/ch/njol/skript/conditions/CondEndermanStaredAt.java index c8aea698e2a..1981403325e 100644 --- a/src/main/java/ch/njol/skript/conditions/CondEndermanStaredAt.java +++ b/src/main/java/ch/njol/skript/conditions/CondEndermanStaredAt.java @@ -11,7 +11,7 @@ "Checks to see if an enderman has been stared at.", "This will return true as long as the entity that stared at the enderman is still alive." }) -@Examples("if last spawned enderman has been stared at:") +@Example("if last spawned enderman has been stared at:") @Since("2.11") public class CondEndermanStaredAt extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondEntityIsInLiquid.java b/src/main/java/ch/njol/skript/conditions/CondEntityIsInLiquid.java index e32e09ab57a..2ff2ad6d963 100644 --- a/src/main/java/ch/njol/skript/conditions/CondEntityIsInLiquid.java +++ b/src/main/java/ch/njol/skript/conditions/CondEntityIsInLiquid.java @@ -10,12 +10,10 @@ @Name("Entity is in Liquid") @Description("Checks whether an entity is in rain, lava, water or a bubble column.") -@Examples({ - "if player is in rain:", - "if player is in water:", - "player is in lava:", - "player is in bubble column" -}) +@Example("if player is in rain:") +@Example("if player is in water:") +@Example("player is in lava:") +@Example("player is in bubble column") @Since("2.6.1") public class CondEntityIsInLiquid extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondEntityIsWet.java b/src/main/java/ch/njol/skript/conditions/CondEntityIsWet.java index bbc27bc5c71..f61a10d71ed 100644 --- a/src/main/java/ch/njol/skript/conditions/CondEntityIsWet.java +++ b/src/main/java/ch/njol/skript/conditions/CondEntityIsWet.java @@ -7,7 +7,7 @@ @Name("Entity is Wet") @Description("Checks whether an entity is wet or not (in water, rain or a bubble column).") -@Examples("if player is wet:") +@Example("if player is wet:") @Since("2.6.1") public class CondEntityIsWet extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondEntityStorageIsFull.java b/src/main/java/ch/njol/skript/conditions/CondEntityStorageIsFull.java index 2acdf61f85b..62c95744f9a 100644 --- a/src/main/java/ch/njol/skript/conditions/CondEntityStorageIsFull.java +++ b/src/main/java/ch/njol/skript/conditions/CondEntityStorageIsFull.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,10 +17,10 @@ @Name("Entity Storage Is Full") @Description("Checks to see if the an entity block storage (i.e beehive) is full.") -@Examples({ - "if the entity storage of {_beehive} is full:", - "\trelease the entity storage of {_beehive}" -}) +@Example(""" + if the entity storage of {_beehive} is full: + release the entity storage of {_beehive} + """) @Since("2.11") public class CondEntityStorageIsFull extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondEntityUnload.java b/src/main/java/ch/njol/skript/conditions/CondEntityUnload.java index 34be7453c0c..d37264f0fb5 100644 --- a/src/main/java/ch/njol/skript/conditions/CondEntityUnload.java +++ b/src/main/java/ch/njol/skript/conditions/CondEntityUnload.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @@ -13,10 +13,10 @@ "More information on what and when entities despawn can be found at " + "reference." }) -@Examples({ - "if last spawned entity can despawn on chunk unload:", - "\tmake last spawned entity not despawn on chunk unload" -}) +@Example(""" + if last spawned entity can despawn on chunk unload: + make last spawned entity not despawn on chunk unload + """) @Since("2.11") public class CondEntityUnload extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondFromMobSpawner.java b/src/main/java/ch/njol/skript/conditions/CondFromMobSpawner.java index df87f227b20..a64fd7c83d1 100644 --- a/src/main/java/ch/njol/skript/conditions/CondFromMobSpawner.java +++ b/src/main/java/ch/njol/skript/conditions/CondFromMobSpawner.java @@ -10,7 +10,7 @@ @Name("Is From A Mob Spawner") @Description("Checks if an entity was spawned from a mob spawner.") -@Examples("send whether target is from a mob spawner") +@Example("send whether target is from a mob spawner") @Since("2.10") public class CondFromMobSpawner extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondGlowingText.java b/src/main/java/ch/njol/skript/conditions/CondGlowingText.java index 1044734d244..693c84120a9 100644 --- a/src/main/java/ch/njol/skript/conditions/CondGlowingText.java +++ b/src/main/java/ch/njol/skript/conditions/CondGlowingText.java @@ -6,7 +6,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.block.BlockState; @@ -16,7 +16,7 @@ @Name("Has Glowing Text") @Description("Checks whether a sign (either a block or an item) has glowing text") -@Examples("if target block has glowing text") +@Example("if target block has glowing text") @Since("2.8.0") public class CondGlowingText extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondHasClientWeather.java b/src/main/java/ch/njol/skript/conditions/CondHasClientWeather.java index 8047dfc77b0..f90525ac83a 100755 --- a/src/main/java/ch/njol/skript/conditions/CondHasClientWeather.java +++ b/src/main/java/ch/njol/skript/conditions/CondHasClientWeather.java @@ -4,16 +4,16 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Has Client Weather") @Description("Checks whether the given players have a custom client weather") -@Examples({ - "if the player has custom weather:", - "\tmessage \"Your custom weather is %player's weather%\"" -}) +@Example(""" + if the player has custom weather: + message "Your custom weather is %player's weather%" + """) @Since("2.3") public class CondHasClientWeather extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondHasLineOfSight.java b/src/main/java/ch/njol/skript/conditions/CondHasLineOfSight.java index b5e8dae5571..cb033420e83 100644 --- a/src/main/java/ch/njol/skript/conditions/CondHasLineOfSight.java +++ b/src/main/java/ch/njol/skript/conditions/CondHasLineOfSight.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,11 +17,9 @@ @Name("Has Line of Sight") @Description("Checks whether living entities have an unobstructed line of sight to other entities or locations.") -@Examples({ - "player has direct line of sight to location 5 blocks to the right of player", - "victim has line of sight to attacker", - "player has no line of sight to location 100 blocks in front of player" -}) +@Example("player has direct line of sight to location 5 blocks to the right of player") +@Example("victim has line of sight to attacker") +@Example("player has no line of sight to location 100 blocks in front of player") @Since("2.8.0") public class CondHasLineOfSight extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondHasMetadata.java b/src/main/java/ch/njol/skript/conditions/CondHasMetadata.java index cfb60086fd5..583680f405b 100644 --- a/src/main/java/ch/njol/skript/conditions/CondHasMetadata.java +++ b/src/main/java/ch/njol/skript/conditions/CondHasMetadata.java @@ -4,7 +4,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,7 +17,7 @@ @Name("Has Metadata") @Description("Checks whether a metadata holder has a metadata tag.") -@Examples("if player has metadata value \"healer\":") +@Example("if player has metadata value \"healer\":") @Since("2.2-dev36") @SuppressWarnings("null") public class CondHasMetadata extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondHasResourcePack.java b/src/main/java/ch/njol/skript/conditions/CondHasResourcePack.java index 028316eec58..96b3801f3a4 100644 --- a/src/main/java/ch/njol/skript/conditions/CondHasResourcePack.java +++ b/src/main/java/ch/njol/skript/conditions/CondHasResourcePack.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Player; @@ -11,7 +11,7 @@ @Name("Has Resource Pack") @Description("Checks whether the given players have a server resource pack loaded. Please note that this can't detect " + "player's own resource pack, only the resource pack that sent by the server.") -@Examples("if the player has a resource pack loaded:") +@Example("if the player has a resource pack loaded:") @Since("2.4") public class CondHasResourcePack extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondHasScoreboardTag.java b/src/main/java/ch/njol/skript/conditions/CondHasScoreboardTag.java index 7379bbfdd14..6cdbd300f0c 100644 --- a/src/main/java/ch/njol/skript/conditions/CondHasScoreboardTag.java +++ b/src/main/java/ch/njol/skript/conditions/CondHasScoreboardTag.java @@ -3,7 +3,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,7 +17,7 @@ @Name("Has Scoreboard Tag") @Description("Checks whether the given entities has the given scoreboard tags.") -@Examples("if the targeted armor stand has the scoreboard tag \"test tag\":") +@Example("if the targeted armor stand has the scoreboard tag \"test tag\":") @Since("2.3") public class CondHasScoreboardTag extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIgnitionProcess.java b/src/main/java/ch/njol/skript/conditions/CondIgnitionProcess.java index 2f1c6428259..def5aa8354d 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIgnitionProcess.java +++ b/src/main/java/ch/njol/skript/conditions/CondIgnitionProcess.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -16,11 +16,11 @@ @Name("Ignition Process") @Description("Checks if a creeper is going to explode.") -@Examples({ - "if the last spawned creeper is going to explode:", - "\tloop all players in radius 3 of the last spawned creeper", - "\t\tsend \"RUN!!!\" to the loop-player" -}) +@Example(""" + if the last spawned creeper is going to explode: + loop all players in radius 3 of the last spawned creeper + send "RUN!!!" to the loop-player + """) @Since("2.5") public class CondIgnitionProcess extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIncendiary.java b/src/main/java/ch/njol/skript/conditions/CondIncendiary.java index 5ee20c07cec..c0fb705900e 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIncendiary.java +++ b/src/main/java/ch/njol/skript/conditions/CondIncendiary.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -19,9 +19,11 @@ @Name("Is Incendiary") @Description("Checks if an entity will create fire when it explodes. This condition is also usable in an explosion prime event.") -@Examples({"on explosion prime:", - "\tif the explosion is fiery:", - "\t\tbroadcast \"A fiery explosive has been ignited!\""}) +@Example(""" + on explosion prime: + if the explosion is fiery: + broadcast "A fiery explosive has been ignited!" + """) @Since("2.5") public class CondIncendiary extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsAlive.java b/src/main/java/ch/njol/skript/conditions/CondIsAlive.java index 625bbe0d8e6..f8a77123ab1 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsAlive.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsAlive.java @@ -4,7 +4,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -13,12 +13,11 @@ @Name("Is Alive") @Description("Checks whether an entity is alive. Works for non-living entities too.") -@Examples({ - "if {villager-buddy::%player's uuid%} is not dead:", - "", - "on shoot:", - "\twhile the projectile is alive:" -}) +@Example("if {villager-buddy::%player's uuid%} is not dead:") +@Example(""" + on shoot: + while the projectile is alive: + """) @Since("2.0, 2.4-alpha4 (non-living entity support)") public class CondIsAlive extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsBanned.java b/src/main/java/ch/njol/skript/conditions/CondIsBanned.java index 0709b474d28..3979ffcaaec 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsBanned.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsBanned.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,11 +17,9 @@ @Name("Is Banned") @Description("Checks whether a player or IP is banned.") -@Examples({ - "player is banned", - "victim is not IP-banned", - "\"127.0.0.1\" is banned" -}) +@Example("player is banned") +@Example("victim is not IP-banned") +@Example("\"127.0.0.1\" is banned") @Since("1.4") public class CondIsBanned extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsBlock.java b/src/main/java/ch/njol/skript/conditions/CondIsBlock.java index 69df1a0dc69..a3cd9a914c5 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsBlock.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsBlock.java @@ -3,16 +3,14 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Block") @Description("Checks whether an item is a block.") -@Examples({ - "player's held item is a block", - "{list::*} are blocks" -}) +@Example("player's held item is a block") +@Example("{list::*} are blocks") @Since("2.4") public class CondIsBlock extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsBlockRedstonePowered.java b/src/main/java/ch/njol/skript/conditions/CondIsBlockRedstonePowered.java index 86cba581c0e..4625bc3245b 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsBlockRedstonePowered.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsBlockRedstonePowered.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,10 +17,14 @@ @Name("Is Block Redstone Powered") @Description("Checks if a block is indirectly or directly powered by redstone") -@Examples({"if clicked block is redstone powered:", - "\tsend \"This block is well-powered by redstone!\"", - "if clicked block is indirectly redstone powered:", - "\tsend \"This block is indirectly redstone powered.\""}) +@Example(""" + if clicked block is redstone powered: + send "This block is well-powered by redstone!" + """) +@Example(""" + if clicked block is indirectly redstone powered: + send "This block is indirectly redstone powered." + """) @Since("2.5") public class CondIsBlockRedstonePowered extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsBlocking.java b/src/main/java/ch/njol/skript/conditions/CondIsBlocking.java index e0d04bd274c..60e3856ec27 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsBlocking.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsBlocking.java @@ -4,17 +4,17 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Blocking") @Description("Checks whether a player is blocking with their shield.") -@Examples({ - "on damage of player:", - "\tvictim is blocking", - "\tdamage attacker by 0.5 hearts" -}) +@Example(""" + on damage of player: + victim is blocking + damage attacker by 0.5 hearts + """) @Since("unknown (before 2.1)") public class CondIsBlocking extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsBurning.java b/src/main/java/ch/njol/skript/conditions/CondIsBurning.java index 560cdcc0735..8af9d886743 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsBurning.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsBurning.java @@ -4,17 +4,17 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Burning") @Description("Checks whether an entity is on fire, e.g. a zombie due to being in sunlight, or any entity after falling into lava.") -@Examples({ - "# increased attack against burning targets", - "victim is burning:", - "\tincrease damage by 2" -}) +@Example(""" + # increased attack against burning targets + victim is burning: + increase damage by 2 + """) @Since("1.4.4") public class CondIsBurning extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsCharged.java b/src/main/java/ch/njol/skript/conditions/CondIsCharged.java index 7f8bb9691ec..29d5aa0a45e 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsCharged.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsCharged.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Creeper; @@ -12,10 +12,10 @@ @Name("Is Charged") @Description("Checks if a creeper, wither, or wither skull is charged (powered).") -@Examples({ - "if the last spawned creeper is charged:", - "\tbroadcast \"A charged creeper is at %location of last spawned creeper%\"" -}) +@Example(""" + if the last spawned creeper is charged: + broadcast "A charged creeper is at %location of last spawned creeper%" + """) @Since("2.5, 2.10 (withers, wither skulls)") public class CondIsCharged extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsChargingFireball.java b/src/main/java/ch/njol/skript/conditions/CondIsChargingFireball.java index 36c797c7a1a..9c5b7817c0d 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsChargingFireball.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsChargingFireball.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Ghast; @@ -10,10 +10,10 @@ @Name("Is Charging Fireball") @Description("Check whether a ghast is charging a fireball.") -@Examples({ - "if last spawned ghast is charging fireball:", - "\tkill last spawned ghast" -}) +@Example(""" + if last spawned ghast is charging fireball: + kill last spawned ghast + """) @Since("2.11") public class CondIsChargingFireball extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsClimbing.java b/src/main/java/ch/njol/skript/conditions/CondIsClimbing.java index 947ef1f4822..dcef3951227 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsClimbing.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsClimbing.java @@ -7,12 +7,12 @@ @Name("Is Climbing") @Description("Whether a living entity is climbing, such as a spider up a wall or a player on a ladder.") -@Examples({ - "spawn a spider at location of spawn", - "wait a second", - "if the last spawned spider is climbing:", - "\tmessage\"The spider is now climbing!\"" -}) +@Example(""" + spawn a spider at location of spawn + wait a second + if the last spawned spider is climbing: + message "The spider is now climbing!" + """) @RequiredPlugins("Minecraft 1.17+") @Since("2.8.0") public class CondIsClimbing extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsCommandBlockConditional.java b/src/main/java/ch/njol/skript/conditions/CondIsCommandBlockConditional.java index 41409e8a6a3..05a33420198 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsCommandBlockConditional.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsCommandBlockConditional.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -13,10 +13,10 @@ @Name("Is Conditional") @Description("Checks whether a command block is conditional or not.") -@Examples({ - "if {_block} is conditional:", - "\tmake {_block} unconditional" -}) +@Example(""" + if {_block} is conditional: + make {_block} unconditional + """) @Since("2.10") public class CondIsCommandBlockConditional extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsCustomNameVisible.java b/src/main/java/ch/njol/skript/conditions/CondIsCustomNameVisible.java index 8446816ab51..d09d3024dd2 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsCustomNameVisible.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsCustomNameVisible.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -13,7 +13,7 @@ @Name("Is Custom Name Visible") @Description("Checks if an entity's custom name is visible.") -@Examples("send true if target's custom name is visible") +@Example("send true if target's custom name is visible") @Since("2.10") public class CondIsCustomNameVisible extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsDancing.java b/src/main/java/ch/njol/skript/conditions/CondIsDancing.java index 6d12fa5030d..47122fa60f9 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsDancing.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsDancing.java @@ -10,10 +10,10 @@ @Name("Is Dancing") @Description("Checks to see if an entity is dancing, such as allays, parrots, or piglins.") -@Examples({ - "if last spawned allay is dancing:", - "\tbroadcast \"Dance Party!\"" -}) +@Example(""" + if last spawned allay is dancing: + broadcast "Dance Party!" + """) @Since("2.11") public class CondIsDancing extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsDashing.java b/src/main/java/ch/njol/skript/conditions/CondIsDashing.java index e8af7da2569..169241f2e95 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsDashing.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsDashing.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Camel; @@ -10,10 +10,10 @@ @Name("Camel Is Dashing") @Description("Checks whether a camel is currently using its dash ability.") -@Examples({ - "if last spawned camel is dashing:", - "\tkill last spawned camel" -}) +@Example(""" + if last spawned camel is dashing: + kill last spawned camel + """) @Since("2.11") public class CondIsDashing extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsDivisibleBy.java b/src/main/java/ch/njol/skript/conditions/CondIsDivisibleBy.java index 51f2af68e07..e30b6f9ac90 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsDivisibleBy.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsDivisibleBy.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.config.Node; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -21,11 +21,9 @@ Any input smaller than the tolerance is considered to be 0. This means divisors that are too small will always return false, and dividends that are too small will always return true. """) -@Examples({ - "if 5 is evenly divisible by 5:", - "if 11 cannot be evenly divided by 10:", - "if 0.3 can be evenly divided by 0.1 with a tolerance of 0.0000001:" -}) +@Example("if 5 is evenly divisible by 5:") +@Example("if 11 cannot be evenly divided by 10:") +@Example("if 0.3 can be evenly divided by 0.1 with a tolerance of 0.0000001:") @Since("2.10, 2.12 (tolerance)") public class CondIsDivisibleBy extends Condition implements SyntaxRuntimeErrorProducer { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsEdible.java b/src/main/java/ch/njol/skript/conditions/CondIsEdible.java index 565e2629563..5eaa14d74d3 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsEdible.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsEdible.java @@ -3,16 +3,14 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Edible") @Description("Checks whether an item is edible.") -@Examples({ - "cooked beef is edible", - "player's tool is edible" -}) +@Example("cooked beef is edible") +@Example("player's tool is edible") @Since("2.2-dev36") public class CondIsEdible extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsEmpty.java b/src/main/java/ch/njol/skript/conditions/CondIsEmpty.java index e6e166cb48b..8e7cce0ade3 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsEmpty.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsEmpty.java @@ -3,7 +3,7 @@ import ch.njol.skript.SkriptConfig; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.util.common.AnyAmount; @@ -19,7 +19,7 @@ */ @Name("Is Empty") @Description("Checks whether an inventory, an inventory slot, a queue, or a text is empty.") -@Examples("player's inventory is empty") +@Example("player's inventory is empty") @Since("unknown (before 2.1)") @Deprecated(since="2.13", forRemoval = true) public class CondIsEmpty extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsFireResistant.java b/src/main/java/ch/njol/skript/conditions/CondIsFireResistant.java index da0768b35d3..ef39ace4a17 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsFireResistant.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsFireResistant.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -12,10 +12,8 @@ @Name("Is Fire Resistant") @Description("Checks whether an item is fire resistant.") -@Examples({ - "if player's tool is fire resistant:", - "if {_items::*} aren't resistant to fire:" -}) +@Example("if player's tool is fire resistant:") +@Example("if {_items::*} aren't resistant to fire:") @RequiredPlugins("Spigot 1.20.5+") @Since("2.9.0") public class CondIsFireResistant extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsFlammable.java b/src/main/java/ch/njol/skript/conditions/CondIsFlammable.java index 9b634e383be..275767b1f91 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsFlammable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsFlammable.java @@ -3,16 +3,14 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Flammable") @Description("Checks whether an item is flammable.") -@Examples({ - "send whether the tag contents of minecraft tag \"planks\" are flammable", - "player's tool is flammable" -}) +@Example("send whether the tag contents of minecraft tag \"planks\" are flammable") +@Example("player's tool is flammable") @Since("2.2-dev36") public class CondIsFlammable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsFlying.java b/src/main/java/ch/njol/skript/conditions/CondIsFlying.java index b93e978b0d2..ff7089f32dd 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsFlying.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsFlying.java @@ -4,13 +4,13 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Flying") @Description("Checks whether a player is flying.") -@Examples("player is not flying") +@Example("player is not flying") @Since("1.4.4") public class CondIsFlying extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsFrozen.java b/src/main/java/ch/njol/skript/conditions/CondIsFrozen.java index ed5a511d875..be7c4eda5e3 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsFrozen.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsFrozen.java @@ -3,17 +3,17 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Entity; @Name("Is Frozen") @Description("Checks whether an entity is frozen.") -@Examples({ - "if player is frozen:", - "\tkill player" -}) +@Example(""" + if player is frozen: + kill player + """) @Since("2.7") public class CondIsFrozen extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsFuel.java b/src/main/java/ch/njol/skript/conditions/CondIsFuel.java index 9a303e97c20..2040df0e809 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsFuel.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsFuel.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -14,12 +14,12 @@ @Name("Is Fuel") @Description("Checks whether an item can be used as fuel in a furnace.") -@Examples({ - "on right click on furnace:", - "\tif player's tool is not fuel:", - "\t\tsend \"Please hold a valid fuel item in your hand\"", - "\t\tcancel event" -}) +@Example(""" + on right click on furnace: + if player's tool is not fuel: + send "Please hold a valid fuel item in your hand" + cancel event + """) @Since("2.5.1") public class CondIsFuel extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsGliding.java b/src/main/java/ch/njol/skript/conditions/CondIsGliding.java index d5224690bdd..6d15fcebc97 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsGliding.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsGliding.java @@ -1,7 +1,7 @@ package ch.njol.skript.conditions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @@ -10,7 +10,7 @@ @Name("Is Gliding") @Description("Checks whether a living entity is gliding.") -@Examples("if player is gliding") +@Example("if player is gliding") @Since("2.7") public class CondIsGliding extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsHandRaised.java b/src/main/java/ch/njol/skript/conditions/CondIsHandRaised.java index 43386ece6eb..4c55cc26c21 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsHandRaised.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsHandRaised.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -20,12 +20,12 @@ "Checks whether an entity has one or both of their hands raised.", "Hands are raised when an entity is using an item (eg: blocking, drawing a bow, eating)." }) -@Examples({ - "on damage of player:", - "\tif victim's main hand is raised:", - "\t\tdrop player's tool at player", - "\t\tset player's tool to air" -}) +@Example(""" + on damage of player: + if victim's main hand is raised: + drop player's tool at player + set player's tool to air + """) @Since("2.8.0") public class CondIsHandRaised extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsInteractable.java b/src/main/java/ch/njol/skript/conditions/CondIsInteractable.java index ff642ed0793..c96228e6bfe 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsInteractable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsInteractable.java @@ -6,12 +6,12 @@ @Name("Is Interactable") @Description("Checks wether or not a block is interactable.") -@Examples({ - "on block break:", - "\tif event-block is interactable:", - "\t\tcancel event", - "\t\tsend \"You cannot break interactable blocks!\"" -}) +@Example(""" + on block break: + if event-block is interactable: + cancel event + send "You cannot break interactable blocks!" + """) @Since("2.5.2") public class CondIsInteractable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsInvisible.java b/src/main/java/ch/njol/skript/conditions/CondIsInvisible.java index bf2251f753d..73937175528 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsInvisible.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsInvisible.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -12,7 +12,7 @@ @Name("Is Invisible") @Description("Checks whether a living entity is invisible.") -@Examples("target entity is invisible") +@Example("target entity is invisible") @Since("2.7") public class CondIsInvisible extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsInvulnerable.java b/src/main/java/ch/njol/skript/conditions/CondIsInvulnerable.java index 16b46d8b9c2..01453024a53 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsInvulnerable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsInvulnerable.java @@ -9,13 +9,12 @@ @Name("Is Invulnerable") @Description("Checks whether an entity or a gamemode is invulnerable.\nFor gamemodes, Paper and Minecraft 1.20.6 are required") -@Examples({ - "target entity is invulnerable", - "", - "loop all gamemodes:", - "\tif loop-value is not invulnerable:", - "\t\tbroadcast \"the gamemode %loop-value% is vulnerable!\"" -}) +@Example("target entity is invulnerable") +@Example(""" + loop all gamemodes: + if loop-value is not invulnerable: + broadcast "the gamemode %loop-value% is vulnerable!" + """) @Since("2.5, 2.10 (gamemode)") public class CondIsInvulnerable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsJumping.java b/src/main/java/ch/njol/skript/conditions/CondIsJumping.java index a7e97edac3a..e8af905d710 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsJumping.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsJumping.java @@ -2,9 +2,9 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; -import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Name; +import ch.njol.skript.doc.Description; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.SkriptParser.ParseResult; @@ -14,12 +14,12 @@ @Name("Is Jumping") @Description("Checks whether a living entity is jumping. This condition does not work on players.") -@Examples({ - "on spawn of zombie:", - "\twhile event-entity is not jumping:", - "\t\twait 5 ticks", - "\tpush event-entity upwards" -}) +@Example(""" + on spawn of zombie: + while event-entity is not jumping: + wait 5 ticks + push event-entity upwards + """) @Since("2.8.0") public class CondIsJumping extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsLeftHanded.java b/src/main/java/ch/njol/skript/conditions/CondIsLeftHanded.java index e7fc5ed1c98..bd8473e53ed 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsLeftHanded.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsLeftHanded.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,11 +18,11 @@ @Description({ "Checks if living entities or players are left or right-handed. Armor stands are neither right nor left-handed." }) -@Examples({ - "on damage of player:", - "\tif victim is left handed:", - "\t\tcancel event" -}) +@Example(""" + on damage of player: + if victim is left handed: + cancel event + """) @Since("2.8.0") public class CondIsLeftHanded extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsLoaded.java b/src/main/java/ch/njol/skript/conditions/CondIsLoaded.java index 9a88b72a103..9c3ff494d9b 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsLoaded.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsLoaded.java @@ -3,7 +3,7 @@ import ch.njol.skript.ScriptLoader; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -24,11 +24,10 @@ "Checks whether a world, chunk or script is loaded.", "'chunk at 1, 1' uses chunk coordinates, which are location coords divided by 16." }) -@Examples({"if chunk at {home::%player's uuid%} is loaded:", - "if chunk 1, 10 in world \"world\" is loaded:", - "if world(\"lobby\") is loaded:", - "if script named \"MyScript.sk\" is loaded:" -}) +@Example("if chunk at {home::%player's uuid%} is loaded:") +@Example("if chunk 1, 10 in world \"world\" is loaded:") +@Example("if world(\"lobby\") is loaded:") +@Example("if script named \"MyScript.sk\" is loaded:") @Since("2.3, 2.5 (revamp with chunk at location/coords), 2.10 (Scripts)") @SuppressWarnings("unchecked") public class CondIsLoaded extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsOccluding.java b/src/main/java/ch/njol/skript/conditions/CondIsOccluding.java index 1367e183c4b..b34065f874e 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsOccluding.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsOccluding.java @@ -3,13 +3,13 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Occluding") @Description("Checks whether an item is a block and completely blocks vision.") -@Examples("player's tool is occluding") +@Example("player's tool is occluding") @Since("2.5.1") public class CondIsOccluding extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsOfType.java b/src/main/java/ch/njol/skript/conditions/CondIsOfType.java index 47baed7a481..5f86a2fad7d 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsOfType.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsOfType.java @@ -5,7 +5,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -24,8 +24,8 @@ @Name("Is of Type") @Description("Checks whether an item or an entity is of the given type. This is mostly useful for variables," + " as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').") -@Examples({"tool is of type {selected type}", - "victim is of type {villager type}"}) +@Example("tool is of type {selected type}") +@Example("victim is of type {villager type}") @Since("1.4") public class CondIsOfType extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsOnGround.java b/src/main/java/ch/njol/skript/conditions/CondIsOnGround.java index fc7e327f690..dcdcc785f6d 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsOnGround.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsOnGround.java @@ -4,13 +4,13 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is on Ground") @Description("Checks whether an entity is on ground.") -@Examples("player is not on ground") +@Example("player is not on ground") @Since("2.2-dev26") public class CondIsOnGround extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsOnline.java b/src/main/java/ch/njol/skript/conditions/CondIsOnline.java index b65575f3c55..3ee56de97fb 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsOnline.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsOnline.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,19 +17,20 @@ + "even if they rejoin. Be aware that using the 'connected' pattern with a variable will not have this special behavior. " + "Use the direct event-player or other non-variable expression for best results." ) -@Examples({ - "player is online", - "player-argument is offline", - "while player is connected:", - "\twait 60 seconds", - "\tsend \"hello!\" to player", - "", - "# The following will act like `{_player} is online`.", - "# Using variables with `is connected` will not behave the same as with non-variables.", - "while {_player} is connected:", - "\tbroadcast \"online!\"", - "\twait 1 tick" -}) +@Example("player is online") +@Example("player-argument is offline") +@Example(""" + while player is connected: + wait 60 seconds + send "hello!" to player + """) +@Example(""" + # The following will act like `{_player} is online`. + # Using variables with `is connected` will not behave the same as with non-variables. + while {_player} is connected: + broadcast "online!" + wait 1 tick + """) @Since("1.4") public class CondIsOnline extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsOp.java b/src/main/java/ch/njol/skript/conditions/CondIsOp.java index 08dcf7af851..d2d0c61bf0e 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsOp.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsOp.java @@ -2,14 +2,14 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.OfflinePlayer; @Name("Is Operator") @Description("Checks whether a player is a server operator.") -@Examples("player is an operator") +@Example("player is an operator") @Since("2.7") public class CondIsOp extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPassable.java b/src/main/java/ch/njol/skript/conditions/CondIsPassable.java index 652028f7212..8d8a0c5fca2 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPassable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPassable.java @@ -11,7 +11,7 @@ "Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. " + "are not because they still have parts that can be collided with." }) -@Examples("if player's targeted block is passable") +@Example("if player's targeted block is passable") @Since("2.5.1") public class CondIsPassable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPathfinding.java b/src/main/java/ch/njol/skript/conditions/CondIsPathfinding.java index c425b780eb5..879009a9e99 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPathfinding.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPathfinding.java @@ -4,7 +4,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -27,14 +27,14 @@ "Checks whether living entities are pathfinding.", "Can only be a living entity that is a Mob." }) -@Examples({ - "make {_entity} pathfind to {_location} at speed 2", - "while {_entity} is pathfinding", - "\twait a second", - "launch flickering trailing burst firework colored red at location of {_entity}", - "subtract 10 from {defence::tower::health}", - "clear entity within {_entity}" -}) +@Example(""" + make {_entity} pathfind to {_location} at speed 2 + while {_entity} is pathfinding + wait a second + launch flickering trailing burst firework colored red at location of {_entity} + subtract 10 from {defence::tower::health} + clear entity within {_entity} + """) @Since("2.9.0") public class CondIsPathfinding extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPersistent.java b/src/main/java/ch/njol/skript/conditions/CondIsPersistent.java index 47814cebfd7..cd30a683630 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPersistent.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPersistent.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.block.Block; @@ -20,11 +20,11 @@ + "non-persistent chicken will become non-persistent. This does not apply to players.", "By default, all entities are persistent." }) -@Examples({ - "on spawn:", - "\tif event-entity is persistent:", - "\t\tmake event-entity not persistent" -}) +@Example(""" + on spawn: + if event-entity is persistent: + make event-entity not persistent + """) @Since("2.11") public class CondIsPersistent extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPlayingDead.java b/src/main/java/ch/njol/skript/conditions/CondIsPlayingDead.java index 5019d74f391..732a6f8774b 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPlayingDead.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPlayingDead.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Axolotl; @@ -10,10 +10,10 @@ @Name("Is Playing Dead") @Description("Checks to see if an axolotl is playing dead.") -@Examples({ - "if last spawned axolotl is playing dead:", - "\tmake last spawned axolotl stop playing dead" -}) +@Example(""" + if last spawned axolotl is playing dead: + make last spawned axolotl stop playing dead + """) @Since("2.11") public class CondIsPlayingDead extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPluginEnabled.java b/src/main/java/ch/njol/skript/conditions/CondIsPluginEnabled.java index e6d60df64d9..69b5b302dce 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPluginEnabled.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPluginEnabled.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -19,10 +19,10 @@ "Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file.", "When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. ", "When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled."}) -@Examples({"if plugin \"Vault\" is enabled:", - "if plugin \"WorldGuard\" is not enabled:", - "if plugins \"Essentials\" and \"Vault\" are enabled:", - "if plugin \"MyBrokenPlugin\" is disabled:"}) +@Example("if plugin \"Vault\" is enabled:") +@Example("if plugin \"WorldGuard\" is not enabled:") +@Example("if plugins \"Essentials\" and \"Vault\" are enabled:") +@Example("if plugin \"MyBrokenPlugin\" is disabled:") @Since("2.6") public class CondIsPluginEnabled extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPoisoned.java b/src/main/java/ch/njol/skript/conditions/CondIsPoisoned.java index 7cb3b1ac764..f978ac91b2a 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPoisoned.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPoisoned.java @@ -5,17 +5,17 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Poisoned") @Description("Checks whether an entity is poisoned.") -@Examples({ - "player is poisoned:", - "\tcure the player from poison", - "\tmessage \"You have been cured!\"" -}) +@Example(""" + player is poisoned: + cure the player from poison + message "You have been cured!" + """) @Since("1.4.4") public class CondIsPoisoned extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsPreferredTool.java b/src/main/java/ch/njol/skript/conditions/CondIsPreferredTool.java index 60403a28f40..e270dfabb74 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsPreferredTool.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsPreferredTool.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -22,14 +22,14 @@ "Checks whether an item is the preferred tool for a block. A preferred tool is one that will drop the block's item " + "when used. For example, a wooden pickaxe is a preferred tool for grass and stone blocks, but not for iron ore." ) -@Examples({ - "on left click:", - "\tevent-block is set", - "\tif player's tool is the preferred tool for event-block:", - "\t\tbreak event-block naturally using player's tool", - "\telse:", - "\t\tcancel event" -}) +@Example(""" + on left click: + event-block is set + if player's tool is the preferred tool for event-block: + break event-block naturally using player's tool + else: + cancel event + """) @Since("2.7") @RequiredPlugins("1.16.5+, Paper 1.19.2+ (blockdata)") public class CondIsPreferredTool extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsResonating.java b/src/main/java/ch/njol/skript/conditions/CondIsResonating.java index 3b0db42f62f..5c0c5e604d7 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsResonating.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsResonating.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.block.Bell; @@ -15,7 +15,7 @@ "Checks to see if a bell is currently resonating.", "A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks." }) -@Examples("target block is resonating") +@Example("target block is resonating") @Since("2.9.0") public class CondIsResonating extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsRiding.java b/src/main/java/ch/njol/skript/conditions/CondIsRiding.java index 9ce034bca82..3c0f345a881 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsRiding.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsRiding.java @@ -9,7 +9,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -19,12 +19,10 @@ @Name("Is Riding") @Description("Tests whether an entity is riding any entity, a specific entity type, or a specific entity.") -@Examples({ - "if player is riding:", - "if player is riding an entity:", - "if player is riding a saddled pig:", - "if player is riding last spawned horse:" -}) +@Example("if player is riding:") +@Example("if player is riding an entity:") +@Example("if player is riding a saddled pig:") +@Example("if player is riding last spawned horse:") @Since("2.0, 2.11 (entities)") public class CondIsRiding extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsRinging.java b/src/main/java/ch/njol/skript/conditions/CondIsRinging.java index b0e13dcefb9..01c4de4eee4 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsRinging.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsRinging.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.block.Bell; @@ -12,7 +12,7 @@ @Name("Bell Is Ringing") @Description("Checks to see if a bell is currently ringing. A bell typically rings for 50 game ticks.") -@Examples("target block is ringing") +@Example("target block is ringing") @Since("2.9.0") public class CondIsRinging extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsRiptiding.java b/src/main/java/ch/njol/skript/conditions/CondIsRiptiding.java index fe1932d79f5..c179fb534d7 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsRiptiding.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsRiptiding.java @@ -2,14 +2,14 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @Name("Is Riptiding") @Description("Checks to see if an entity is currently using the Riptide enchantment.") -@Examples("target entity is riptiding") +@Example("target entity is riptiding") @Since("2.5") public class CondIsRiptiding extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSaddled.java b/src/main/java/ch/njol/skript/conditions/CondIsSaddled.java index acfdc36517c..100809f3976 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSaddled.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSaddled.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,7 +19,7 @@ "Checks whether a given entity (horse or steerable) is saddled.", "If 'properly' is used, this will only return true if the entity is wearing specifically a saddle item." }) -@Examples("send whether {_horse} is saddled") +@Example("send whether {_horse} is saddled") @Since("2.10") public class CondIsSaddled extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSedated.java b/src/main/java/ch/njol/skript/conditions/CondIsSedated.java index bb164765d69..bdf998dace0 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSedated.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSedated.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.block.Beehive; @@ -10,7 +10,7 @@ @Name("Beehive Is Sedated") @Description("Checks if a beehive is sedated from a nearby campfire.") -@Examples("if {_beehive} is sedated:") +@Example("if {_beehive} is sedated:") @Since("2.11") public class CondIsSedated extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSet.java b/src/main/java/ch/njol/skript/conditions/CondIsSet.java index f6afc2e5a6a..b7612f6293b 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSet.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSet.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -21,10 +21,12 @@ */ @Name("Exists/Is Set") @Description("Checks whether a given expression or variable is set.") -@Examples({"{teams::%player's uuid%::preferred-team} is not set", - "on damage:", - " projectile exists", - " broadcast \"%attacker% used a %projectile% to attack %victim%!\""}) +@Example("{teams::%player's uuid%::preferred-team} is not set") +@Example(""" + on damage: + projectile exists + broadcast "%attacker% used a %projectile% to attack %victim%!" + """) @Since("1.2") public class CondIsSet extends Condition implements VerboseAssert { static { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSheared.java b/src/main/java/ch/njol/skript/conditions/CondIsSheared.java index 6d07038e856..5abace07b06 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSheared.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSheared.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import io.papermc.paper.entity.Shearable; @@ -15,10 +15,10 @@ @Name("Entity Is Sheared") @Description("Checks whether entities are sheared.") -@Examples({ - "if targeted entity of player is sheared:", - "\tsend \"This entity has nothing left to shear!\" to player" -}) +@Example(""" + if targeted entity of player is sheared: + send "This entity has nothing left to shear!" to player + """) @Since("2.8.0") public class CondIsSheared extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSilent.java b/src/main/java/ch/njol/skript/conditions/CondIsSilent.java index 36f205fe6d5..520414c1ce5 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSilent.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSilent.java @@ -4,13 +4,13 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Silent") @Description("Checks whether an entity is silent i.e. its sounds are disabled.") -@Examples("target entity is silent") +@Example("target entity is silent") @Since("2.5") public class CondIsSilent extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSkriptCommand.java b/src/main/java/ch/njol/skript/conditions/CondIsSkriptCommand.java index 49045fab196..3375a02bf80 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSkriptCommand.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSkriptCommand.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @@ -10,14 +10,10 @@ @Name("Is a Skript command") @Description("Checks whether a command/string is a custom Skript command.") -@Examples({ - "# Example 1", - "on command:", - "\tcommand is a skript command", - "", - "# Example 2", - "\"sometext\" is a skript command" -}) +@Example(""" + on command: + command is a skript command + """) @Since("2.6") public class CondIsSkriptCommand extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSleeping.java b/src/main/java/ch/njol/skript/conditions/CondIsSleeping.java index f4684e20079..db1ed59e82c 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSleeping.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSleeping.java @@ -2,20 +2,21 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @Name("Is Sleeping") @Description("Checks whether an entity is sleeping.") -@Examples({ - "if player is sleeping:", - "\tmake player wake up without spawn location update", - "", - "if last spawned fox is sleeping:", - "\tmake last spawned fox stop sleeping" -}) +@Example(""" + if player is sleeping: + make player wake up without spawn location update + """) +@Example(""" + if last spawned fox is sleeping: + make last spawned fox stop sleeping + """) @Since("1.4.4, 2.11 (living entities)") public class CondIsSleeping extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSlimeChunk.java b/src/main/java/ch/njol/skript/conditions/CondIsSlimeChunk.java index 8c43ae10cad..a25b8594a44 100755 --- a/src/main/java/ch/njol/skript/conditions/CondIsSlimeChunk.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSlimeChunk.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.Chunk; @@ -13,14 +13,14 @@ "Slimes can generally spawn in the swamp biome and in slime chunks.", "For more info, see the Minecraft wiki." }) -@Examples({ - "command /slimey:", - "\ttrigger:", - "\t\tif chunk at player is a slime chunk:", - "\t\t\tsend \"Yeah, it is!\"", - "\t\telse:", - "\t\t\tsend \"Nope, it isn't\"" -}) +@Example(""" + command /slimey: + trigger: + if chunk at player is a slime chunk: + send "Yeah, it is!" + else: + send "Nope, it isn't" + """) @Since("2.3") public class CondIsSlimeChunk extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSneaking.java b/src/main/java/ch/njol/skript/conditions/CondIsSneaking.java index 1b64bfa251d..74d159e3d48 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSneaking.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSneaking.java @@ -4,19 +4,19 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Sneaking") @Description("Checks whether a player is sneaking.") -@Examples({ - "# prevent mobs from seeing sneaking players if they are at least 4 meters apart", - "on target:", - "\ttarget is sneaking", - "\tdistance of target and the entity is bigger than 4", - "\tcancel the event" -}) +@Example(""" + # prevent mobs from seeing sneaking players if they are at least 4 meters apart + on target: + target is sneaking + distance of target and the entity is bigger than 4 + cancel the event + """) @Since("1.4.4") public class CondIsSneaking extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSolid.java b/src/main/java/ch/njol/skript/conditions/CondIsSolid.java index 8b38be7da90..90926a543dd 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSolid.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSolid.java @@ -3,16 +3,14 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Solid") @Description("Checks whether an item is solid.") -@Examples({ - "grass block is solid", - "player's tool isn't solid" -}) +@Example("grass block is solid") +@Example("player's tool isn't solid") @Since("2.2-dev36") public class CondIsSolid extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSprinting.java b/src/main/java/ch/njol/skript/conditions/CondIsSprinting.java index 6740ce47d07..7cd73b49e45 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSprinting.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSprinting.java @@ -2,14 +2,14 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Player; @Name("Is Sprinting") @Description("Checks whether a player is sprinting.") -@Examples("player is not sprinting") +@Example("player is not sprinting") @Since("1.4.4") public class CondIsSprinting extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsStackable.java b/src/main/java/ch/njol/skript/conditions/CondIsStackable.java index ed111e43436..69c05d81f3f 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsStackable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsStackable.java @@ -3,17 +3,15 @@ import org.bukkit.inventory.ItemStack; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Stackable") @Description("Checks whether an item is stackable.") -@Examples({ - "diamond axe is stackable", - "birch wood is stackable", - "torch is stackable" -}) +@Example("diamond axe is stackable") +@Example("birch wood is stackable") +@Example("torch is stackable") @Since("2.7") public class CondIsStackable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsSwimming.java b/src/main/java/ch/njol/skript/conditions/CondIsSwimming.java index f9bf7ba7df6..9aeca7e6494 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsSwimming.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsSwimming.java @@ -2,11 +2,12 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.*; +import ch.njol.skript.doc.Example; import org.bukkit.entity.LivingEntity; @Name("Is Swimming") @Description("Checks whether a living entity is swimming.") -@Examples("player is swimming") +@Example("player is swimming") @Since("2.3") public class CondIsSwimming extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsTameable.java b/src/main/java/ch/njol/skript/conditions/CondIsTameable.java index e27c9c6f0ca..a485a79ba2a 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsTameable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsTameable.java @@ -5,17 +5,17 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @Name("Is Tameable") @Description("Check if an entity is tameable.") -@Examples({ - "on damage:", - "\tif victim is tameable:", - "\t\tcancel event" -}) +@Example(""" + on damage: + if victim is tameable: + cancel event + """) @Since("2.5") public class CondIsTameable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsTamed.java b/src/main/java/ch/njol/skript/conditions/CondIsTamed.java index 7daaa9ac2ed..2e62f8cb0a0 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsTamed.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsTamed.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Entity; @@ -10,10 +10,8 @@ @Name("Is Tamed") @Description("Check if a tameable entity is tamed (horse, parrot, cat, etc.).") -@Examples({ - "send true if {_horse} is tamed", - "tame {_horse} if {_horse} is untamed" -}) +@Example("send true if {_horse} is tamed") +@Example("tame {_horse} if {_horse} is untamed") @Since("2.10") public class CondIsTamed extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsTicking.java b/src/main/java/ch/njol/skript/conditions/CondIsTicking.java index 3843e915368..9724c2c52fe 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsTicking.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsTicking.java @@ -7,7 +7,7 @@ @Name("Is Ticking") @Description("Checks if an entity is ticking.") -@Examples("send true if target is ticking") +@Example("send true if target is ticking") @Since("2.10") public class CondIsTicking extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsTransparent.java b/src/main/java/ch/njol/skript/conditions/CondIsTransparent.java index bf6311c7daa..d5311d5e950 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsTransparent.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsTransparent.java @@ -3,7 +3,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @@ -12,7 +12,7 @@ "Checks whether an item is transparent. Note that this condition may not work for all blocks, " + "due to the transparency list used by Spigot not being completely accurate." ) -@Examples("player's tool is transparent.") +@Example("player's tool is transparent.") @Since("2.2-dev36") public class CondIsTransparent extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsUnbreakable.java b/src/main/java/ch/njol/skript/conditions/CondIsUnbreakable.java index 4f8f47e3ae1..b8dd46e3a2a 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsUnbreakable.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsUnbreakable.java @@ -3,7 +3,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -12,12 +12,14 @@ @Name("Is Unbreakable") @Description("Checks whether an item is unbreakable.") -@Examples({ - "if event-item is unbreakable:", - "\tsend \"This item is unbreakable!\" to player", - "if tool of {_p} is breakable:", - "\tsend \"Your tool is breakable!\" to {_p}" -}) +@Example(""" + if event-item is unbreakable: + send "This item is unbreakable!" to player + """) +@Example(""" + if tool of {_p} is breakable: + send "Your tool is breakable!" to {_p} + """) @Since("2.5.1, 2.9.0 (breakable)") public class CondIsUnbreakable extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsUsingFeature.java b/src/main/java/ch/njol/skript/conditions/CondIsUsingFeature.java index 00661817dd4..311b2d0fcae 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsUsingFeature.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsUsingFeature.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,10 +17,12 @@ @Name("Is Using Experimental Feature") @Description("Checks whether a script is using an experimental feature by name.") -@Examples({"the script is using \"example feature\"", - "on load:", - "\tif the script is using \"example feature\":", - "\t\tbroadcast \"You're using an experimental feature!\""}) +@Example("the script is using \"example feature\"") +@Example(""" + on load: + if the script is using "example feature": + broadcast "You're using an experimental feature!" + """) @Since("2.9.0") public class CondIsUsingFeature extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsValid.java b/src/main/java/ch/njol/skript/conditions/CondIsValid.java index f7edcf32ac9..70e17f529f2 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsValid.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsValid.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Entity; @@ -14,7 +14,7 @@ "An invalid entity may have died or de-spawned for some other reason.", "An invalid script reference may have been reloaded, moved or disabled since." }) -@Examples("if event-entity is valid") +@Example("if event-entity is valid") @Since("2.7, 2.10 (Scripts & Configs)") public class CondIsValid extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsVectorNormalized.java b/src/main/java/ch/njol/skript/conditions/CondIsVectorNormalized.java index 4267bad9992..4669194a779 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsVectorNormalized.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsVectorNormalized.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -12,7 +12,7 @@ @Name("Is Normalized") @Description("Checks whether a vector is normalized i.e. length of 1") -@Examples("vector of player's location is normalized") +@Example("vector of player's location is normalized") @Since("2.5.1") public class CondIsVectorNormalized extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsWearing.java b/src/main/java/ch/njol/skript/conditions/CondIsWearing.java index 1e9aeaaa366..534c2b03d42 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsWearing.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsWearing.java @@ -5,7 +5,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -24,10 +24,8 @@ @Name("Is Wearing") @Description("Checks whether an entity is wearing some items (usually armor).") -@Examples({ - "player is wearing an iron chestplate and iron leggings", - "target is wearing wolf armor" -}) +@Example("player is wearing an iron chestplate and iron leggings") +@Example("target is wearing wolf armor") @Since("1.0") public class CondIsWearing extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsWhitelisted.java b/src/main/java/ch/njol/skript/conditions/CondIsWhitelisted.java index f7f3d1cc4eb..3709bbde497 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsWhitelisted.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsWhitelisted.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -17,11 +17,9 @@ @Name("Is Whitelisted") @Description("Whether or not the server or a player is whitelisted, or the server is whitelist enforced.") -@Examples({ - "if the player is whitelisted:", - "if the server is whitelisted:", - "if the server whitelist is enforced:" -}) +@Example("if the player is whitelisted:") +@Example("if the server is whitelisted:") +@Example("if the server whitelist is enforced:") @Since("2.5.2, 2.9.0 (enforce, offline players)") @RequiredPlugins("MC 1.17+ (enforce)") public class CondIsWhitelisted extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondIsWithin.java b/src/main/java/ch/njol/skript/conditions/CondIsWithin.java index ccc7578eada..205564ac6f2 100644 --- a/src/main/java/ch/njol/skript/conditions/CondIsWithin.java +++ b/src/main/java/ch/njol/skript/conditions/CondIsWithin.java @@ -27,23 +27,27 @@ "Note that using the is between condition will refer to a straight line " + "between locations, while this condition will refer to the cuboid between locations." }) -@Examples({ - "if player's location is within {_loc1} and {_loc2}:", - "\tsend \"You are in a PvP zone!\" to player", - "", - "if player is in world(\"world\"):", - "\tsend \"You are in the overworld!\" to player", - "", - "if attacker's location is inside of victim:", - "\tcancel event", - "\tsend \"Back up!\" to attacker and victim", - "", - "if player is in world \"world1\" or world \"world2\":", - "\tkill player", - "", - "if player is in world \"world\" and chunk at location(0, 0, 0):", - "\tgive player 1 diamond" -}) +@Example(""" + if player's location is within {_loc1} and {_loc2}: + send "You are in a PvP zone!" to player + """) +@Example(""" + if player is in world("world"): + send "You are in the overworld!" to player + """) +@Example(""" + if attacker's location is inside of victim: + cancel event + send "Back up!" to attacker and victim + """) +@Example(""" + if player is in world "world1" or world "world2": + kill player + """) +@Example(""" + if player is in world "world" and chunk at location(0, 0, 0): + give player 1 diamond + """) @Since("2.7, 2.11 (world borders)") @RequiredPlugins("MC 1.17+ (within block)") public class CondIsWithin extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondItemDespawn.java b/src/main/java/ch/njol/skript/conditions/CondItemDespawn.java index 1ee67f45eaf..a3e38015eaa 100644 --- a/src/main/java/ch/njol/skript/conditions/CondItemDespawn.java +++ b/src/main/java/ch/njol/skript/conditions/CondItemDespawn.java @@ -2,17 +2,17 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.Item; @Name("Will Despawn") @Description("Checks if the dropped item will be despawned naturally through Minecraft's timer.") -@Examples({ - "if all dropped items can despawn naturally:", - "\tprevent all dropped items from naturally despawning" -}) +@Example(""" + if all dropped items can despawn naturally: + prevent all dropped items from naturally despawning + """) @Since("2.11") public class CondItemDespawn extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondItemEnchantmentGlint.java b/src/main/java/ch/njol/skript/conditions/CondItemEnchantmentGlint.java index 694a786b656..aa93247cf8c 100644 --- a/src/main/java/ch/njol/skript/conditions/CondItemEnchantmentGlint.java +++ b/src/main/java/ch/njol/skript/conditions/CondItemEnchantmentGlint.java @@ -12,17 +12,18 @@ @Name("Item Has Enchantment Glint Override") @Description("Checks whether an item has the enchantment glint overridden, or is forced to glint or not.") -@Examples({ - "if the player's tool has the enchantment glint override", - "\tsend \"Your tool has the enchantment glint override.\" to player", - "", - "if {_item} is forced to glint:", - "\tsend \"This item is forced to glint.\" to player", - "else if {_item} is forced to not glint:", - "\tsend \"This item is forced to not glint.\" to player", - "else:", - "\tsend \"This item does not have any glint override.\" to player" -}) +@Example(""" + if the player's tool has the enchantment glint override + send "Your tool has the enchantment glint override." to player + """) +@Example(""" + if {_item} is forced to glint: + send "This item is forced to glint." to player + else if {_item} is forced to not glint: + send "This item is forced to not glint." to player + else: + send "This item does not have any glint override." to player + """) @RequiredPlugins("Spigot 1.20.5+") @Since("2.10") public class CondItemEnchantmentGlint extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondItemInHand.java b/src/main/java/ch/njol/skript/conditions/CondItemInHand.java index 9d5123a31ab..aebf3e85def 100644 --- a/src/main/java/ch/njol/skript/conditions/CondItemInHand.java +++ b/src/main/java/ch/njol/skript/conditions/CondItemInHand.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import org.skriptlang.skript.lang.comparator.Relation; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -19,10 +19,8 @@ @Name("Is Holding") @Description("Checks whether a player is holding a specific item. Cannot be used with endermen, use 'entity is [not] an enderman holding <item type>' instead.") -@Examples({ - "player is holding a stick", - "victim isn't holding a diamond sword of sharpness" -}) +@Example("player is holding a stick") +@Example("victim isn't holding a diamond sword of sharpness") @Since("1.0") public class CondItemInHand extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondLeashWillDrop.java b/src/main/java/ch/njol/skript/conditions/CondLeashWillDrop.java index 0e63265f726..b2a79a937fa 100644 --- a/src/main/java/ch/njol/skript/conditions/CondLeashWillDrop.java +++ b/src/main/java/ch/njol/skript/conditions/CondLeashWillDrop.java @@ -13,13 +13,13 @@ @Name("Leash Will Drop") @Description("Checks whether the leash item will drop during the leash detaching in an unleash event.") -@Examples({ - "on unleash:", - "\tif the leash will drop:", - "\t\tprevent the leash from dropping", - "\telse:", - "\t\tallow the leash to drop" -}) +@Example(""" + on unleash: + if the leash will drop: + prevent the leash from dropping + else: + allow the leash to drop + """) @Keywords("lead") @Events("Unleash") @Since("2.10") diff --git a/src/main/java/ch/njol/skript/conditions/CondLeashed.java b/src/main/java/ch/njol/skript/conditions/CondLeashed.java index f2fb1fa887d..dcc4be33328 100644 --- a/src/main/java/ch/njol/skript/conditions/CondLeashed.java +++ b/src/main/java/ch/njol/skript/conditions/CondLeashed.java @@ -2,14 +2,14 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @Name("Is Leashed") @Description("Checks to see if an entity is currently leashed.") -@Examples("target entity is leashed") +@Example("target entity is leashed") @Since("2.5") public class CondLeashed extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondLidState.java b/src/main/java/ch/njol/skript/conditions/CondLidState.java index d401bd63461..f56c8316894 100644 --- a/src/main/java/ch/njol/skript/conditions/CondLidState.java +++ b/src/main/java/ch/njol/skript/conditions/CondLidState.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -16,10 +16,10 @@ @Name("Lid Is Open/Closed") @Description("Check to see whether lidded blocks (chests, shulkers, etc.) are open or closed.") -@Examples({ - "if the lid of {_chest} is closed:", - "\topen the lid of {_block}" -}) +@Example(""" + if the lid of {_chest} is closed: + open the lid of {_block} + """) @Since("2.10") public class CondLidState extends PropertyCondition { diff --git a/src/main/java/ch/njol/skript/conditions/CondMatches.java b/src/main/java/ch/njol/skript/conditions/CondMatches.java index d29643ffcc2..73ca21d9284 100644 --- a/src/main/java/ch/njol/skript/conditions/CondMatches.java +++ b/src/main/java/ch/njol/skript/conditions/CondMatches.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -20,11 +20,13 @@ @Name("Matches") @Description("Checks whether the defined strings match the input regexes (Regular expressions).") -@Examples({"on chat:", - "\tif message partially matches \"\\d\":", - "\t\tsend \"Message contains a digit!\"", - "\tif message doesn't match \"[A-Za-z]+\":", - "\t\tsend \"Message doesn't only contain letters!\""}) +@Example(""" + on chat: + if message partially matches "\\d": + send "Message contains a digit!" + if message doesn't match "[A-Za-z]+": + send "Message doesn't only contain letters!" + """) @Since("2.5.2") public class CondMatches extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondMinecraftVersion.java b/src/main/java/ch/njol/skript/conditions/CondMinecraftVersion.java index 6160a400219..b9719988153 100644 --- a/src/main/java/ch/njol/skript/conditions/CondMinecraftVersion.java +++ b/src/main/java/ch/njol/skript/conditions/CondMinecraftVersion.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -18,7 +18,7 @@ @Name("Running Minecraft") @Description("Checks if current Minecraft version is given version or newer.") -@Examples("running minecraft \"1.14\"") +@Example("running minecraft \"1.14\"") @Since("2.5") public class CondMinecraftVersion extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondPandaIsOnBack.java b/src/main/java/ch/njol/skript/conditions/CondPandaIsOnBack.java index 2f48130edac..2b941910aa3 100644 --- a/src/main/java/ch/njol/skript/conditions/CondPandaIsOnBack.java +++ b/src/main/java/ch/njol/skript/conditions/CondPandaIsOnBack.java @@ -2,7 +2,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import org.bukkit.entity.LivingEntity; @@ -10,7 +10,7 @@ @Name("Panda Is On Its Back") @Description("Whether a panda is on its back.") -@Examples(""" +@Example(""" if last spawned panda is on its back: make last spawned panda get off its back """) diff --git a/src/main/java/ch/njol/skript/conditions/CondPastFuture.java b/src/main/java/ch/njol/skript/conditions/CondPastFuture.java index 916a35e653a..f7d7bb15b05 100644 --- a/src/main/java/ch/njol/skript/conditions/CondPastFuture.java +++ b/src/main/java/ch/njol/skript/conditions/CondPastFuture.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.ExprNow; @@ -22,21 +22,23 @@ "Checks whether a date is in the past or future.", "Note that using the 'now' expression will not be in the past or future when used directly in the condition." }) -@Examples({ - "set {_date} to now", - "wait 5 seconds", - "if {_date} is in the past:", - "\t# this will be true", - "", - "if now is in the future:", - "\t# this will be false", - "", - "set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now", - "if {_dates::*} are in the future:", - "\t# this will be true", - "if {_dates::*} have passed:", - "\t# this will be false" -}) +@Example(""" + set {_date} to now + wait 5 seconds + if {_date} is in the past: + # this will be true + """) +@Example(""" + if now is in the future: + # this will be false + """) +@Example(""" + set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now + if {_dates::*} are in the future: + # this will be true + if {_dates::*} have passed: + # this will be false + """) @Since("2.10") public class CondPastFuture extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondPermission.java b/src/main/java/ch/njol/skript/conditions/CondPermission.java index c6494171c22..e4f62303704 100644 --- a/src/main/java/ch/njol/skript/conditions/CondPermission.java +++ b/src/main/java/ch/njol/skript/conditions/CondPermission.java @@ -8,7 +8,7 @@ import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.conditions.base.PropertyCondition.PropertyType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -21,9 +21,11 @@ */ @Name("Has Permission") @Description("Test whether a player has a certain permission.") -@Examples({"player has permission \"skript.tree\"", - "victim has the permission \"admin\":", - " send \"You're attacking an admin!\" to attacker"}) +@Example("player has permission \"skript.tree\"") +@Example(""" + victim has the permission "admin": + send "You're attacking an admin!" to attacker + """) @Since("1.0") public class CondPermission extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondPlayedBefore.java b/src/main/java/ch/njol/skript/conditions/CondPlayedBefore.java index dc64cb20409..bf29b62366f 100644 --- a/src/main/java/ch/njol/skript/conditions/CondPlayedBefore.java +++ b/src/main/java/ch/njol/skript/conditions/CondPlayedBefore.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -16,10 +16,8 @@ @Name("Has Played Before") @Description("Checks whether a player has played on this server before. You can also use " + "on first join if you want to make triggers for new players.") -@Examples({ - "player has played on this server before", - "player hasn't played before" -}) +@Example("player has played on this server before") +@Example("player hasn't played before") @Since("1.4, 2.7 (multiple players)") public class CondPlayedBefore extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondPvP.java b/src/main/java/ch/njol/skript/conditions/CondPvP.java index 6b99b98d239..254b802dbab 100644 --- a/src/main/java/ch/njol/skript/conditions/CondPvP.java +++ b/src/main/java/ch/njol/skript/conditions/CondPvP.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -16,8 +16,8 @@ @Name("PvP") @Description("Checks the PvP state of a world.") -@Examples({"PvP is enabled", - "PvP is disabled in \"world\""}) +@Example("PvP is enabled") +@Example("PvP is disabled in \"world\"") @Since("1.3.4") public class CondPvP extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondResourcePack.java b/src/main/java/ch/njol/skript/conditions/CondResourcePack.java index f74d41bd3ae..f0ee8e6c404 100644 --- a/src/main/java/ch/njol/skript/conditions/CondResourcePack.java +++ b/src/main/java/ch/njol/skript/conditions/CondResourcePack.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -18,9 +18,11 @@ @Name("Resource Pack") @Description("Checks state of the resource pack in a resource pack request response event.") -@Examples({"on resource pack response:", - " if the resource pack wasn't accepted:", - " kick the player due to \"You have to install the resource pack to play in this server!\""}) +@Example(""" + on resource pack response: + if the resource pack wasn't accepted: + kick the player due to "You have to install the resource pack to play in this server!" + """) @Since("2.4") @Events("resource pack request response") public class CondResourcePack extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java b/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java index d2a092c49e4..055b678cd81 100644 --- a/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java +++ b/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java @@ -4,7 +4,7 @@ import ch.njol.skript.doc.Events; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,11 +17,11 @@ @Name("Is Bed/Anchor Spawn") @Description("Checks what the respawn location of a player in the respawn event is.") -@Examples({ - "on respawn:", - "\tthe respawn location is a bed", - "\tbroadcast \"%player% is respawning in their bed! So cozy!\"" -}) +@Example(""" + on respawn: + the respawn location is a bed + broadcast "%player% is respawning in their bed! So cozy!" + """) @RequiredPlugins("Minecraft 1.16+") @Since("2.7") @Events("respawn") diff --git a/src/main/java/ch/njol/skript/conditions/CondScriptLoaded.java b/src/main/java/ch/njol/skript/conditions/CondScriptLoaded.java index 67bdb250e10..b8250af8c63 100644 --- a/src/main/java/ch/njol/skript/conditions/CondScriptLoaded.java +++ b/src/main/java/ch/njol/skript/conditions/CondScriptLoaded.java @@ -4,7 +4,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.SkriptCommand; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -20,10 +20,8 @@ @Name("Is Script Loaded") @Description("Check if the current script, or another script, is currently loaded.") -@Examples({ - "script is loaded", - "script \"example.sk\" is loaded" -}) +@Example("script is loaded") +@Example("script \"example.sk\" is loaded") @Since("2.2-dev31") public class CondScriptLoaded extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondStartsEndsWith.java b/src/main/java/ch/njol/skript/conditions/CondStartsEndsWith.java index 463b3d837f5..c152b5a21f5 100644 --- a/src/main/java/ch/njol/skript/conditions/CondStartsEndsWith.java +++ b/src/main/java/ch/njol/skript/conditions/CondStartsEndsWith.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -17,8 +17,10 @@ @Name("Starts/Ends With") @Description("Checks if a text starts or ends with another.") -@Examples({"if the argument starts with \"test\" or \"debug\":", - "\tsend \"Stop!\""}) +@Example(""" + if the argument starts with "test" or "debug": + send "Stop!" + """) @Since("2.2-dev36, 2.5.1 (multiple strings support)") public class CondStartsEndsWith extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondTooltip.java b/src/main/java/ch/njol/skript/conditions/CondTooltip.java index 7f84be363a4..dab29e198b2 100644 --- a/src/main/java/ch/njol/skript/conditions/CondTooltip.java +++ b/src/main/java/ch/njol/skript/conditions/CondTooltip.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -22,10 +22,8 @@ "The 'entire tooltip' is what shows to the player when they hover an item (i.e. name, lore, etc.).", "The 'additional tooltip' hides certain information from certain items (potions, maps, books, fireworks, and banners)." }) -@Examples({ - "send true if entire tooltip of player's tool is shown", - "if additional tooltip of {_item} is hidden:" -}) +@Example("send true if entire tooltip of player's tool is shown") +@Example("if additional tooltip of {_item} is hidden:") @RequiredPlugins("Spigot 1.20.5+") @Since("2.9.0") public class CondTooltip extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondWillHatch.java b/src/main/java/ch/njol/skript/conditions/CondWillHatch.java index dfdc5d4854c..f7370647ed6 100644 --- a/src/main/java/ch/njol/skript/conditions/CondWillHatch.java +++ b/src/main/java/ch/njol/skript/conditions/CondWillHatch.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -16,11 +16,11 @@ @Name("Egg Will Hatch") @Description("Whether the egg will hatch in a Player Egg Throw event.") -@Examples({ - "on player egg throw:", - "\tif an entity won't hatch:", - "\t\tsend \"Better luck next time!\" to the player" -}) +@Example(""" + on player egg throw: + if an entity won't hatch: + send "Better luck next time!" to the player + """) @Events("Egg Throw") @Since("2.7") public class CondWillHatch extends Condition { diff --git a/src/main/java/ch/njol/skript/conditions/CondWithinRadius.java b/src/main/java/ch/njol/skript/conditions/CondWithinRadius.java index d11a2add4bd..6ee76fe426c 100644 --- a/src/main/java/ch/njol/skript/conditions/CondWithinRadius.java +++ b/src/main/java/ch/njol/skript/conditions/CondWithinRadius.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.base.PropertyCondition; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -16,12 +16,12 @@ @Name("Is Within Radius") @Description("Checks whether a location is within a certain radius of another location.") -@Examples({ - "on damage:", - "\tif attacker's location is within 10 blocks around {_spawn}:", - "\t\tcancel event", - "\t\tsend \"You can't PVP in spawn.\"" -}) +@Example(""" + on damage: + if attacker's location is within 10 blocks around {_spawn}: + cancel event + send "You can't PVP in spawn." + """) @Since("2.7") public class CondWithinRadius extends Condition { diff --git a/src/main/java/ch/njol/skript/effects/Delay.java b/src/main/java/ch/njol/skript/effects/Delay.java index 94179d8fdb0..47d822c9406 100644 --- a/src/main/java/ch/njol/skript/effects/Delay.java +++ b/src/main/java/ch/njol/skript/effects/Delay.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -25,11 +25,9 @@ @Name("Delay") @Description("Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!") -@Examples({ - "wait 2 minutes", - "halt for 5 minecraft hours", - "wait a tick" -}) +@Example("wait 2 minutes") +@Example("halt for 5 minecraft hours") +@Example("wait a tick") @Since("1.4") public class Delay extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffActionBar.java b/src/main/java/ch/njol/skript/effects/EffActionBar.java index 07647482d3c..72adf6614d9 100644 --- a/src/main/java/ch/njol/skript/effects/EffActionBar.java +++ b/src/main/java/ch/njol/skript/effects/EffActionBar.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,7 +20,7 @@ @Name("Action Bar") @Description("Sends an action bar message to the given player(s).") -@Examples("send action bar \"Hello player!\" to player") +@Example("send action bar \"Hello player!\" to player") @Since("2.3") public class EffActionBar extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffAllayCanDuplicate.java b/src/main/java/ch/njol/skript/effects/EffAllayCanDuplicate.java index cff13f84115..e5baf0b0f48 100644 --- a/src/main/java/ch/njol/skript/effects/EffAllayCanDuplicate.java +++ b/src/main/java/ch/njol/skript/effects/EffAllayCanDuplicate.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -19,10 +19,8 @@ "Set whether an allay can or cannot duplicate itself.", "This is not the same as breeding allays." }) -@Examples({ - "allow all allays to duplicate", - "prevent all allays from duplicating" -}) +@Example("allow all allays to duplicate") +@Example("prevent all allays from duplicating") @Since("2.11") public class EffAllayCanDuplicate extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffAllayDuplicate.java b/src/main/java/ch/njol/skript/effects/EffAllayDuplicate.java index f00119369cd..f1cdf9a80e1 100644 --- a/src/main/java/ch/njol/skript/effects/EffAllayDuplicate.java +++ b/src/main/java/ch/njol/skript/effects/EffAllayDuplicate.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -19,7 +19,7 @@ "Make an allay duplicate itself.", "This effect will always make an allay duplicate regardless of whether the duplicate attribute is disabled." }) -@Examples("make all allays duplicate") +@Example("make all allays duplicate") @Since("2.11") public class EffAllayDuplicate extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffApplyBoneMeal.java b/src/main/java/ch/njol/skript/effects/EffApplyBoneMeal.java index 69ffd5a2d33..970f703dc54 100644 --- a/src/main/java/ch/njol/skript/effects/EffApplyBoneMeal.java +++ b/src/main/java/ch/njol/skript/effects/EffApplyBoneMeal.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -18,7 +18,7 @@ @Name("Apply Bone Meal") @Description("Applies bone meal to a crop, sapling, or composter") -@Examples("apply 3 bone meal to event-block") +@Example("apply 3 bone meal to event-block") @RequiredPlugins("MC 1.16.2+") @Since("2.8.0") public class EffApplyBoneMeal extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffBan.java b/src/main/java/ch/njol/skript/effects/EffBan.java index 4c7c4b9902b..facf92c2ee4 100644 --- a/src/main/java/ch/njol/skript/effects/EffBan.java +++ b/src/main/java/ch/njol/skript/effects/EffBan.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -29,11 +29,11 @@ "", "Note that banning people does not kick them from the server.", "You can optionally use 'and kick' or consider using the kick effect after applying a ban."}) -@Examples({"unban player", - "ban \"127.0.0.1\"", - "IP-ban the player because \"he is an idiot\"", - "ban player due to \"inappropriate language\" for 2 days", - "ban and kick player due to \"inappropriate language\" for 2 days"}) +@Example("unban player") +@Example("ban \"127.0.0.1\"") +@Example("IP-ban the player because \"he is an idiot\"") +@Example("ban player due to \"inappropriate language\" for 2 days") +@Example("ban and kick player due to \"inappropriate language\" for 2 days") @Since("1.4, 2.1.1 (ban reason), 2.5 (timespan), 2.9.0 (kick)") public class EffBan extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffBlockUpdate.java b/src/main/java/ch/njol/skript/effects/EffBlockUpdate.java index 604f8a744b0..8817fc9815e 100644 --- a/src/main/java/ch/njol/skript/effects/EffBlockUpdate.java +++ b/src/main/java/ch/njol/skript/effects/EffBlockUpdate.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -21,11 +21,9 @@ "Using 'without physics' will not send updates to the surrounding blocks of the blocks being set.", "Example: Updating a block next to a sand block in the air 'without physics' will not cause the sand block to fall." }) -@Examples({ - "update {_blocks::*} as gravel", - "update {_blocks::*} to be sand without physics updates", - "update {_blocks::*} as stone without neighbouring updates" -}) +@Example("update {_blocks::*} as gravel") +@Example("update {_blocks::*} to be sand without physics updates") +@Example("update {_blocks::*} as stone without neighbouring updates") @Since("2.10") // Originally sourced from SkBee by ShaneBee (https://github.com/ShaneBeee/SkBee/blob/master/src/main/java/com/shanebeestudios/skbee/elements/other/effects/EffBlockstateUpdate.java) public class EffBlockUpdate extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffBreakNaturally.java b/src/main/java/ch/njol/skript/effects/EffBreakNaturally.java index 2b1cce956dc..51ab3c3f020 100644 --- a/src/main/java/ch/njol/skript/effects/EffBreakNaturally.java +++ b/src/main/java/ch/njol/skript/effects/EffBreakNaturally.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,9 +20,18 @@ @Description({"Breaks the block and spawns items as if a player had mined it", "\nYou can add a tool, which will spawn items based on how that tool would break the block ", "(ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)"}) -@Examples({"on right click:", "\tbreak clicked block naturally", - "loop blocks in radius 10 around player:", "\tbreak loop-block using player's tool", - "loop blocks in radius 10 around player:", "\tbreak loop-block naturally using diamond pickaxe"}) +@Example(""" + on right click: + break clicked block naturally + """) +@Example(""" + loop blocks in radius 10 around player: + break loop-block using player's tool + """) +@Example(""" + loop blocks in radius 10 around player: + break loop-block naturally using diamond pickaxe + """) @Since("2.4") public class EffBreakNaturally extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffBroadcast.java b/src/main/java/ch/njol/skript/effects/EffBroadcast.java index 573c5532545..bd08301909a 100644 --- a/src/main/java/ch/njol/skript/effects/EffBroadcast.java +++ b/src/main/java/ch/njol/skript/effects/EffBroadcast.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.ExprColoured; @@ -34,10 +34,8 @@ @Name("Broadcast") @Description("Broadcasts a message to the server.") -@Examples({ - "broadcast \"Welcome %player% to the server!\"", - "broadcast \"Woah! It's a message!\"" -}) +@Example("broadcast \"Welcome %player% to the server!\"") +@Example("broadcast \"Woah! It's a message!\"") @Since("1.0, 2.6 (broadcasting objects), 2.6.1 (using advanced formatting)") public class EffBroadcast extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCancelCooldown.java b/src/main/java/ch/njol/skript/effects/EffCancelCooldown.java index a8706029d00..118f73b3eed 100644 --- a/src/main/java/ch/njol/skript/effects/EffCancelCooldown.java +++ b/src/main/java/ch/njol/skript/effects/EffCancelCooldown.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.command.ScriptCommandEvent; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,17 +17,18 @@ @Name("Cancel Command Cooldown") @Description({"Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown."}) -@Examples({ - "command /nick <text>:", - "\texecutable by: players", - "\tcooldown: 10 seconds", - "\ttrigger:", - "\t\tif length of arg-1 is more than 16:", - "\t\t\t# Makes it so that invalid arguments don't make you wait for the cooldown again", - "\t\t\tcancel the cooldown", - "\t\t\tsend \"Your nickname may be at most 16 characters.\"", - "\t\t\tstop", - "\t\tset the player's display name to arg-1"}) +@Example(""" + command /nick <text>: + executable by: players + cooldown: 10 seconds + trigger: + if length of arg-1 is more than 16: + # Makes it so that invalid arguments don't make you wait for the cooldown again + cancel the cooldown + send "Your nickname may be at most 16 characters." + stop + set the player's display name to arg-1 + """) @Since("2.2-dev34") public class EffCancelCooldown extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCancelEvent.java b/src/main/java/ch/njol/skript/effects/EffCancelEvent.java index 3343f032cdf..caf84b11993 100644 --- a/src/main/java/ch/njol/skript/effects/EffCancelEvent.java +++ b/src/main/java/ch/njol/skript/effects/EffCancelEvent.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.bukkitutil.PlayerUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.events.EvtClick; @@ -26,12 +26,12 @@ @Name("Cancel Event") @Description("Cancels the event (e.g. prevent blocks from being placed, or damage being taken).") -@Examples({ - "on damage:", - "\tvictim is a player", - "\tvictim has the permission \"skript.god\"", - "\tcancel the event" -}) +@Example(""" + on damage: + victim is a player + victim has the permission "skript.god" + cancel the event + """) @Since("1.0") public class EffCancelEvent extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCancelItemUse.java b/src/main/java/ch/njol/skript/effects/EffCancelItemUse.java index 7cc169f99ce..18e4d5ba94e 100644 --- a/src/main/java/ch/njol/skript/effects/EffCancelItemUse.java +++ b/src/main/java/ch/njol/skript/effects/EffCancelItemUse.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -18,11 +18,11 @@ "Interrupts the action entities may be trying to complete.", "For example, interrupting eating, or drawing back a bow." }) -@Examples({ - "on damage of player:", - "\tif the victim's active tool is a bow:", - "\t\tinterrupt the usage of the player's active item" -}) +@Example(""" + on damage of player: + if the victim's active tool is a bow: + interrupt the usage of the player's active item + """) @Since("2.8.0") public class EffCancelItemUse extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffChange.java b/src/main/java/ch/njol/skript/effects/EffChange.java index 79c9351ebc2..7be3f48bc5c 100644 --- a/src/main/java/ch/njol/skript/effects/EffChange.java +++ b/src/main/java/ch/njol/skript/effects/EffChange.java @@ -6,7 +6,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.classes.ClassInfo; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.ExprParse; @@ -34,29 +34,39 @@ "A general effect that can be used for changing many expressions.", "Some expressions can only be set and/or deleted, while others can also have things added to or removed from them." }) -@Examples({ - "# Set", - "Set the player's display name to \"<red>%name of player%\"", - "set the block above the victim to lava", - "# Add", - "add 2 to the player's health # preferably use 'heal' for this", - "add argument to {blacklist::*}", - "give a diamond pickaxe of efficiency 5 to the player", - "increase the data value of the clicked block by 1", - "# Remove", - "remove 2 pickaxes from the victim", - "subtract 2.5 from {points::%uuid of player%}", - "# Remove All", - "remove every iron tool from the player", - "remove all minecarts from {entitylist::*}", - "# Delete", - "delete the block below the player", - "clear drops", - "delete {variable}", - "# Reset", - "reset walk speed of player", - "reset chunk at the targeted block" -}) +@Example(""" + # Set + Set the player's display name to "<red>%name of player%" + set the block above the victim to lava + """) +@Example(""" + # Add + add 2 to the player's health # preferably use 'heal' for this + add argument to {blacklist::*} + give a diamond pickaxe of efficiency 5 to the player + increase the data value of the clicked block by 1 + """) +@Example(""" + # Remove + remove 2 pickaxes from the victim + subtract 2.5 from {points::%uuid of player%} + """) +@Example(""" + # Remove All + remove every iron tool from the player + remove all minecarts from {entitylist::*} + """) +@Example(""" + # Delete + delete the block below the player + clear drops + delete {variable} + """) +@Example(""" + # Reset + reset walk speed of player + reset chunk at the targeted block + """) @Since("1.0 (set, add, remove, delete), 2.0 (remove all)") public class EffChange extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCharge.java b/src/main/java/ch/njol/skript/effects/EffCharge.java index 45563cf9d8d..0d53e1b9773 100644 --- a/src/main/java/ch/njol/skript/effects/EffCharge.java +++ b/src/main/java/ch/njol/skript/effects/EffCharge.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,10 +17,10 @@ @Name("Charge Entity") @Description("Charges or uncharges a creeper or wither skull. A creeper is charged when it has been struck by lightning.") -@Examples({ - "on spawn of creeper:", - "\tcharge the event-entity" -}) +@Example(""" + on spawn of creeper: + charge the event-entity + """) @Since("2.5, 2.10 (wither skulls)") public class EffCharge extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffClearEntityStorage.java b/src/main/java/ch/njol/skript/effects/EffClearEntityStorage.java index 51dcbd4ad21..abd95630583 100644 --- a/src/main/java/ch/njol/skript/effects/EffClearEntityStorage.java +++ b/src/main/java/ch/njol/skript/effects/EffClearEntityStorage.java @@ -13,7 +13,7 @@ @Name("Clear Entity Storage") @Description("Clear the stored entities of an entity block storage (i.e. beehive).") -@Examples("clear the stored entities of {_beehive}") +@Example("clear the stored entities of {_beehive}") @Since("2.11") public class EffClearEntityStorage extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffColorItems.java b/src/main/java/ch/njol/skript/effects/EffColorItems.java index e163eebbf02..81e19824633 100644 --- a/src/main/java/ch/njol/skript/effects/EffColorItems.java +++ b/src/main/java/ch/njol/skript/effects/EffColorItems.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -27,8 +27,8 @@ "You can also use RGB codes if you feel limited with the 16 default colors. " + "RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. " + "Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.") -@Examples({"dye player's helmet blue", - "color the player's tool red"}) +@Example("dye player's helmet blue") +@Example("color the player's tool red") @Since("2.0, 2.2-dev26 (maps and potions)") public class EffColorItems extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCommand.java b/src/main/java/ch/njol/skript/effects/EffCommand.java index 22f16cbe01a..851a30aa710 100644 --- a/src/main/java/ch/njol/skript/effects/EffCommand.java +++ b/src/main/java/ch/njol/skript/effects/EffCommand.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -25,11 +25,9 @@ "If the command is a bungeecord side command, " + "you can use the [bungeecord] option to execute command on the proxy." }) -@Examples({ - "make player execute command \"/home\"", - "execute console command \"/say Hello everyone!\"", - "execute player bungeecord command \"/alert &6Testing Announcement!\"" -}) +@Example("make player execute command \"/home\"") +@Example("execute console command \"/say Hello everyone!\"") +@Example("execute player bungeecord command \"/alert &6Testing Announcement!\"") @Since("1.0, 2.8.0 (bungeecord command)") public class EffCommand extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCommandBlockConditional.java b/src/main/java/ch/njol/skript/effects/EffCommandBlockConditional.java index e4a7101d34a..84eb2c45cfa 100644 --- a/src/main/java/ch/njol/skript/effects/EffCommandBlockConditional.java +++ b/src/main/java/ch/njol/skript/effects/EffCommandBlockConditional.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -18,10 +18,8 @@ @Description( "Sets whether the provided command blocks are conditional or not." ) -@Examples({ - "make command block {_block} conditional", - "make command block {_block} unconditional if {_block} is conditional" -}) +@Example("make command block {_block} conditional") +@Example("make command block {_block} unconditional if {_block} is conditional") @Since("2.10") public class EffCommandBlockConditional extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffConnect.java b/src/main/java/ch/njol/skript/effects/EffConnect.java index f2c848eb4be..2b5021e6ce8 100644 --- a/src/main/java/ch/njol/skript/effects/EffConnect.java +++ b/src/main/java/ch/njol/skript/effects/EffConnect.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,11 +22,9 @@ "When transferring players using an IP, the transfer will not complete if the `accepts-transfers` option isn't enabled in `server.properties` for the server specified.", "If the port is not provided, it will default to `25565`." }) -@Examples({ - "connect all players to proxy server \"hub\"", - "transfer player to server \"my.server.com\"", - "transfer player to server \"localhost\" on port 25566" -}) +@Example("connect all players to proxy server \"hub\"") +@Example("transfer player to server \"my.server.com\"") +@Example("transfer player to server \"localhost\" on port 25566") @Since("2.3, 2.10 (transfer)") public class EffConnect extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffContinue.java b/src/main/java/ch/njol/skript/effects/EffContinue.java index 3c3fb33a407..dcbd15be0d4 100644 --- a/src/main/java/ch/njol/skript/effects/EffContinue.java +++ b/src/main/java/ch/njol/skript/effects/EffContinue.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.data.JavaClasses; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.*; @@ -20,22 +20,23 @@ @Name("Continue") @Description("Moves the loop to the next iteration. You may also continue an outer loop from an inner one." + " The loops are labelled from 1 until the current loop, starting with the outermost one.") -@Examples({ - "# Broadcast online moderators", - "loop all players:", - "\tif loop-value does not have permission \"moderator\":", - "\t\tcontinue # filter out non moderators", - "\tbroadcast \"%loop-player% is a moderator!\" # Only moderators get broadcast", - " ", - "# Game starting counter", - "set {_counter} to 11", - "while {_counter} > 0:", - "\tremove 1 from {_counter}", - "\twait a second", - "\tif {_counter} != 1, 2, 3, 5 or 10:", - "\t\tcontinue # only print when counter is 1, 2, 3, 5 or 10", - "\tbroadcast \"Game starting in %{_counter}% second(s)\"", -}) +@Example(""" + # Broadcast online moderators + loop all players: + if loop-value does not have permission "moderator": + continue # filter out non moderators + broadcast "%loop-player% is a moderator!" # Only moderators get broadcast + """) +@Example(""" + # Game starting counter + set {_counter} to 11 + while {_counter} > 0: + remove 1 from {_counter} + wait a second + if {_counter} != 1, 2, 3, 5 or 10: + continue # only print when counter is 1, 2, 3, 5 or 10 + broadcast "Game starting in %{_counter}% second(s)" + """) @Since("2.2-dev37, 2.7 (while loops), 2.8.0 (outer loops)") public class EffContinue extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCopy.java b/src/main/java/ch/njol/skript/effects/EffCopy.java index aff8c37207e..2a5ab0de586 100644 --- a/src/main/java/ch/njol/skript/effects/EffCopy.java +++ b/src/main/java/ch/njol/skript/effects/EffCopy.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Keywords; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @@ -26,14 +26,14 @@ "Copies objects into a variable. When copying a list over to another list, the source list and its sublists are also copied over.", "Note: Copying a value into a variable/list will overwrite the existing data." }) -@Examples({ - "set {_foo::bar} to 1", - "set {_foo::sublist::foobar} to \"hey\"", - "copy {_foo::*} to {_copy::*}", - "broadcast indices of {_copy::*} # bar, sublist", - "broadcast {_copy::bar} # 1", - "broadcast {_copy::sublist::foobar} # \"hey!\"" -}) +@Example(""" + set {_foo::bar} to 1 + set {_foo::sublist::foobar} to "hey" + copy {_foo::*} to {_copy::*} + broadcast indices of {_copy::*} # bar, sublist + broadcast {_copy::bar} # 1 + broadcast {_copy::sublist::foobar} # "hey!" + """) @Since("2.8.0") @Keywords({"clone", "variable", "list"}) public class EffCopy extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffCustomName.java b/src/main/java/ch/njol/skript/effects/EffCustomName.java index b83b2f9886d..c1e0bb0bb5d 100644 --- a/src/main/java/ch/njol/skript/effects/EffCustomName.java +++ b/src/main/java/ch/njol/skript/effects/EffCustomName.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -15,10 +15,8 @@ @Name("Toggle Custom Name Visibility") @Description("Toggles the custom name visibility of an entity.") -@Examples({ - "show the custom name of event-entity", - "hide target's display name" -}) +@Example("show the custom name of event-entity") +@Example("hide target's display name") @Since("2.10") public class EffCustomName extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffDancing.java b/src/main/java/ch/njol/skript/effects/EffDancing.java index 6093efde6a8..d6e997f49be 100644 --- a/src/main/java/ch/njol/skript/effects/EffDancing.java +++ b/src/main/java/ch/njol/skript/effects/EffDancing.java @@ -25,15 +25,16 @@ "Providing a timespan only applies for piglins. It determines the length of time they will dance for. " + "If no timespan is provided, they will dance indefinitely." }) -@Examples({ - "if last spawned allay is not dancing:", - "\tmake last spawned allay start dancing", - "if block at location(0, 0, 0) is a jukebox:", - "\tmake all allays dance at location(0, 0, 0)", - "", - "make last spawned piglin start dancing", - "make all piglins dance for 5 hours" -}) +@Example(""" + if last spawned allay is not dancing: + make last spawned allay start dancing + """) +@Example(""" + if block at location(0, 0, 0) is a jukebox: + make all allays dance at location(0, 0, 0) + """) +@Example("make last spawned piglin start dancing") +@Example("make all piglins dance for 5 hours") @Since("2.11") public class EffDancing extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffDetonate.java b/src/main/java/ch/njol/skript/effects/EffDetonate.java index df374e4b598..cadf42a33df 100644 --- a/src/main/java/ch/njol/skript/effects/EffDetonate.java +++ b/src/main/java/ch/njol/skript/effects/EffDetonate.java @@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,7 +20,7 @@ @Name("Detonate Entities") @Description("Immediately detonates an entity. Accepted entities are fireworks, TNT minecarts, primed TNT, wind charges and creepers.") -@Examples("detonate last launched firework") +@Example("detonate last launched firework") @Since("2.10") public class EffDetonate extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffDoIf.java b/src/main/java/ch/njol/skript/effects/EffDoIf.java index d7343127f32..3c928b0ed30 100644 --- a/src/main/java/ch/njol/skript/effects/EffDoIf.java +++ b/src/main/java/ch/njol/skript/effects/EffDoIf.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Condition; @@ -18,8 +18,10 @@ @Name("Do If") @Description("Execute an effect if a condition is true.") -@Examples({"on join:", - "\tgive a diamond to the player if the player has permission \"rank.vip\""}) +@Example(""" + on join: + give a diamond to the player if the player has permission "rank.vip" + """) @Since("2.3") public class EffDoIf extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffDrop.java b/src/main/java/ch/njol/skript/effects/EffDrop.java index 29fb211b9ad..6299ee2c598 100644 --- a/src/main/java/ch/njol/skript/effects/EffDrop.java +++ b/src/main/java/ch/njol/skript/effects/EffDrop.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -25,8 +25,10 @@ @Name("Drop") @Description("Drops one or more items.") -@Examples({"on death of creeper:", - " drop 1 TNT"}) +@Example(""" + on death of creeper: + drop 1 TNT + """) @Since("1.0") public class EffDrop extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffDropLeash.java b/src/main/java/ch/njol/skript/effects/EffDropLeash.java index a57a7dafc22..122507773ce 100644 --- a/src/main/java/ch/njol/skript/effects/EffDropLeash.java +++ b/src/main/java/ch/njol/skript/effects/EffDropLeash.java @@ -13,13 +13,13 @@ @Name("Allow / Prevent Leash Drop") @Description("Allows or prevents the leash from being dropped in an unleash event.") -@Examples({ - "on unleash:", - "\tif player is not set:", - "\t\tprevent the leash from dropping", - "\telse if player is op:", - "\t\tallow the leash to drop" -}) +@Example(""" + on unleash: + if player is not set: + prevent the leash from dropping + else if player is op: + allow the leash to drop + """) @Keywords("lead") @Events("Unleash") @Since("2.10") diff --git a/src/main/java/ch/njol/skript/effects/EffElytraBoostConsume.java b/src/main/java/ch/njol/skript/effects/EffElytraBoostConsume.java index 003b1e038c9..2199efee982 100644 --- a/src/main/java/ch/njol/skript/effects/EffElytraBoostConsume.java +++ b/src/main/java/ch/njol/skript/effects/EffElytraBoostConsume.java @@ -12,11 +12,11 @@ @Name("Consume Boosting Firework") @Description("Prevent the firework used in an 'elytra boost' event to be consumed.") -@Examples({ - "on elytra boost:", - "\tif the used firework will be consumed:", - "\t\tprevent the used firework from being consume" -}) +@Example(""" + on elytra boost: + if the used firework will be consumed: + prevent the used firework from being consume + """) @Since("2.10") public class EffElytraBoostConsume extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffEnchant.java b/src/main/java/ch/njol/skript/effects/EffEnchant.java index 86255a549d0..f9021d64605 100644 --- a/src/main/java/ch/njol/skript/effects/EffEnchant.java +++ b/src/main/java/ch/njol/skript/effects/EffEnchant.java @@ -26,7 +26,7 @@ "optionally be allowed. Note that enchanting a book at a specific level will turn it into an enchanted book, rather " + "than a book with enchantments.") @Example("enchant the player's tool with sharpness 5") -@Example("enchant the player's tool at level 30 ") +@Example("enchant the player's tool at level 30") @Example("disenchant the player's tool") @Since("2.0, 2.13 (at level)") public class EffEnchant extends Effect { @@ -54,7 +54,7 @@ private enum Operation { private Expression level; private boolean treasure; private Operation operation; - + @Override @SuppressWarnings("unchecked") public boolean init(Expression[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { diff --git a/src/main/java/ch/njol/skript/effects/EffEndermanTeleport.java b/src/main/java/ch/njol/skript/effects/EffEndermanTeleport.java index d9ed3319eab..a8c3959b194 100644 --- a/src/main/java/ch/njol/skript/effects/EffEndermanTeleport.java +++ b/src/main/java/ch/njol/skript/effects/EffEndermanTeleport.java @@ -20,11 +20,11 @@ "Make an enderman teleport randomly or towards an entity.", "Teleporting towards an entity teleports in the direction to the entity and not to them." }) -@Examples({ - "make last spawned enderman teleport randomly", - "loop 10 times:", - "\tmake all endermen teleport towards player" -}) +@Example("make last spawned enderman teleport randomly") +@Example(""" + loop 10 times: + make all endermen teleport towards player + """) @RequiredPlugins("Minecraft 1.20.1+") @Since("2.11") public class EffEndermanTeleport extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffEnforceWhitelist.java b/src/main/java/ch/njol/skript/effects/EffEnforceWhitelist.java index f1bbe878a74..1f3f322d238 100644 --- a/src/main/java/ch/njol/skript/effects/EffEnforceWhitelist.java +++ b/src/main/java/ch/njol/skript/effects/EffEnforceWhitelist.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Since; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.lang.Effect; @@ -25,10 +25,8 @@ "Enforces or un-enforce a server's whitelist.", "All non-whitelisted players will be kicked upon enforcing the whitelist." }) -@Examples({ - "enforce the whitelist", - "unenforce the whitelist" -}) +@Example("enforce the whitelist") +@Example("unenforce the whitelist") @Since("2.9.0") @RequiredPlugins("MC 1.17+") public class EffEnforceWhitelist extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffEntityUnload.java b/src/main/java/ch/njol/skript/effects/EffEntityUnload.java index f09eb6a7947..8d899586019 100644 --- a/src/main/java/ch/njol/skript/effects/EffEntityUnload.java +++ b/src/main/java/ch/njol/skript/effects/EffEntityUnload.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,11 +20,11 @@ "More information on what and when entities despawn can be found at " + "reference." }) -@Examples({ - "make all entities not despawnable on chunk unload", - "spawn zombie at location(0, 0, 0):", - "\tforce event-entity to not despawn when far away", -}) +@Example("make all entities not despawnable on chunk unload") +@Example(""" + spawn zombie at location(0, 0, 0): + force event-entity to not despawn when far away + """) @Since("2.11") public class EffEntityUnload extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffEntityVisibility.java b/src/main/java/ch/njol/skript/effects/EffEntityVisibility.java index ef850cdb23a..9211b931cae 100644 --- a/src/main/java/ch/njol/skript/effects/EffEntityVisibility.java +++ b/src/main/java/ch/njol/skript/effects/EffEntityVisibility.java @@ -25,13 +25,12 @@ "", "Note: all previously hidden entities (including players) will be visible when a player leaves and rejoins.", }) -@Examples({ - "on spawn:", - "\tif event-entity is a chicken:", - "\t\thide event-entity", - "", - "reveal hidden players of players" -}) +@Example(""" + on spawn: + if event-entity is a chicken: + hide event-entity + """) +@Example("reveal hidden players of players") @Since("2.3, 2.10 (entities)") @RequiredPlugins("Minecraft 1.19+ (entities)") public class EffEntityVisibility extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffEquip.java b/src/main/java/ch/njol/skript/effects/EffEquip.java index 06954159076..2ff85b8b260 100644 --- a/src/main/java/ch/njol/skript/effects/EffEquip.java +++ b/src/main/java/ch/njol/skript/effects/EffEquip.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.bukkitutil.PlayerUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -37,12 +37,10 @@ "Equips or unequips an entity with the given itemtypes (usually armor).", "This effect will replace any armor that the entity is already wearing." }) -@Examples({ - "equip player with diamond helmet", - "equip player with diamond leggings, diamond chestplate, and diamond boots", - "unequip diamond chestplate from player", - "unequip player's armor" -}) +@Example("equip player with diamond helmet") +@Example("equip player with diamond leggings, diamond chestplate, and diamond boots") +@Example("unequip diamond chestplate from player") +@Example("unequip player's armor") @Since({ "1.0, 2.7 (multiple entities, unequip), 2.10 (wolves)", "2.12.1 (happy ghasts)" diff --git a/src/main/java/ch/njol/skript/effects/EffExit.java b/src/main/java/ch/njol/skript/effects/EffExit.java index f74b85b3589..70c0a31be29 100644 --- a/src/main/java/ch/njol/skript/effects/EffExit.java +++ b/src/main/java/ch/njol/skript/effects/EffExit.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.data.JavaClasses; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.*; @@ -19,15 +19,12 @@ @Name("Exit") @Description("Exits a given amount of loops and conditionals, or the entire trigger.") -@Examples({ - "if player has any ore:", - "\tstop", - "message \"%player% has no ores!\"", - "loop blocks above the player:", - "\tloop-block is not air:", - "\t\texit 2 sections", - "\tset loop-block to water" -}) +@Example(""" + loop blocks above the player: + loop-block is not air: + exit 2 sections + set loop-block to water + """) @Since("unknown (before 2.1)") public class EffExit extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffExplodeCreeper.java b/src/main/java/ch/njol/skript/effects/EffExplodeCreeper.java index 36c2dde6b6f..70fc0873630 100644 --- a/src/main/java/ch/njol/skript/effects/EffExplodeCreeper.java +++ b/src/main/java/ch/njol/skript/effects/EffExplodeCreeper.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,8 +17,8 @@ @Name("Explode Creeper") @Description("Starts the explosion process of a creeper or instantly explodes it.") -@Examples({"start explosion of the last spawned creeper", - "stop ignition of the last spawned creeper"}) +@Example("start explosion of the last spawned creeper") +@Example("stop ignition of the last spawned creeper") @Since("2.5") public class EffExplodeCreeper extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffExplosion.java b/src/main/java/ch/njol/skript/effects/EffExplosion.java index 93c413aa47d..3425f13bd58 100644 --- a/src/main/java/ch/njol/skript/effects/EffExplosion.java +++ b/src/main/java/ch/njol/skript/effects/EffExplosion.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -23,8 +23,8 @@ "which lists the explosion forces of TNT, creepers, etc.", "Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0.", "Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks."}) -@Examples({"create an explosion of force 10 at the player", - "create an explosion of force 0 at the victim"}) +@Example("create an explosion of force 10 at the player") +@Example("create an explosion of force 0 at the victim") @Since("1.0") public class EffExplosion extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffFeed.java b/src/main/java/ch/njol/skript/effects/EffFeed.java index 4ca51be1bbd..0fda08e422a 100644 --- a/src/main/java/ch/njol/skript/effects/EffFeed.java +++ b/src/main/java/ch/njol/skript/effects/EffFeed.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -15,7 +15,8 @@ @Name("Feed") @Description("Feeds the specified players.") -@Examples({"feed all players", "feed the player by 5 beefs"}) +@Example("feed all players") +@Example("feed the player by 5 beefs") @Since("2.2-dev34") public class EffFeed extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffFireResistant.java b/src/main/java/ch/njol/skript/effects/EffFireResistant.java index 4f6593c264e..73c172f82d2 100644 --- a/src/main/java/ch/njol/skript/effects/EffFireResistant.java +++ b/src/main/java/ch/njol/skript/effects/EffFireResistant.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -17,10 +17,8 @@ @Name("Make Fire Resistant") @Description("Makes items fire resistant.") -@Examples({ - "make player's tool fire resistant", - "make {_items::*} not resistant to fire" -}) +@Example("make player's tool fire resistant") +@Example("make {_items::*} not resistant to fire") @RequiredPlugins("Spigot 1.20.5+") @Since("2.9.0") public class EffFireResistant extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java b/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java index 1f44850104a..a56d0a69b0e 100644 --- a/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java +++ b/src/main/java/ch/njol/skript/effects/EffFireworkLaunch.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -21,7 +21,7 @@ @Name("Launch firework") @Description("Launch firework effects at the given location(s).") -@Examples("launch ball large colored red, purple and white fading to light green and black at player's location with duration 1") +@Example("launch ball large colored red, purple and white fading to light green and black at player's location with duration 1") @Since("2.4") public class EffFireworkLaunch extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffForceAttack.java b/src/main/java/ch/njol/skript/effects/EffForceAttack.java index d378e7795bd..131c5de5bb9 100644 --- a/src/main/java/ch/njol/skript/effects/EffForceAttack.java +++ b/src/main/java/ch/njol/skript/effects/EffForceAttack.java @@ -31,8 +31,6 @@ spawn a wolf at location(0, 0, 0) spawn a zombie at location(0, 0, 0) make player damage last spawned zombie by 2 """) -@Examples({"spawn a wolf at player's location", - "make last spawned wolf attack player"}) @Since("2.5.1, 2.13 (multiple, amount)") @RequiredPlugins("Minecraft 1.15.2+") public class EffForceAttack extends Effect implements SyntaxRuntimeErrorProducer { diff --git a/src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java b/src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java index 24f14e6ac7c..956e4302344 100644 --- a/src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java +++ b/src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java @@ -14,10 +14,8 @@ @Name("Force Enchantment Glint") @Description("Forces the items to glint or not, or removes its existing enchantment glint enforcement.") -@Examples({ - "force {_items::*} to glint", - "force the player's tool to stop glinting" -}) +@Example("force {_items::*} to glint") +@Example("force the player's tool to stop glinting") @RequiredPlugins("Spigot 1.20.5+") @Since("2.10") public class EffForceEnchantmentGlint extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffGlowingText.java b/src/main/java/ch/njol/skript/effects/EffGlowingText.java index 8cd0b84da86..3f54bd94fc0 100644 --- a/src/main/java/ch/njol/skript/effects/EffGlowingText.java +++ b/src/main/java/ch/njol/skript/effects/EffGlowingText.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -21,7 +21,7 @@ @Name("Make Sign Glow") @Description("Makes a sign (either a block or item) have glowing text or normal text") -@Examples("make target block of player have glowing text") +@Example("make target block of player have glowing text") @Since("2.8.0") public class EffGlowingText extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffGoatHorns.java b/src/main/java/ch/njol/skript/effects/EffGoatHorns.java index e6200f8094a..00b22a3a1f2 100644 --- a/src/main/java/ch/njol/skript/effects/EffGoatHorns.java +++ b/src/main/java/ch/njol/skript/effects/EffGoatHorns.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,11 +17,9 @@ @Name("Goat Horns") @Description("Make a goat have or not have a left, right, or both horns.") -@Examples({ - "remove the left horn of last spawned goat", - "regrow {_goat}'s horns", - "remove both horns of all goats" -}) +@Example("remove the left horn of last spawned goat") +@Example("regrow {_goat}'s horns") +@Example("remove both horns of all goats") @Since("2.11") public class EffGoatHorns extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffGoatRam.java b/src/main/java/ch/njol/skript/effects/EffGoatRam.java index 402d3fabad6..8328c1971d6 100644 --- a/src/main/java/ch/njol/skript/effects/EffGoatRam.java +++ b/src/main/java/ch/njol/skript/effects/EffGoatRam.java @@ -16,7 +16,7 @@ "Make a goat ram an entity.", "Ramming does have a cooldown and currently no way to change it." }) -@Examples("make all goats ram player") +@Example("make all goats ram player") @Since("2.11") public class EffGoatRam extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffHandedness.java b/src/main/java/ch/njol/skript/effects/EffHandedness.java index d7f29122d3e..abf88f5fc86 100644 --- a/src/main/java/ch/njol/skript/effects/EffHandedness.java +++ b/src/main/java/ch/njol/skript/effects/EffHandedness.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,12 +16,11 @@ @Name("Handedness") @Description("Make mobs left or right-handed. This does not affect players.") -@Examples({ - "spawn skeleton at spawn of world \"world\":", - "\tmake entity left handed", - "", - "make all zombies in radius 10 of player right handed" -}) +@Example(""" + spawn skeleton at spawn of world "world": + make entity left handed + """) +@Example("make all zombies in radius 10 of player right handed") @Since("2.8.0") public class EffHandedness extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffHealth.java b/src/main/java/ch/njol/skript/effects/EffHealth.java index 74892aab36e..c801835763f 100644 --- a/src/main/java/ch/njol/skript/effects/EffHealth.java +++ b/src/main/java/ch/njol/skript/effects/EffHealth.java @@ -7,7 +7,7 @@ import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.config.Node; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -34,12 +34,10 @@ "Damage, heal, or repair an entity or item.", "Servers running Spigot 1.20.4+ can optionally choose to specify a fake damage cause." }) -@Examples({ - "damage player by 5 hearts", - "damage player by 3 hearts with fake cause fall", - "heal the player", - "repair tool of player" -}) +@Example("damage player by 5 hearts") +@Example("damage player by 3 hearts with fake cause fall") +@Example("heal the player") +@Example("repair tool of player") @Since("1.0, 2.10 (damage cause)") @RequiredPlugins("Spigot 1.20.4+ (for damage cause)") public class EffHealth extends Effect implements SyntaxRuntimeErrorProducer { diff --git a/src/main/java/ch/njol/skript/effects/EffHidePlayerFromServerList.java b/src/main/java/ch/njol/skript/effects/EffHidePlayerFromServerList.java index 45b564b5140..2c267191685 100644 --- a/src/main/java/ch/njol/skript/effects/EffHidePlayerFromServerList.java +++ b/src/main/java/ch/njol/skript/effects/EffHidePlayerFromServerList.java @@ -12,7 +12,7 @@ import com.google.common.collect.Iterators; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -23,8 +23,10 @@ @Name("Hide Player from Server List") @Description({"Hides a player from the hover list " + "and decreases the online players count (only if the player count wasn't changed before)."}) -@Examples({"on server list ping:", - " hide {vanished::*} from the server list"}) +@Example(""" + on server list ping: + hide {vanished::*} from the server list + """) @Since("2.3") public class EffHidePlayerFromServerList extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffIgnite.java b/src/main/java/ch/njol/skript/effects/EffIgnite.java index 20392f897d3..acb905e1531 100644 --- a/src/main/java/ch/njol/skript/effects/EffIgnite.java +++ b/src/main/java/ch/njol/skript/effects/EffIgnite.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,10 +20,8 @@ @Name("Ignite/Extinguish") @Description("Lights entities on fire or extinguishes them.") -@Examples({ - "ignite the player", - "extinguish the player" -}) +@Example("ignite the player") +@Example("extinguish the player") @Since("1.4") public class EffIgnite extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffIncendiary.java b/src/main/java/ch/njol/skript/effects/EffIncendiary.java index 181444137cf..1ef9c3dd506 100644 --- a/src/main/java/ch/njol/skript/effects/EffIncendiary.java +++ b/src/main/java/ch/njol/skript/effects/EffIncendiary.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -19,8 +19,10 @@ @Name("Make Incendiary") @Description("Sets if an entity's explosion will leave behind fire. This effect is also usable in an explosion prime event.") -@Examples({"on explosion prime:", - "\tmake the explosion fiery"}) +@Example(""" + on explosion prime: + make the explosion fiery + """) @Since("2.5") public class EffIncendiary extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffInsertEntityStorage.java b/src/main/java/ch/njol/skript/effects/EffInsertEntityStorage.java index d159ddfd717..cdac3816e76 100644 --- a/src/main/java/ch/njol/skript/effects/EffInsertEntityStorage.java +++ b/src/main/java/ch/njol/skript/effects/EffInsertEntityStorage.java @@ -24,7 +24,7 @@ "The entity must be of the right type for the block (e.g. bee for beehive).", "Due to unstable behavior on older versions, adding entities to an entity storage requires Minecraft version 1.21+." }) -@Examples("add last spawned bee into the entity storage of {_beehive}") +@Example("add last spawned bee into the entity storage of {_beehive}") @RequiredPlugins("Minecraft 1.21+") @Since("2.11") public class EffInsertEntityStorage extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffInvisible.java b/src/main/java/ch/njol/skript/effects/EffInvisible.java index 4c53ca9c938..790b1bb8518 100644 --- a/src/main/java/ch/njol/skript/effects/EffInvisible.java +++ b/src/main/java/ch/njol/skript/effects/EffInvisible.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -19,7 +19,7 @@ "Makes a living entity visible/invisible. This is not a potion and therefore does not have features such as a time limit or particles.", "When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility." }) -@Examples("make target entity invisible") +@Example("make target entity invisible") @Since("2.7") public class EffInvisible extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffInvulnerability.java b/src/main/java/ch/njol/skript/effects/EffInvulnerability.java index 9585f88b97f..d309d2fad7c 100644 --- a/src/main/java/ch/njol/skript/effects/EffInvulnerability.java +++ b/src/main/java/ch/njol/skript/effects/EffInvulnerability.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,7 +16,7 @@ @Name("Make Invulnerable") @Description("Makes an entity invulnerable/not invulnerable.") -@Examples("make target entity invulnerable") +@Example("make target entity invulnerable") @Since("2.5") public class EffInvulnerability extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffItemDespawn.java b/src/main/java/ch/njol/skript/effects/EffItemDespawn.java index cf5c58dcdcf..a66797c8d53 100644 --- a/src/main/java/ch/njol/skript/effects/EffItemDespawn.java +++ b/src/main/java/ch/njol/skript/effects/EffItemDespawn.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,10 +16,8 @@ @Name("Item Despawn") @Description("Prevent a dropped item from naturally despawning through Minecraft's timer.") -@Examples({ - "prevent all dropped items from naturally despawning", - "allow all dropped items to naturally despawn" -}) +@Example("prevent all dropped items from naturally despawning") +@Example("allow all dropped items to naturally despawn") @Since("2.11") public class EffItemDespawn extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffKeepInventory.java b/src/main/java/ch/njol/skript/effects/EffKeepInventory.java index 3ed179e28ba..1a9c43add6e 100644 --- a/src/main/java/ch/njol/skript/effects/EffKeepInventory.java +++ b/src/main/java/ch/njol/skript/effects/EffKeepInventory.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -18,11 +18,11 @@ @Name("Keep Inventory / Experience") @Description("Keeps the inventory or/and experiences of the dead player in a death event.") -@Examples({ - "on death of a player:", - "\tif the victim is an op:", - "\t\tkeep the inventory and experiences" -}) +@Example(""" + on death of a player: + if the victim is an op: + keep the inventory and experiences + """) @Since("2.4") @Events("death") public class EffKeepInventory extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffKick.java b/src/main/java/ch/njol/skript/effects/EffKick.java index ef89ad297ea..14d3a7eaaea 100644 --- a/src/main/java/ch/njol/skript/effects/EffKick.java +++ b/src/main/java/ch/njol/skript/effects/EffKick.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,9 +22,11 @@ */ @Name("Kick") @Description("Kicks a player from the server.") -@Examples({"on place of TNT, lava, or obsidian:", - " kick the player due to \"You may not place %block%!\"", - " cancel the event"}) +@Example(""" + on place of TNT, lava, or obsidian: + kick the player due to "You may not place %block%!" + cancel the event + """) @Since("1.0") public class EffKick extends Effect { static { diff --git a/src/main/java/ch/njol/skript/effects/EffKill.java b/src/main/java/ch/njol/skript/effects/EffKill.java index 882dc83c6e6..8f8ae96932f 100644 --- a/src/main/java/ch/njol/skript/effects/EffKill.java +++ b/src/main/java/ch/njol/skript/effects/EffKill.java @@ -4,7 +4,7 @@ import ch.njol.skript.bukkitutil.DamageUtils; import ch.njol.skript.bukkitutil.HealthUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -21,11 +21,9 @@ @Name("Kill") @Description("Kills an entity.") -@Examples({ - "kill the player", - "kill all creepers in the player's world", - "kill all endermen, witches and bats" -}) +@Example("kill the player") +@Example("kill all creepers in the player's world") +@Example("kill all endermen, witches and bats") @Since("1.0, 2.10 (ignoring totem of undying)") public class EffKill extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffKnockback.java b/src/main/java/ch/njol/skript/effects/EffKnockback.java index be70bb7c5b1..0086020c86d 100644 --- a/src/main/java/ch/njol/skript/effects/EffKnockback.java +++ b/src/main/java/ch/njol/skript/effects/EffKnockback.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,10 +17,8 @@ @Name("Knockback") @Description("Apply the same velocity as a knockback to living entities in a direction. Mechanics such as knockback resistance will be factored in.") -@Examples({ - "knockback player north", - "knock victim (vector from attacker to victim) with strength 10" -}) +@Example("knockback player north") +@Example("knock victim (vector from attacker to victim) with strength 10") @Since("2.7") public class EffKnockback extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffLeash.java b/src/main/java/ch/njol/skript/effects/EffLeash.java index 4e1b0159b08..0d3cccbc111 100644 --- a/src/main/java/ch/njol/skript/effects/EffLeash.java +++ b/src/main/java/ch/njol/skript/effects/EffLeash.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,11 +20,11 @@ "Leash living entities to other entities. When trying to leash an Ender Dragon, Wither, Player, or a Bat, this effect will not work.", "See Spigot's Javadocs for more info." }) -@Examples({ - "on right click:", - "\tleash event-entity to player", - "\tsend \"&aYou leashed &2%event-entity%!\" to player" -}) +@Example(""" + on right click: + leash event-entity to player + send "&aYou leashed &2%event-entity%!" to player + """) @Since("2.3") public class EffLeash extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffLidState.java b/src/main/java/ch/njol/skript/effects/EffLidState.java index 3bd13014836..188f0dacfd8 100644 --- a/src/main/java/ch/njol/skript/effects/EffLidState.java +++ b/src/main/java/ch/njol/skript/effects/EffLidState.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,10 +16,8 @@ @Name("Open/Close Lid") @Description("Open or close the lid of the block(s).") -@Examples({ - "open the lid of {_chest}", - "close the lid of {_blocks::*}" -}) +@Example("open the lid of {_chest}") +@Example("close the lid of {_blocks::*}") @Since("2.10") public class EffLidState extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffLightning.java b/src/main/java/ch/njol/skript/effects/EffLightning.java index a92d6681e5c..67f929b8089 100644 --- a/src/main/java/ch/njol/skript/effects/EffLightning.java +++ b/src/main/java/ch/njol/skript/effects/EffLightning.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -21,8 +21,8 @@ */ @Name("Lightning") @Description("Strike lightning at a given location. Can use 'lightning effect' to create a lightning that does not harm entities or start fires.") -@Examples({"strike lightning at the player", - "strike lightning effect at the victim"}) +@Example("strike lightning at the player") +@Example("strike lightning effect at the victim") @Since("1.4") public class EffLightning extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffLoadServerIcon.java b/src/main/java/ch/njol/skript/effects/EffLoadServerIcon.java index e7a04165d09..ff87e2b0698 100644 --- a/src/main/java/ch/njol/skript/effects/EffLoadServerIcon.java +++ b/src/main/java/ch/njol/skript/effects/EffLoadServerIcon.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,14 +22,16 @@ @Description({"Loads server icons from the given files. You can get the loaded icon using the", "last loaded server icon expression.", "Please note that the image must be 64x64 and the file path starts from the server folder.",}) -@Examples({"on load:", - " clear {server-icons::*}", - " loop 5 times:", - " load server icon from file \"icons/%loop-number%.png\"", - " add the last loaded server icon to {server-icons::*}", - "", - "on server list ping:", - " set the icon to a random server icon out of {server-icons::*}"}) +@Example(""" + on load: + clear {server-icons::*} + loop 5 times: + load server icon from file "icons/%loop-number%.png" + add the last loaded server icon to {server-icons::*} + + on server list ping: + set the icon to a random server icon out of {server-icons::*} + """) @Since("2.3") public class EffLoadServerIcon extends AsyncEffect { diff --git a/src/main/java/ch/njol/skript/effects/EffLog.java b/src/main/java/ch/njol/skript/effects/EffLog.java index 0d4f0eb2908..db91f124c1b 100644 --- a/src/main/java/ch/njol/skript/effects/EffLog.java +++ b/src/main/java/ch/njol/skript/effects/EffLog.java @@ -16,7 +16,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.SkriptConfig; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -31,14 +31,18 @@ @Name("Log") @Description({"Writes text into a .log file. Skript will write these files to /plugins/Skript/logs.", "NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log."}) -@Examples({ - "on join:", - "\tlog \"%player% has just joined the server!\"", - "on world change:", - "\tlog \"Someone just went to %event-world%!\" to file \"worldlog/worlds.log\"", - "on command:", - "\tlog \"%player% just executed %full command%!\" to file \"server/commands.log\" with a severity of warning" -}) +@Example(""" + on join: + log "%player% has just joined the server!" + """) +@Example(""" + on world change: + log "Someone just went to %event-world%!" to file "worldlog/worlds.log" + """) +@Example(""" + on command: + log "%player% just executed %full command%!" to file "server/commands.log" with a severity of warning + """) @Since("2.0, 2.9.0 (severities)") public class EffLog extends Effect { static { diff --git a/src/main/java/ch/njol/skript/effects/EffLook.java b/src/main/java/ch/njol/skript/effects/EffLook.java index 21c5fd4bc54..28604403082 100644 --- a/src/main/java/ch/njol/skript/effects/EffLook.java +++ b/src/main/java/ch/njol/skript/effects/EffLook.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.bukkitutil.PaperEntityUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -19,17 +19,15 @@ @Name("Look At") @Description("Forces the mob(s) or player(s) to look at an entity, vector or location. Vanilla max head pitches range from 10 to 50.") -@Examples({ - "force the player to look towards event-entity's feet", - "", - "on entity explosion:", - "\tset {_player} to the nearest player", - "\t{_player} is set", - "\tdistance between {_player} and the event-location is less than 15", - "\tmake {_player} look towards vector from the {_player} to location of the event-entity", - "", - "force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40" -}) +@Example("force the player to look towards event-entity's feet") +@Example(""" + on entity explosion: + set {_player} to the nearest player + {_player} is set + distance between {_player} and the event-location is less than 15 + make {_player} look towards vector from the {_player} to location of the event-entity + """) +@Example("force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40") @Since("2.7") public class EffLook extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java b/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java index 44f10a91b99..83c62f64420 100644 --- a/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java +++ b/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,11 +16,11 @@ @Name("Make Egg Hatch") @Description("Makes the egg hatch in a Player Egg Throw event.") -@Examples({ - "on player egg throw:", - "\t# EGGS FOR DAYZ!", - "\tmake the egg hatch" -}) +@Example(""" + on player egg throw: + # EGGS FOR DAYZ! + make the egg hatch + """) @Events("Egg Throw") @Since("2.7") public class EffMakeEggHatch extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffMakeFly.java b/src/main/java/ch/njol/skript/effects/EffMakeFly.java index ba8812f1e45..9b294883b5b 100644 --- a/src/main/java/ch/njol/skript/effects/EffMakeFly.java +++ b/src/main/java/ch/njol/skript/effects/EffMakeFly.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,7 +17,8 @@ @Name("Make Fly") @Description("Forces a player to start/stop flying.") -@Examples({"make player fly", "force all players to stop flying"}) +@Example("make player fly") +@Example("force all players to stop flying") @Since("2.2-dev34") public class EffMakeFly extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffMakeSay.java b/src/main/java/ch/njol/skript/effects/EffMakeSay.java index a509558901f..073f471267b 100644 --- a/src/main/java/ch/njol/skript/effects/EffMakeSay.java +++ b/src/main/java/ch/njol/skript/effects/EffMakeSay.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -15,7 +15,8 @@ @Name("Make Say") @Description("Forces a player to send a message to the chat. If the message starts with a slash it will force the player to use command.") -@Examples({"make the player say \"Hello.\"", "force all players to send the message \"I love this server\""}) +@Example("make the player say \"Hello.\"") +@Example("force all players to send the message \"I love this server\"") @Since("2.3") public class EffMakeSay extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffMessage.java b/src/main/java/ch/njol/skript/effects/EffMessage.java index da58bd6255d..6ffbbf2040b 100644 --- a/src/main/java/ch/njol/skript/effects/EffMessage.java +++ b/src/main/java/ch/njol/skript/effects/EffMessage.java @@ -30,14 +30,18 @@ "Adding an optional sender allows the messages to be sent as if a specific player sent them.", "This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players,", "but for this to work, the message needs to be sent from a player."}) -@Examples({"message \"A wild %player% appeared!\"", - "message \"This message is a distraction. Mwahaha!\"", - "send \"Your kill streak is %{kill streak::%uuid of player%}%.\" to player", - "if the targeted entity exists:", - "\tmessage \"You're currently looking at a %type of the targeted entity%!\"", - "on chat:", - "\tcancel event", - "\tsend \"[%player%] >> %message%\" to all players from player"}) +@Example("message \"A wild %player% appeared!\"") +@Example("message \"This message is a distraction. Mwahaha!\"") +@Example("send \"Your kill streak is %{kill streak::%uuid of player%}%\" to player") +@Example(""" + if the targeted entity exists: + message "You're currently looking at a %type of the targeted entity%!" + """) +@Example(""" + on chat: + cancel event + send "[%player%] >> %message%" to all players from player + """) @RequiredPlugins("Minecraft 1.16.4+ for optional sender") @Since("1.0, 2.2-dev26 (advanced features), 2.5.2 (optional sender), 2.6 (sending objects)") public class EffMessage extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffOp.java b/src/main/java/ch/njol/skript/effects/EffOp.java index 8b8ec5f9404..309c75291e8 100644 --- a/src/main/java/ch/njol/skript/effects/EffOp.java +++ b/src/main/java/ch/njol/skript/effects/EffOp.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -19,8 +19,8 @@ */ @Name("op/deop") @Description("Grant/revoke a user operator state.") -@Examples({"op the player", - "deop all players"}) +@Example("op the player") +@Example("deop all players") @Since("1.0") public class EffOp extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffOpenBook.java b/src/main/java/ch/njol/skript/effects/EffOpenBook.java index 209dab7da48..c9e4062b103 100644 --- a/src/main/java/ch/njol/skript/effects/EffOpenBook.java +++ b/src/main/java/ch/njol/skript/effects/EffOpenBook.java @@ -10,7 +10,7 @@ import ch.njol.skript.aliases.Aliases; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -21,7 +21,7 @@ @Name("Open Book") @Description("Opens a written book to a player.") -@Examples("open book player's tool to player") +@Example("open book player's tool to player") @RequiredPlugins("Minecraft 1.14.2+") @Since("2.5.1") public class EffOpenBook extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffOpenInventory.java b/src/main/java/ch/njol/skript/effects/EffOpenInventory.java index 29a8f59bc11..4fea5fca808 100644 --- a/src/main/java/ch/njol/skript/effects/EffOpenInventory.java +++ b/src/main/java/ch/njol/skript/effects/EffOpenInventory.java @@ -13,7 +13,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -24,8 +24,8 @@ @Name("Open/Close Inventory") @Description({"Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened.", "Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future."}) -@Examples({"show the victim's inventory to the player", - "open the player's inventory for the player"}) +@Example("show the victim's inventory to the player") +@Example("open the player's inventory for the player") @Since("2.0, 2.1.1 (closing), 2.2-Fixes-V10 (anvil), 2.4 (hopper, dropper, dispenser") public class EffOpenInventory extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffPandaOnBack.java b/src/main/java/ch/njol/skript/effects/EffPandaOnBack.java index 5dc322d7b7b..8ba3267b549 100644 --- a/src/main/java/ch/njol/skript/effects/EffPandaOnBack.java +++ b/src/main/java/ch/njol/skript/effects/EffPandaOnBack.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,7 +17,7 @@ @Name("Force Panda On Back") @Description("Make a panda get on/off its back.") -@Examples(""" +@Example(""" if last spawned panda is on its back: make last spawned panda get off its back """) diff --git a/src/main/java/ch/njol/skript/effects/EffPathfind.java b/src/main/java/ch/njol/skript/effects/EffPathfind.java index 2a6b43a845f..ffa61ca2e28 100644 --- a/src/main/java/ch/njol/skript/effects/EffPathfind.java +++ b/src/main/java/ch/njol/skript/effects/EffPathfind.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -20,11 +20,9 @@ @Name("Pathfind") @Description({"Make an entity pathfind towards a location or another entity. Not all entities can pathfind. " + "If the pathfinding target is another entity, the entities may or may not continuously follow the target."}) -@Examples({ - "make all creepers pathfind towards player", - "make all cows stop pathfinding", - "make event-entity pathfind towards player at speed 1" -}) +@Example("make all creepers pathfind towards player") +@Example("make all cows stop pathfinding") +@Example("make event-entity pathfind towards player at speed 1") @Since("2.7") public class EffPathfind extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffPersistent.java b/src/main/java/ch/njol/skript/effects/EffPersistent.java index 101d19f47ba..f766f302772 100644 --- a/src/main/java/ch/njol/skript/effects/EffPersistent.java +++ b/src/main/java/ch/njol/skript/effects/EffPersistent.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -26,16 +26,15 @@ + "non-persistent chicken will become non-persistent. This does not apply to players.", "By default, all entities are persistent." }) -@Examples({ - "prevent all entities from persisting", - "force {_leaves} to persist", - "", - "command /kickcheater :", - "\tpermission: op", - "\ttrigger:", - "\t\tprevent {_cheater} from persisting", - "\t\tkick {_cheater}" -}) +@Example("prevent all entities from persisting") +@Example("force {_leaves} to persist") +@Example(""" + command /kickcheater : + permission: op + trigger: + prevent {_cheater} from persisting + kick {_cheater} + """) @Since("2.11") public class EffPersistent extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffPlaySound.java b/src/main/java/ch/njol/skript/effects/EffPlaySound.java index 0bc3656f500..6325997598d 100644 --- a/src/main/java/ch/njol/skript/effects/EffPlaySound.java +++ b/src/main/java/ch/njol/skript/effects/EffPlaySound.java @@ -37,12 +37,10 @@ "", "Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.", }) -@Examples({ - "play sound \"block.note_block.pling\"", - "play sound \"entity.experience_orb.pickup\" with volume 0.5 to the player", - "play sound \"custom.music.1\" in jukebox category at {speakerBlock}", - "play sound \"BLOCK_AMETHYST_BLOCK_RESONATE\" with seed 1 on target entity for the player" -}) +@Example("play sound \"block.note_block.pling\"") +@Example("play sound \"entity.experience_orb.pickup\" with volume 0.5 to the player") +@Example("play sound \"custom.music.1\" in jukebox category at {speakerBlock}") +@Example("play sound \"BLOCK_AMETHYST_BLOCK_RESONATE\" with seed 1 on target entity for the player") @Since("2.2-dev28, 2.4 (sound categories), 2.9 (sound seed & entity emitter)") public class EffPlaySound extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java b/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java index 09c1af73648..ced4b44dc6f 100644 --- a/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java +++ b/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java @@ -17,9 +17,9 @@ "The version string can override the ???.", "Also the Online Players Count and", "Max Players expressions will return -1 when hiding player info."}) -@Examples({"hide player info", - "hide player related information in the server list", - "reveal all player related info"}) +@Example("hide player info") +@Example("hide player related information in the server list") +@Example("reveal all player related info") @Since("2.3") @Events("server list ping") public class EffPlayerInfoVisibility extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffPlayingDead.java b/src/main/java/ch/njol/skript/effects/EffPlayingDead.java index 90015b254c0..7ba5fad384e 100644 --- a/src/main/java/ch/njol/skript/effects/EffPlayingDead.java +++ b/src/main/java/ch/njol/skript/effects/EffPlayingDead.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,7 +16,7 @@ @Name("Play Dead") @Description("Make an axolotl start or stop playing dead.") -@Examples("make last spawned axolotl play dead") +@Example("make last spawned axolotl play dead") @Since("2.11") public class EffPlayingDead extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffPoison.java b/src/main/java/ch/njol/skript/effects/EffPoison.java index af04ccd4f13..64b9ad4c312 100644 --- a/src/main/java/ch/njol/skript/effects/EffPoison.java +++ b/src/main/java/ch/njol/skript/effects/EffPoison.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,9 +22,9 @@ */ @Name("Poison/Cure") @Description("Poison or cure a creature.") -@Examples({"poison the player", - "poison the victim for 20 seconds", - "cure the player from poison"}) +@Example("poison the player") +@Example("poison the victim for 20 seconds") +@Example("cure the player from poison") @Since("1.3.2") public class EffPoison extends Effect { static { diff --git a/src/main/java/ch/njol/skript/effects/EffPotion.java b/src/main/java/ch/njol/skript/effects/EffPotion.java index 7e869f79ad7..f36817a3614 100644 --- a/src/main/java/ch/njol/skript/effects/EffPotion.java +++ b/src/main/java/ch/njol/skript/effects/EffPotion.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,16 +20,14 @@ @Name("Potion Effects") @Description("Apply or remove potion effects to/from entities.") -@Examples({ - "apply ambient swiftness 2 to the player", - "remove haste from the victim", - "", - "on join:", - "\tapply infinite potion of strength of tier {strength::%uuid of player%} to the player", - "", - "apply potion effects of player's tool to player", - "apply haste potion of tier 3 without any particles whilst hiding the potion icon to the player # Hide potions" -}) +@Example("apply ambient swiftness 2 to the player") +@Example("remove haste from the victim") +@Example(""" + on join: + apply infinite potion of strength of tier {strength::%uuid of player%} to the player + """) +@Example("apply potion effects of player's tool to player") +@Example("apply haste potion of tier 3 without any particles whilst hiding the potion icon to the player # Hide potions") @Since( "2.0, 2.2-dev27 (ambient and particle-less potion effects), " + "2.5 (replacing existing effect), 2.5.2 (potion effects), " + diff --git a/src/main/java/ch/njol/skript/effects/EffPvP.java b/src/main/java/ch/njol/skript/effects/EffPvP.java index cec3134c52c..d786fbdc854 100644 --- a/src/main/java/ch/njol/skript/effects/EffPvP.java +++ b/src/main/java/ch/njol/skript/effects/EffPvP.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,8 +16,8 @@ @Name("PvP") @Description("Set the PvP state for a given world.") -@Examples({"enable PvP #(current world only)", - "disable PvP in all worlds"}) +@Example("enable PvP #(current world only)") +@Example("disable PvP in all worlds") @Since("1.3.4") public class EffPvP extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffReleaseEntityStorage.java b/src/main/java/ch/njol/skript/effects/EffReleaseEntityStorage.java index d45225367d8..f86e1f82a82 100644 --- a/src/main/java/ch/njol/skript/effects/EffReleaseEntityStorage.java +++ b/src/main/java/ch/njol/skript/effects/EffReleaseEntityStorage.java @@ -24,10 +24,8 @@ "When using beehives, providing a timespan will prevent the released bees from re-entering the beehive for that amount of time.", "Due to unstable behaviour on older versions, this effect requires Minecraft version 1.21+." }) -@Examples({ - "release the stored entities of {_beehive}", - "release the entity storage of {_hive} for 5 seconds" -}) +@Example("release the stored entities of {_beehive}") +@Example("release the entity storage of {_hive} for 5 seconds") @RequiredPlugins("Minecraft 1.21") @Since("2.11") public class EffReleaseEntityStorage extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffReplace.java b/src/main/java/ch/njol/skript/effects/EffReplace.java index e6852cc7e6b..ac0fffd1641 100644 --- a/src/main/java/ch/njol/skript/effects/EffReplace.java +++ b/src/main/java/ch/njol/skript/effects/EffReplace.java @@ -6,7 +6,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.classes.Changer.ChangerUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -34,17 +34,15 @@ "Replaces all occurrences of a given text or regex with another text. Please note that you can only change " + "variables and a few expressions, e.g. a message or a line of a sign." ) -@Examples({ - "replace \"\" in {_msg} with \"[%name of player's tool%]\"", - "replace every \"&\" with \"§\" in line 1 of targeted block", - "", - "# Very simple chat censor", - "on chat:", - "\treplace all \"idiot\" and \"noob\" with \"****\" in the message", - "\tregex replace \"\\b(idiot|noob)\\b\" with \"****\" in the message # Regex version using word boundaries for better results", - "", - "replace all stone and dirt in player's inventory and player's top inventory with diamond" -}) +@Example("replace \"\" in {_msg} with \"[%name of player's tool%]\"") +@Example("replace every \"&\" with \"§\" in line 1 of targeted block") +@Example(""" + # Very simple chat censor + on chat: + replace all "idiot" and "noob" with "****" in the message + regex replace "\b(idiot|noob)\b" with "****" in the message # Regex version using word boundaries for better results + """) +@Example("replace all stone and dirt in player's inventory and player's top inventory with diamond") @Since("2.0, 2.2-dev24 (multiple strings, items in inventory), 2.5 (replace first, case sensitivity), 2.10 (regex)") public class EffReplace extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffResetTitle.java b/src/main/java/ch/njol/skript/effects/EffResetTitle.java index 541038b42fb..e292c82fccc 100644 --- a/src/main/java/ch/njol/skript/effects/EffResetTitle.java +++ b/src/main/java/ch/njol/skript/effects/EffResetTitle.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,8 +16,8 @@ @Name("Title - Reset") @Description("Resets the title of the player to the default values.") -@Examples({"reset the titles of all players", - "reset the title"}) +@Example("reset the titles of all players") +@Example("reset the title") @Since("2.3") public class EffResetTitle extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffRespawn.java b/src/main/java/ch/njol/skript/effects/EffRespawn.java index b0460be02d1..d479c71348f 100644 --- a/src/main/java/ch/njol/skript/effects/EffRespawn.java +++ b/src/main/java/ch/njol/skript/effects/EffRespawn.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -20,8 +20,10 @@ @Name("Force Respawn") @Description("Forces player(s) to respawn if they are dead. If this is called without delay from death event, one tick is waited before respawn attempt.") -@Examples({"on death of player:", - "\tforce event-player to respawn",}) +@Example(""" + on death of player: + force event-player to respawn + """) @Since("2.2-dev21") public class EffRespawn extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffReturn.java b/src/main/java/ch/njol/skript/effects/EffReturn.java index ed8ee166361..e564a1742f8 100644 --- a/src/main/java/ch/njol/skript/effects/EffReturn.java +++ b/src/main/java/ch/njol/skript/effects/EffReturn.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.*; @@ -21,13 +21,14 @@ @Name("Return") @Description("Makes a trigger or a section (e.g. a function) return a value") -@Examples({ - "function double(i: number) :: number:", - "\treturn 2 * {_i}", - "", - "function divide(i: number) returns number:", - "\treturn {_i} / 2" -}) +@Example(""" + function double(i: number) :: number: + return 2 * {_i} + """) +@Example(""" + function divide(i: number) returns number: + return {_i} / 2 + """) @Since("2.2, 2.8.0 (returns aliases)") public class EffReturn extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffRing.java b/src/main/java/ch/njol/skript/effects/EffRing.java index ff91c8f5f90..6522d2b7e92 100644 --- a/src/main/java/ch/njol/skript/effects/EffRing.java +++ b/src/main/java/ch/njol/skript/effects/EffRing.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -25,7 +25,7 @@ "A bell can only ring in two directions, and the direction is determined by which way the bell is facing.", "By default, the bell will ring in the direction it is facing.", }) -@Examples({"make player ring target-block"}) +@Example("make player ring target-block") @Since("2.9.0") public class EffRing extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffRun.java b/src/main/java/ch/njol/skript/effects/EffRun.java index 8576ff801a3..0cc2bd99d18 100644 --- a/src/main/java/ch/njol/skript/effects/EffRun.java +++ b/src/main/java/ch/njol/skript/effects/EffRun.java @@ -16,11 +16,11 @@ @Name("Run (Experimental)") @Description("Executes a task (a function). Any returned result is discarded.") -@Examples({ - "set {_function} to the function named \"myFunction\"", - "run {_function}", - "run {_function} with arguments {_things::*}", -}) +@Example(""" + set {_function} to the function named "myFunction" + run {_function} + run {_function} with arguments {_things::*} + """) @Since("2.10") @Keywords({"run", "execute", "reflection", "function"}) @SuppressWarnings({"rawtypes", "unchecked"}) diff --git a/src/main/java/ch/njol/skript/effects/EffScriptFile.java b/src/main/java/ch/njol/skript/effects/EffScriptFile.java index 5a90098798b..7c0f5f8b5d7 100644 --- a/src/main/java/ch/njol/skript/effects/EffScriptFile.java +++ b/src/main/java/ch/njol/skript/effects/EffScriptFile.java @@ -5,7 +5,7 @@ import ch.njol.skript.SkriptCommand; import ch.njol.skript.command.ScriptCommand; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -45,13 +45,13 @@ Disabling a script unloads it and prepends - to its name so it will not be loaded the next time the server restarts. If the script reflection experiment is enabled: unloading a script terminates it and removes it from memory, but does not alter the file.""") -@Examples({ - "reload script \"test\"", - "enable script file \"testing\"", - "unload script file \"script.sk\"", - "set {_script} to the script \"MyScript.sk\"", - "reload {_script}" -}) +@Example("reload script \"test\"") +@Example("enable script file \"testing\"") +@Example("unload script file \"script.sk\"") +@Example(""" + set {_script} to the script "MyScript.sk" + reload {_script} + """) @Since("2.4, 2.10 (unloading)") public class EffScriptFile extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffSendResourcePack.java b/src/main/java/ch/njol/skript/effects/EffSendResourcePack.java index 29fa5dac3e8..4891ef44c86 100644 --- a/src/main/java/ch/njol/skript/effects/EffSendResourcePack.java +++ b/src/main/java/ch/njol/skript/effects/EffSendResourcePack.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -26,8 +26,10 @@ "", "The resource pack request action can be used to check ", "status of the sent resource pack request."}) -@Examples({"on join:", - " send the resource pack from \"URL\" with hash \"hash\" to the player"}) +@Example(""" + on join: + send the resource pack from "URL" with hash "hash" to the player + """) @Since("2.4") public class EffSendResourcePack extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffSendTitle.java b/src/main/java/ch/njol/skript/effects/EffSendTitle.java index 07e436693c6..7620db9c3fd 100644 --- a/src/main/java/ch/njol/skript/effects/EffSendTitle.java +++ b/src/main/java/ch/njol/skript/effects/EffSendTitle.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -25,13 +25,11 @@ "Note: if no input is given for the times, it will keep the ones from the last title sent, " + "use the reset title effect to restore the default values." }) -@Examples({ - "send title \"Competition Started\" with subtitle \"Have fun, Stay safe!\" to player for 5 seconds", - "send title \"Hi %player%\" to player", - "send title \"Loot Drop\" with subtitle \"starts in 3 minutes\" to all players", - "send title \"Hello %player%!\" with subtitle \"Welcome to our server\" to player for 5 seconds with fadein 1 second and fade out 1 second", - "send subtitle \"Party!\" to all players" -}) +@Example("send title \"Competition Started\" with subtitle \"Have fun, Stay safe!\" to player for 5 seconds") +@Example("send title \"Hi %player%\" to player") +@Example("send title \"Loot Drop\" with subtitle \"starts in 3 minutes\" to all players") +@Example("send title \"Hello %player%!\" with subtitle \"Welcome to our server\" to player for 5 seconds with fadein 1 second and fade out 1 second") +@Example("send subtitle \"Party!\" to all players") @Since("2.3") public class EffSendTitle extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffShear.java b/src/main/java/ch/njol/skript/effects/EffShear.java index cc903804bce..b561419ea21 100644 --- a/src/main/java/ch/njol/skript/effects/EffShear.java +++ b/src/main/java/ch/njol/skript/effects/EffShear.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,12 +22,12 @@ "\nPlease note that..:", "\n- Force-shearing or un-shearing on a sheared mushroom cow is not possible" }) -@Examples({ - "on rightclick on a sheep holding a sword:", - "\tshear the clicked sheep", - "\tchance of 10%", - "\tforce shear the clicked sheep" -}) +@Example(""" + on rightclick on a sheep holding a sword: + shear the clicked sheep + chance of 10% + force shear the clicked sheep + """) @Since("2.0 (cows, sheep & snowmen), 2.8.0 (all shearable entities)") public class EffShear extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffSilence.java b/src/main/java/ch/njol/skript/effects/EffSilence.java index ffe8a72ed85..7b1faeb8503 100644 --- a/src/main/java/ch/njol/skript/effects/EffSilence.java +++ b/src/main/java/ch/njol/skript/effects/EffSilence.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,7 +16,7 @@ @Name("Silence Entity") @Description("Controls whether or not an entity is silent.") -@Examples("make target entity silent") +@Example("make target entity silent") @Since("2.5") public class EffSilence extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffSort.java b/src/main/java/ch/njol/skript/effects/EffSort.java index b3e7b499aa0..49d242c834d 100644 --- a/src/main/java/ch/njol/skript/effects/EffSort.java +++ b/src/main/java/ch/njol/skript/effects/EffSort.java @@ -23,13 +23,11 @@ When using the full sort %~objects% (by|based on) <expression> pattern, the input expression can be used to refer to the current item being sorted. (See input expression for more information.)""") -@Examples({ - "set {_words::*} to \"pineapple\", \"banana\", \"yoghurt\", and \"apple\"", - "sort {_words::*} # alphabetical sort", - "sort {_words::*} by length of input # shortest to longest", - "sort {_words::*} in descending order by length of input # longest to shortest", - "sort {_words::*} based on {tastiness::%input%} # sort based on custom value" -}) +@Example("set {_words::*} to \"pineapple\", \"banana\", \"yoghurt\", and \"apple\"") +@Example("sort {_words::*} # alphabetical sort") +@Example("sort {_words::*} by length of input # shortest to longest") +@Example("sort {_words::*} in descending order by length of input # longest to shortest") +@Example("sort {_words::*} based on {tastiness::%input%} # sort based on custom value") @Since("2.9.0, 2.10 (sort order)") @Keywords("input") public class EffSort extends Effect implements InputSource { diff --git a/src/main/java/ch/njol/skript/effects/EffSprinting.java b/src/main/java/ch/njol/skript/effects/EffSprinting.java index 62f872fccb6..317cd4e21fa 100644 --- a/src/main/java/ch/njol/skript/effects/EffSprinting.java +++ b/src/main/java/ch/njol/skript/effects/EffSprinting.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -24,10 +24,8 @@ " - The player pressing shift will stop them sprinting, and pressing sprint will re-assert normal sprinting behavior", "Using this effect two or more consecutive times on a stationary player produces undefined behavior and should not be relied on." }) -@Examples({ - "make player start sprinting", - "force player to start sprinting" -}) +@Example("make player start sprinting") +@Example("force player to start sprinting") @Since("2.11") public class EffSprinting extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffStopServer.java b/src/main/java/ch/njol/skript/effects/EffStopServer.java index 379891a59bf..d7c1b5a61ab 100644 --- a/src/main/java/ch/njol/skript/effects/EffStopServer.java +++ b/src/main/java/ch/njol/skript/effects/EffStopServer.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -17,7 +17,8 @@ @Name("Stop Server") @Description("Stops or restarts the server. If restart is used when the restart-script spigot.yml option isn't defined, the server will stop instead.") -@Examples({"stop the server", "restart server"}) +@Example("stop the server") +@Example("restart server") @Since("2.5") public class EffStopServer extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffStopSound.java b/src/main/java/ch/njol/skript/effects/EffStopSound.java index 016e760a881..ca860f094ee 100644 --- a/src/main/java/ch/njol/skript/effects/EffStopSound.java +++ b/src/main/java/ch/njol/skript/effects/EffStopSound.java @@ -24,12 +24,10 @@ "", "Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself." }) -@Examples({ - "stop sound \"block.chest.open\" for the player", - "stop playing sounds \"ambient.underwater.loop\" and \"ambient.underwater.loop.additions\" to the player", - "stop all sounds for all players", - "stop sound in the record category" -}) +@Example("stop sound \"block.chest.open\" for the player") +@Example("stop playing sounds \"ambient.underwater.loop\" and \"ambient.underwater.loop.additions\" to the player") +@Example("stop all sounds for all players") +@Example("stop sound in the record category") @Since("2.4, 2.7 (stop all sounds)") public class EffStopSound extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffSuppressWarnings.java b/src/main/java/ch/njol/skript/effects/EffSuppressWarnings.java index 6893f101d9d..9a3f9897471 100644 --- a/src/main/java/ch/njol/skript/effects/EffSuppressWarnings.java +++ b/src/main/java/ch/njol/skript/effects/EffSuppressWarnings.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,10 +16,8 @@ @Name("Locally Suppress Warning") @Description("Suppresses target warnings from the current script.") -@Examples({ - "locally suppress missing conjunction warnings", - "suppress the variable save warnings" -}) +@Example("locally suppress missing conjunction warnings") +@Example("suppress the variable save warnings") @Since("2.3") public class EffSuppressWarnings extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffSwingHand.java b/src/main/java/ch/njol/skript/effects/EffSwingHand.java index 8246eb783c6..22802a6204c 100644 --- a/src/main/java/ch/njol/skript/effects/EffSwingHand.java +++ b/src/main/java/ch/njol/skript/effects/EffSwingHand.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -17,7 +17,7 @@ @Name("Swing Hand") @Description("Makes an entity swing their hand. This does nothing if the entity does not have an animation for swinging their hand.") -@Examples("make player swing their main hand") +@Example("make player swing their main hand") @Since("2.5.1") @RequiredPlugins("Minecraft 1.15.2+") public class EffSwingHand extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffTame.java b/src/main/java/ch/njol/skript/effects/EffTame.java index bcad5fa23af..7b96c234659 100644 --- a/src/main/java/ch/njol/skript/effects/EffTame.java +++ b/src/main/java/ch/njol/skript/effects/EffTame.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,10 +16,8 @@ @Name("Tame / Untame") @Description("Tame a tameable entity (horse, parrot, cat, etc.).") -@Examples({ - "tame {_horse}", - "untame {_horse}" -}) +@Example("tame {_horse}") +@Example("untame {_horse}") @Since("2.10") public class EffTame extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffTeleport.java b/src/main/java/ch/njol/skript/effects/EffTeleport.java index e68f0fbfd43..51087a678b7 100644 --- a/src/main/java/ch/njol/skript/effects/EffTeleport.java +++ b/src/main/java/ch/njol/skript/effects/EffTeleport.java @@ -33,14 +33,13 @@ "which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.", "Teleport flags are settings to retain during a teleport. Such as direction, passengers, x coordinate, etc." }) -@Examples({ - "teleport the player to {home::%uuid of player%}", - "teleport the attacker to the victim", - "", - "on dismount:", - "\tcancel event", - "\tteleport the player to {server::spawn} retaining vehicle and passengers" -}) +@Example("teleport the player to {home::%uuid of player%}") +@Example("teleport the attacker to the victim") +@Example(""" + on dismount: + cancel event + teleport the player to {server::spawn} retaining vehicle and passengers + """) @Since("1.0, 2.10 (flags)") public class EffTeleport extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffToggle.java b/src/main/java/ch/njol/skript/effects/EffToggle.java index 9009fde7be4..37ec1985d6f 100644 --- a/src/main/java/ch/njol/skript/effects/EffToggle.java +++ b/src/main/java/ch/njol/skript/effects/EffToggle.java @@ -14,7 +14,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.classes.Changer.ChangerUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -25,14 +25,16 @@ @Name("Toggle") @Description("Toggle the state of a block or boolean.") -@Examples({"# use arrows to toggle switches, doors, etc.", - "on projectile hit:", - "\tprojectile is arrow", - "\ttoggle the block at the arrow", - "", - "# With booleans", - "toggle gravity of player" -}) +@Example(""" + # use arrows to toggle switches, doors, etc. + on projectile hit: + projectile is arrow + toggle the block at the arrow + """) +@Example(""" + # With booleans + toggle gravity of player + """) @Since("1.4, 2.12 (booleans)") public class EffToggle extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffToggleCanPickUpItems.java b/src/main/java/ch/njol/skript/effects/EffToggleCanPickUpItems.java index 41810ff4dfe..62ef782f1eb 100644 --- a/src/main/java/ch/njol/skript/effects/EffToggleCanPickUpItems.java +++ b/src/main/java/ch/njol/skript/effects/EffToggleCanPickUpItems.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -15,14 +15,13 @@ @Name("Toggle Picking Up Items") @Description("Determines whether living entities are able to pick up items or not") -@Examples({ - "forbid player from picking up items", - "send \"You can no longer pick up items!\" to player", - "", - "on drop:", - "\tif player can't pick up items:", - "\t\tallow player to pick up items" -}) +@Example("forbid player from picking up items") +@Example("send \"You can no longer pick up items!\" to player") +@Example(""" + on drop: + if player can't pick up items: + allow player to pick up items + """) @Since("2.8.0") public class EffToggleCanPickUpItems extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffToggleFlight.java b/src/main/java/ch/njol/skript/effects/EffToggleFlight.java index dd7265cc055..44c84306059 100644 --- a/src/main/java/ch/njol/skript/effects/EffToggleFlight.java +++ b/src/main/java/ch/njol/skript/effects/EffToggleFlight.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -16,7 +16,7 @@ @Name("Toggle Flight") @Description("Toggle the flight mode of a player.") -@Examples("allow flight to event-player") +@Example("allow flight to event-player") @Since("2.3") public class EffToggleFlight extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffTooltip.java b/src/main/java/ch/njol/skript/effects/EffTooltip.java index f9fa46e7a94..85158d5efd2 100644 --- a/src/main/java/ch/njol/skript/effects/EffTooltip.java +++ b/src/main/java/ch/njol/skript/effects/EffTooltip.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -22,10 +22,8 @@ "If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it.", "If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden." }) -@Examples({ - "hide the entire tooltip of player's tool", - "hide {_item}'s additional tool tip" -}) +@Example("hide the entire tooltip of player's tool") +@Example("hide {_item}'s additional tool tip") @RequiredPlugins("Spigot 1.20.5+") @Since("2.9.0") public class EffTooltip extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffTransform.java b/src/main/java/ch/njol/skript/effects/EffTransform.java index aa4fbaf87e5..fba82b790be 100644 --- a/src/main/java/ch/njol/skript/effects/EffTransform.java +++ b/src/main/java/ch/njol/skript/effects/EffTransform.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Keywords; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @@ -33,18 +33,20 @@ "multiple values, then then indices will be reset as a single index cannot contain multiple values.", "Only variable lists can be transformed with this effect. For other lists, see the transform expression." }) -@Examples({ - "set {_a::*} to 1, 2, and 3", - "transform {_a::*} using input * 2", - "# {_a::*} is now 2, 4, and 6", - "", - "# get a list of the sizes of all clans without manually looping", - "set {_clan-sizes::*} to indices of {clans::*}", - "transform {_clan-sizes::*} using {clans::%input%::size}", - "", - "# set all existing values of a list to 0:", - "transform {_list::*} to 0" -}) +@Example(""" + set {_a::*} to 1, 2, and 3 + transform {_a::*} using input * 2 + # {_a::*} is now 2, 4, and 6 + """) +@Example(""" + # get a list of the sizes of all clans without manually looping + set {_clan-sizes::*} to indices of {clans::*} + transform {_clan-sizes::*} using {clans::%input%::size} + """) +@Example(""" + # set all existing values of a list to 0: + transform {_list::*} with 0 + """) @Since("2.10") @Keywords("input") public class EffTransform extends Effect implements InputSource { diff --git a/src/main/java/ch/njol/skript/effects/EffTree.java b/src/main/java/ch/njol/skript/effects/EffTree.java index a9369177231..71f141eeff4 100644 --- a/src/main/java/ch/njol/skript/effects/EffTree.java +++ b/src/main/java/ch/njol/skript/effects/EffTree.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,7 +22,7 @@ @Name("Tree") @Description({"Creates a tree.", "This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path."}) -@Examples({"grow a tall redwood tree above the clicked block"}) +@Example("grow a tall redwood tree above the clicked block") @Since("1.0") public class EffTree extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffVehicle.java b/src/main/java/ch/njol/skript/effects/EffVehicle.java index b99da3f4a5d..3e2eb285bca 100644 --- a/src/main/java/ch/njol/skript/effects/EffVehicle.java +++ b/src/main/java/ch/njol/skript/effects/EffVehicle.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -16,10 +16,8 @@ @Name("Vehicle") @Description("Makes an entity ride another entity, e.g. a minecart, a saddled pig, an arrow, etc.") -@Examples({ - "make the player ride a saddled pig", - "make the attacker ride the victim" -}) +@Example("make the player ride a saddled pig") +@Example("make the attacker ride the victim") @Since("2.0") public class EffVehicle extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffVisualEffect.java b/src/main/java/ch/njol/skript/effects/EffVisualEffect.java index bd6acbfdef7..127452b1336 100644 --- a/src/main/java/ch/njol/skript/effects/EffVisualEffect.java +++ b/src/main/java/ch/njol/skript/effects/EffVisualEffect.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,8 +22,8 @@ @Name("Play Effect") @Description({"Plays a visual effect at a given location or on a given entity.", "Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players."}) -@Examples({"play wolf hearts on the clicked wolf", - "show mob spawner flames at the targeted block to the player"}) +@Example("play wolf hearts on the clicked wolf") +@Example("show mob spawner flames at the targeted block to the player") @Since("2.1") public class EffVisualEffect extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffWakeupSleep.java b/src/main/java/ch/njol/skript/effects/EffWakeupSleep.java index d34284566ea..0ef41b8056a 100644 --- a/src/main/java/ch/njol/skript/effects/EffWakeupSleep.java +++ b/src/main/java/ch/njol/skript/effects/EffWakeupSleep.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.config.Node; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -27,13 +27,11 @@ + "Does not work if the location of the bed is not in the world the player is currently in.", "Using 'without spawn location update' will make players wake up without setting their spawn location to the bed." }) -@Examples({ - "make {_fox} go to sleep", - "make {_bat} stop sleeping", - "make {_villager} start sleeping at location(0, 0, 0)", - "make player go to sleep at location(0, 0, 0) with force", - "make player wake up without spawn location update" -}) +@Example("make {_fox} go to sleep") +@Example("make {_bat} stop sleeping") +@Example("make {_villager} start sleeping at location(0, 0, 0)") +@Example("make player go to sleep at location(0, 0, 0) with force") +@Example("make player wake up without spawn location update") @Since("2.11") public class EffWakeupSleep extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffWardenDisturbance.java b/src/main/java/ch/njol/skript/effects/EffWardenDisturbance.java index 415bb16559b..dd7cc3ff93a 100644 --- a/src/main/java/ch/njol/skript/effects/EffWardenDisturbance.java +++ b/src/main/java/ch/njol/skript/effects/EffWardenDisturbance.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,7 +22,7 @@ "The warden will not investigate if the warden is aggressive towards an entity.", "This effect does not add anger to the warden." }) -@Examples("make last spawned warden sense a disturbance at location(0, 0, 0)") +@Example("make last spawned warden sense a disturbance at location(0, 0, 0)") @Since("2.11") public class EffWardenDisturbance extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffWorldBorderExpand.java b/src/main/java/ch/njol/skript/effects/EffWorldBorderExpand.java index 857ae40d61b..045a6e51447 100644 --- a/src/main/java/ch/njol/skript/effects/EffWorldBorderExpand.java +++ b/src/main/java/ch/njol/skript/effects/EffWorldBorderExpand.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.config.Node; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -24,10 +24,8 @@ "Using `by` adds/subtracts from the current size of the world border.", "Using `to` sets to the specified size." }) -@Examples({ - "expand world border of player by 100 over 5 seconds", - "shrink world border of world \"world\" to 100 over 10 seconds" -}) +@Example("expand world border of player by 100 over 5 seconds") +@Example("shrink world border of world \"world\" to 100 over 10 seconds") @Since("2.11") public class EffWorldBorderExpand extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffWorldLoad.java b/src/main/java/ch/njol/skript/effects/EffWorldLoad.java index 820017c87ea..08078d821aa 100644 --- a/src/main/java/ch/njol/skript/effects/EffWorldLoad.java +++ b/src/main/java/ch/njol/skript/effects/EffWorldLoad.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -22,13 +22,11 @@ "The load effect will create a new world if world doesn't already exist.", "When attempting to load a normal vanilla world you must define it's environment i.e \"world_nether\" must be loaded with nether environment" }) -@Examples({ - "load world \"world_nether\" with environment nether", - "load the world \"myCustomWorld\"", - "unload \"world_nether\"", - "unload \"world_the_end\" without saving", - "unload all worlds" -}) +@Example("load world \"world_nether\" with environment nether") +@Example("load the world \"myCustomWorld\"") +@Example("unload \"world_nether\"") +@Example("unload \"world_the_end\" without saving") +@Example("unload all worlds") @Since("2.8.0") public class EffWorldLoad extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffWorldSave.java b/src/main/java/ch/njol/skript/effects/EffWorldSave.java index 760b4459d87..88bcefabbfd 100644 --- a/src/main/java/ch/njol/skript/effects/EffWorldSave.java +++ b/src/main/java/ch/njol/skript/effects/EffWorldSave.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -18,10 +18,8 @@ "Save all worlds or a given world manually.", "Note: saving many worlds at once may possibly cause the server to freeze." }) -@Examples({ - "save \"world_nether\"", - "save all worlds" -}) +@Example("save \"world_nether\"") +@Example("save all worlds") @Since("2.8.0") public class EffWorldSave extends Effect { diff --git a/src/main/java/ch/njol/skript/effects/EffZombify.java b/src/main/java/ch/njol/skript/effects/EffZombify.java index 8adee13e890..21efb6efd3b 100644 --- a/src/main/java/ch/njol/skript/effects/EffZombify.java +++ b/src/main/java/ch/njol/skript/effects/EffZombify.java @@ -4,7 +4,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.classes.Changer.ChangerUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Effect; @@ -29,22 +29,21 @@ "Zombifying a villager stored in a variable will update the variable to the new zombie villager.", "Curing a zombie villager does not update the variable." }) -@Examples({ - "zombify last spawned villager", - "", - "set {_villager} to last spawned villager", - "zombify {_villager}", - "if {_villager} is a zombie villager:", - "\t# This will pass because '{_villager}' gets changed to the new zombie villager", - "", - "set {_villager} to last spawned villager", - "zombify last spawned villager", - "if {_villager} is a zombie villager:", - "\t# This will fail because the variable was not provided when zombifying", - "", - "unzombify {_zombieVillager}", - "unzombify {_zombieVillager} after 2 seconds" -}) +@Example("zombify last spawned villager") +@Example(""" + set {_villager} to last spawned villager + zombify {_villager} + if {_villager} is a zombie villager: + # This will pass because '{_villager}' gets changed to the new zombie villager + """) +@Example(""" + set {_villager} to last spawned villager + zombify last spawned villager + if {_villager} is a zombie villager: + # This will fail because the variable was not provided when zombifying + """) +@Example("unzombify {_zombieVillager}") +@Example("unzombify {_zombieVillager} after 2 seconds") @Since("2.11") public class EffZombify extends Effect { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAI.java b/src/main/java/ch/njol/skript/expressions/ExprAI.java index ae3ad17dc9c..33faceabbcb 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAI.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAI.java @@ -6,7 +6,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -14,7 +14,7 @@ @Name("Entity AI") @Description("Returns whether an entity has AI.") -@Examples("set artificial intelligence of target entity to false") +@Example("set artificial intelligence of target entity to false") @Since("2.5") public class ExprAI extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprARGB.java b/src/main/java/ch/njol/skript/expressions/ExprARGB.java index 4f0d99ee4a8..d6d8a27276f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprARGB.java +++ b/src/main/java/ch/njol/skript/expressions/ExprARGB.java @@ -17,10 +17,8 @@ "The alpha, red, green, or blue value of colors. Ranges from 0 to 255.", "Alpha represents opacity." }) -@Examples({ - "broadcast red value of rgb(100, 0, 50) # sends '100'", - "set {_red} to red's red value + 10" -}) +@Example("broadcast red value of rgb(100, 0, 50) # sends '100'") +@Example("set {_red} to red's red value + 10") @Keywords({"ARGB", "RGB", "color", "colour"}) @Since("2.10") public class ExprARGB extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java b/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java index c436a0474c6..d41a808dfcb 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,7 +25,7 @@ @Name("Absorbed blocks") @Description("The blocks absorbed by a sponge block.") @Events("sponge absorb") -@Examples("the absorbed blocks") +@Example("the absorbed blocks") @Since("2.5") public class ExprAbsorbedBlocks extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprActiveItem.java b/src/main/java/ch/njol/skript/expressions/ExprActiveItem.java index 992f071f80a..1ea203ab92b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprActiveItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprActiveItem.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -18,11 +18,11 @@ "the bow they're drawing back, etc.). This cannot be changed. " + "If an entity is not using any item, this will return null." ) -@Examples({ - "on damage of player:", - "\tif victim's active tool is a bow:", - "\t\tinterrupt player's active item use" -}) +@Example(""" + on damage of player: + if victim's active tool is a bow: + interrupt player's active item use + """) @Since("2.8.0") public class ExprActiveItem extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAffectedEntities.java b/src/main/java/ch/njol/skript/expressions/ExprAffectedEntities.java index 25b7507c8e8..56aaa587a4c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAffectedEntities.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAffectedEntities.java @@ -12,7 +12,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,10 +23,12 @@ @Name("Affected Entities") @Description("The affected entities in the area cloud effect event.") -@Examples({"on area cloud effect:", - "\tloop affected entities:", - "\t\tif loop-value is a player:", - "\t\t\tsend \"WARNING: you've step on an area effect cloud!\" to loop-value"}) +@Example(""" + on area cloud effect: + loop affected entities: + if loop-value is a player: + send "WARNING: you've step on an area effect cloud!" to loop-value + """) @Since("2.4") public class ExprAffectedEntities extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAge.java b/src/main/java/ch/njol/skript/expressions/ExprAge.java index 51b91fb2bbc..b57208bd9c3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAge.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAge.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -26,14 +26,15 @@ "For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, " + "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." }) -@Examples({ - "# Set targeted crop to fully grown crop", - "set age of targeted block to maximum age of targeted block", - " ", - "# Spawn a baby cow that will only need 1 minute to become an adult", - "spawn a baby cow at player", - "set age of last spawned entity to -1200 # in ticks = 60 seconds" -}) +@Example(""" + # Set targeted crop to fully grown crop + set age of targeted block to maximum age of targeted block + """) +@Example(""" + # Spawn a baby cow that will only need 1 minute to become an adult + spawn a baby cow at player + set age of last spawned entity to -1200 # in ticks = 60 seconds + """) @Since("2.7") public class ExprAge extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAllBannedEntries.java b/src/main/java/ch/njol/skript/expressions/ExprAllBannedEntries.java index 0733cc9cf34..c00df57973a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAllBannedEntries.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAllBannedEntries.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,11 +17,11 @@ @Name("All Banned Players/IPs") @Description("Obtains the list of all banned players or IP addresses.") -@Examples({ - "command /banlist:", - "\ttrigger:", - "\t\tsend all the banned players" -}) +@Example(""" + command /banlist: + trigger: + send all the banned players + """) @Since("2.7") public class ExprAllBannedEntries extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAllCommands.java b/src/main/java/ch/njol/skript/expressions/ExprAllCommands.java index 389c259dbe6..b44402b3767 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAllCommands.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAllCommands.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.command.Commands; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,8 +17,8 @@ @Name("All commands") @Description("Returns all registered commands or all script commands.") -@Examples({"send \"Number of all commands: %size of all commands%\"", - "send \"Number of all script commands: %size of all script commands%\""}) +@Example("send \"Number of all commands: %size of all commands%\"") +@Example("send \"Number of all script commands: %size of all script commands%\"") @Since("2.6") public class ExprAllCommands extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAllayJukebox.java b/src/main/java/ch/njol/skript/expressions/ExprAllayJukebox.java index ea3655179b8..97414280793 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAllayJukebox.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAllayJukebox.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -12,7 +12,7 @@ @Name("Allay Target Jukebox") @Description("The location of the jukebox an allay is set to.") -@Examples("set {_loc} to the target jukebox of last spawned allay") +@Example("set {_loc} to the target jukebox of last spawned allay") @Since("2.11") public class ExprAllayJukebox extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAlphabetList.java b/src/main/java/ch/njol/skript/expressions/ExprAlphabetList.java index 15d88787675..78bd0e4647a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAlphabetList.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAlphabetList.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,7 +19,7 @@ @Name("Alphabetical Sort") @Description("Sorts given strings in alphabetical order.") -@Examples({"set {_list::*} to alphabetically sorted {_strings::*}"}) +@Example("set {_list::*} to alphabetically sorted {_strings::*}") @Since("2.2-dev18b") public class ExprAlphabetList extends SimpleExpression{ diff --git a/src/main/java/ch/njol/skript/expressions/ExprAmountOfItems.java b/src/main/java/ch/njol/skript/expressions/ExprAmountOfItems.java index e00081e5665..bdc68e4ff46 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAmountOfItems.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAmountOfItems.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,7 +18,7 @@ @Name("Amount of Items") @Description("Counts how many of a particular item type are in a given inventory.") -@Examples("message \"You have %number of tag values of minecraft tag \"diamond_ores\" in the player's inventory% diamond ores in your inventory.\"") +@Example("message \"You have %number of tag values of minecraft tag \"diamond_ores\" in the player's inventory% diamond ores in your inventory.\"") @Since("2.0") public class ExprAmountOfItems extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAngle.java b/src/main/java/ch/njol/skript/expressions/ExprAngle.java index 3997a9b64e2..0fc8dc9712c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAngle.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAngle.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -21,12 +21,10 @@ "If radians is specified, converts the passed value to degrees. This conversion may not be entirely accurate, " + "due to floating point precision.", }) -@Examples({ - "set {_angle} to 90 degrees", - "{_angle} is 90 # true", - "180 degrees is pi # true", - "pi radians is 180 degrees # true" -}) +@Example("set {_angle} to 90 degrees") +@Example("{_angle} is 90 # true") +@Example("180 degrees is pi # true") +@Example("pi radians is 180 degrees # true") @Since("2.10") public class ExprAngle extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAnvilRepairCost.java b/src/main/java/ch/njol/skript/expressions/ExprAnvilRepairCost.java index 5fde7c76d97..45a5cd7f762 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAnvilRepairCost.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAnvilRepairCost.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -22,17 +22,18 @@ "Returns the experience cost (in levels) to complete the current repair or the maximum experience cost (in levels) to be allowed by the current repair.", "The default value of max cost set by vanilla Minecraft is 40." }) -@Examples({ - "on inventory click:", - "\tif {AnvilRepairSaleActive} = true:", - "\t\twait a tick # recommended, to avoid client bugs", - "\t\tset anvil repair cost to anvil repair cost * 50%", - "\t\tsend \"Anvil repair sale is ON!\" to player", - "", - "on inventory click:", - "\tplayer have permission \"anvil.repair.max.bypass\"", - "\tset max repair cost of event-inventory to 99999" -}) +@Example(""" + on inventory click: + if {AnvilRepairSaleActive} = true: + wait a tick # recommended, to avoid client bugs + set anvil repair cost to anvil repair cost * 50% + send "Anvil repair sale is ON!" to player + """) +@Example(""" + on inventory click: + player have permission "anvil.repair.max.bypass" + set max repair cost of event-inventory to 99999 + """) @Since("2.8.0") public class ExprAnvilRepairCost extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAnvilText.java b/src/main/java/ch/njol/skript/expressions/ExprAnvilText.java index 1a7f862dae9..c6926695831 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAnvilText.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAnvilText.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -11,12 +11,12 @@ @Name("Anvil Text Input") @Description("An expression to get the name to be applied to an item in an anvil inventory.") -@Examples({ - "on inventory click:", - "\ttype of event-inventory is anvil inventory", - "\tif the anvil text input of the event-inventory is \"FREE OP\":", - "\t\tban player" -}) +@Example(""" + on inventory click: + type of event-inventory is anvil inventory + if the anvil text input of the event-inventory is "FREE OP": + ban player + """) @Since("2.7") public class ExprAnvilText extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAppliedEffect.java b/src/main/java/ch/njol/skript/expressions/ExprAppliedEffect.java index 192986b44f5..f02a191d845 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAppliedEffect.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAppliedEffect.java @@ -14,13 +14,13 @@ @Name("Applied Beacon Effect") @Description("The type of effect applied by a beacon.") -@Examples({ - "on beacon effect:", - "\tif the applied effect is primary beacon effect:", - "\t\tbroadcast \"Is Primary\"", - "\telse if applied effect = secondary effect:", - "\t\tbroadcast \"Is Secondary\"" -}) +@Example(""" + on beacon effect: + if the applied effect is primary beacon effect: + broadcast "Is Primary" + else if applied effect = secondary effect: + broadcast "Is Secondary" + """) @Events("Beacon Effect") @Since("2.10") public class ExprAppliedEffect extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java b/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java index f2b0b79ee11..4faa757cb48 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java @@ -9,7 +9,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,8 +24,10 @@ @Name("Applied Enchantments") @Description({"The applied enchantments in an enchant event.", " Deleting or removing the applied enchantments will prevent the item's enchantment."}) -@Examples({"on enchant:", - "\tset the applied enchantments to sharpness 10 and fire aspect 5"}) +@Example(""" + on enchant: + set the applied enchantments to sharpness 10 and fire aspect 5 + """) @Events("enchant") @Since("2.5") public class ExprAppliedEnchantments extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprArgument.java b/src/main/java/ch/njol/skript/expressions/ExprArgument.java index a9a6fc71b00..d90388e426e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprArgument.java +++ b/src/main/java/ch/njol/skript/expressions/ExprArgument.java @@ -6,7 +6,7 @@ import ch.njol.skript.command.Commands; import ch.njol.skript.command.ScriptCommandEvent; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.EventRestrictedSyntax; @@ -36,13 +36,11 @@ "One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'.", "Please note that specifying the argument type is only supported in script commands." }) -@Examples({ - "give the item-argument to the player-argument", - "damage the player-argument by the number-argument", - "give a diamond pickaxe to the argument", - "add argument 1 to argument 2", - "heal the last argument" -}) +@Example("give the item-argument to the player-argument") +@Example("damage the player-argument by the number-argument") +@Example("give a diamond pickaxe to the argument") +@Example("add argument 1 to argument 2") +@Example("heal the last argument") @Since("1.0, 2.7 (support for command events)") public class ExprArgument extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprArmorChangeItem.java b/src/main/java/ch/njol/skript/expressions/ExprArmorChangeItem.java index bfeb342b363..7ef2a88ce21 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprArmorChangeItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprArmorChangeItem.java @@ -16,7 +16,7 @@ @Name("Armor Change Item") @Description("Get the unequipped or equipped armor item from a 'armor change' event.") -@Examples(""" +@Example(""" on armor change broadcast the old armor item """) diff --git a/src/main/java/ch/njol/skript/expressions/ExprArmorSlot.java b/src/main/java/ch/njol/skript/expressions/ExprArmorSlot.java index 8b1a9eb7409..124870edb6b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprArmorSlot.java +++ b/src/main/java/ch/njol/skript/expressions/ExprArmorSlot.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Keywords; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @@ -39,10 +39,8 @@ "", "Saddle is a special slot that can only be used for: pigs, striders and horse types (horse, camel, llama, mule, donkey)." }) -@Examples({ - "set chestplate of the player to a diamond chestplate", - "helmet of player is neither tag values of tag \"paper:helmets\" nor air # player is wearing a block, e.g. from another plugin" -}) +@Example("set chestplate of the player to a diamond chestplate") +@Example("helmet of player is neither tag values of tag \"paper:helmets\" nor air # player is wearing a block, e.g. from another plugin") @Keywords("armor") @Since({ "1.0, 2.8.0 (armor), 2.10 (body armor), 2.12 (saddle)", diff --git a/src/main/java/ch/njol/skript/expressions/ExprArrowKnockbackStrength.java b/src/main/java/ch/njol/skript/expressions/ExprArrowKnockbackStrength.java index 3c72322131b..9267daf4851 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprArrowKnockbackStrength.java +++ b/src/main/java/ch/njol/skript/expressions/ExprArrowKnockbackStrength.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -17,9 +17,11 @@ @Name("Arrow Knockback Strength") @Description("An arrow's knockback strength.") -@Examples({"on shoot:", - "\tevent-projectile is an arrow", - "\tset arrow knockback strength of event-projectile to 10"}) +@Example(""" + on shoot: + event-projectile is an arrow + set arrow knockback strength of event-projectile to 10 + """) @Since("2.5.1") public class ExprArrowKnockbackStrength extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprArrowPierceLevel.java b/src/main/java/ch/njol/skript/expressions/ExprArrowPierceLevel.java index 1e6e205dc90..8d3b11287a1 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprArrowPierceLevel.java +++ b/src/main/java/ch/njol/skript/expressions/ExprArrowPierceLevel.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -17,9 +17,11 @@ @Name("Arrow Pierce Level") @Description("An arrow's pierce level.") -@Examples({"on shoot:", - "\tevent-projectile is an arrow", - "\tset arrow pierce level of event-projectile to 5"}) +@Example(""" + on shoot: + event-projectile is an arrow + set arrow pierce level of event-projectile to 5 + """) @RequiredPlugins("Minecraft 1.14+") @Since("2.5.1") public class ExprArrowPierceLevel extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprArrowsStuck.java b/src/main/java/ch/njol/skript/expressions/ExprArrowsStuck.java index edf02dcd851..50a26329d11 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprArrowsStuck.java +++ b/src/main/java/ch/njol/skript/expressions/ExprArrowsStuck.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,7 +16,7 @@ @Name("Arrows Stuck") @Description("The number of arrows stuck in a living entity.") -@Examples("set arrows stuck in player to 5") +@Example("set arrows stuck in player to 5") @Since("2.5") public class ExprArrowsStuck extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAttackCooldown.java b/src/main/java/ch/njol/skript/expressions/ExprAttackCooldown.java index a2a7663a137..7edfd8dcba6 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAttackCooldown.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAttackCooldown.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -12,10 +12,12 @@ @Name("Attack Cooldown") @Description({"Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack.", "NOTE: Currently this can not be set to anything."}) -@Examples({"on damage:", - "\tif attack cooldown of attacker < 1:", - "\t\tset damage to 0", - "\t\tsend \"Your hit was too weak! wait until your weapon is fully charged next time.\" to attacker"}) +@Example(""" + on damage: + if attack cooldown of attacker < 1: + set damage to 0 + send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker + """) @Since("2.6.1") @RequiredPlugins("Minecraft 1.15+") public class ExprAttackCooldown extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAttacked.java b/src/main/java/ch/njol/skript/expressions/ExprAttacked.java index 5b2ed4e51cb..c6cb8d7f14d 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAttacked.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAttacked.java @@ -18,7 +18,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -33,9 +33,11 @@ @Name("Attacked") @Description("The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. " + "When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.") -@Examples({"on damage:", - "\tvictim is a creeper", - "\tdamage the attacked by 1 heart"}) +@Example(""" + on damage: + victim is a creeper + damage the attacked by 1 heart + """) @Since("1.3, 2.6.1 (projectile hit event)") @Events({"damage", "death", "projectile hit"}) public class ExprAttacked extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprAttacker.java b/src/main/java/ch/njol/skript/expressions/ExprAttacker.java index 7e47b97f901..c38284db54b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprAttacker.java +++ b/src/main/java/ch/njol/skript/expressions/ExprAttacker.java @@ -15,7 +15,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -32,10 +32,12 @@ @Name("Attacker") @Description({"The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player.", "Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases."}) -@Examples({"on damage:", - " attacker is a player", - " health of attacker is less than or equal to 2", - " damage victim by 1 heart"}) +@Example(""" + on damage: + attacker is a player + health of attacker is less than or equal to 2 + damage victim by 1 heart + """) @Since("1.3") @Events({"damage", "death", "destroy"}) public class ExprAttacker extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBannerItem.java b/src/main/java/ch/njol/skript/expressions/ExprBannerItem.java index b3902283753..4d2f6c1faf1 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBannerItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBannerItem.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -28,11 +28,9 @@ "Gets the item from a banner pattern type.", "Note that not all banner pattern types have an item.", }) -@Examples({ - "set {_item} to creeper charged banner pattern item", - "set {_item} to snout banner pattern item", - "set {_item} to thing banner pattern item" -}) +@Example("set {_item} to creeper charged banner pattern item") +@Example("set {_item} to snout banner pattern item") +@Example("set {_item} to thing banner pattern item") @Since("2.10") // TODO: turn this into a Literal public class ExprBannerItem extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBannerPatterns.java b/src/main/java/ch/njol/skript/expressions/ExprBannerPatterns.java index 221652286cc..ec5641d2180 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBannerPatterns.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBannerPatterns.java @@ -5,7 +5,7 @@ import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -39,11 +39,9 @@ "For Example, setting the 3rd banner pattern of a banner that has no patterns on it, will internally add 3 base patterns, " + "allowing the 3rd banner pattern to be set." }) -@Examples({ - "broadcast banner patterns of {_banneritem}", - "broadcast 1st banner pattern of block at location(0,0,0)", - "clear banner patterns of {_banneritem}" -}) +@Example("broadcast banner patterns of {_banneritem}") +@Example("broadcast 1st banner pattern of block at location(0,0,0)") +@Example("clear banner patterns of {_banneritem}") @Since("2.10") public class ExprBannerPatterns extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBarterDrops.java b/src/main/java/ch/njol/skript/expressions/ExprBarterDrops.java index bb59eb7230a..385daca4422 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBarterDrops.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBarterDrops.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,12 +22,12 @@ @Name("Barter Drops") @Description("The items dropped by the piglin in a piglin bartering event.") -@Examples({ - "on piglin barter:", - "\tif the bartering drops contain a jack o lantern:", - "\t\tremove jack o lantern from bartering output", - "\t\tbroadcast \"it's not halloween yet!\"" -}) +@Example(""" + on piglin barter: + if the bartering drops contain a jack o lantern: + remove jack o lantern from bartering output + broadcast "it's not halloween yet!" + """) @Since("2.10") public class ExprBarterDrops extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBarterInput.java b/src/main/java/ch/njol/skript/expressions/ExprBarterInput.java index d780058817e..f677e08143c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBarterInput.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBarterInput.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,11 +17,11 @@ @Name("Barter Input") @Description("The item picked up by the piglin in a piglin bartering event.") -@Examples({ - "on piglin barter:", - "\tif the bartering input is a gold ingot:", - "\t\tbroadcast \"my precious...\"" -}) +@Example(""" + on piglin barter: + if the bartering input is a gold ingot: + broadcast "my precious..." + """) @Since("2.10") public class ExprBarterInput extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBed.java b/src/main/java/ch/njol/skript/expressions/ExprBed.java index fb01ff66067..b86d1bc22e8 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBed.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBed.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -25,15 +25,16 @@ "", "NOTE: Offline players can not have their bed location changed, only online players." }) -@Examples({ - "if bed of player exists:", - "\tteleport player the the player's bed", - "else:", - "\tteleport the player to the world's spawn point", - "", - "set the bed location of player to spawn location of world(\"world\") # unsafe/invalid bed location", - "set the safe bed location of player to spawn location of world(\"world\") # safe/valid bed location" -}) +@Example(""" + if bed of player exists: + teleport player the the player's bed + else: + teleport the player to the world's spawn point + """) +@Example(""" + set the bed location of player to spawn location of world("world") # unsafe/invalid bed location + set the safe bed location of player to spawn location of world("world") # safe/valid bed location + """) @Since("2.0, 2.7 (offlineplayers, safe bed)") public class ExprBed extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBeehiveFlower.java b/src/main/java/ch/njol/skript/expressions/ExprBeehiveFlower.java index 2aa0dc10203..75b1a671054 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBeehiveFlower.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBeehiveFlower.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,10 +15,8 @@ @Name("Beehive Target Flower") @Description("The flower a beehive has selected to pollinate from.") -@Examples({ - "set the target flower of {_beehive} to location(0, 0, 0)", - "clear the target flower of {_beehive}" -}) +@Example("set the target flower of {_beehive} to location(0, 0, 0)") +@Example("clear the target flower of {_beehive}") @Since("2.11") public class ExprBeehiveFlower extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBeehiveHoneyLevel.java b/src/main/java/ch/njol/skript/expressions/ExprBeehiveHoneyLevel.java index c70e0207506..ccd00a603e5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBeehiveHoneyLevel.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBeehiveHoneyLevel.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -23,7 +23,7 @@ "The current or max honey level of a beehive.", "The max level is 5, which cannot be changed." }) -@Examples("set the honey level of {_beehive} to the max honey level of {_beehive}") +@Example("set the honey level of {_beehive} to the max honey level of {_beehive}") @Since("2.11") public class ExprBeehiveHoneyLevel extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBiome.java b/src/main/java/ch/njol/skript/expressions/ExprBiome.java index 637fcb634d7..fd9ee5a86e3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBiome.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBiome.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -27,11 +27,13 @@ @Description({"The biome at a certain location. Please note that biomes are only defined for x/z-columns", "(i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x.", "As of Minecraft 1.16, biomes are now 3D (per block vs column)."}) -@Examples({"# damage player in deserts constantly", - "every real minute:", - " loop all players:", - " biome at loop-player is desert", - " damage the loop-player by 1"}) +@Example(""" + # damage player in deserts constantly + every real minute: + loop all players: + biome at loop-player is desert + damage the loop-player by 1 + """) @Since("1.4.4, 2.6.1 (3D biomes)") public class ExprBiome extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBlock.java b/src/main/java/ch/njol/skript/expressions/ExprBlock.java index 412b00786ad..d043d7d8764 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBlock.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBlock.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -25,14 +25,18 @@ @Name("Block") @Description({"The block involved in the event, e.g. the clicked block or the placed block.", "Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'."}) -@Examples({"block is iron ore", - "set block below to air", - "spawn a creeper above the block", - "loop blocks in radius 4:", - " loop-block is obsidian", - " set loop-block to water", - "block is a chest:", - " clear the inventory of the block"}) +@Example("block is iron ore") +@Example("set block below to air") +@Example("spawn a creeper above the block") +@Example(""" + loop blocks in radius 4: + loop-block is obsidian + set loop-block to water + """) +@Example(""" + block is a chest: + clear the inventory of the block + """) @Since("1.0") public class ExprBlock extends WrapperExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBlockData.java b/src/main/java/ch/njol/skript/expressions/ExprBlockData.java index 272a0a9abc2..b3b38ab0803 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBlockData.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBlockData.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -19,12 +19,9 @@ "Get the block data associated with a block.", "This data can also be used to set blocks." }) -@Examples({ - "set {_data} to block data of target block", - "set block at player to {_data}", - "", - "set block data of target block to oak_stairs[facing=south;waterlogged=true]" -}) +@Example("set {_data} to block data of target block") +@Example("set block at player to {_data}") +@Example("set block data of target block to oak_stairs[facing=south;waterlogged=true]") @Since("2.5, 2.5.2 (set), 2.10 (block displays)") public class ExprBlockData extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBlockHardness.java b/src/main/java/ch/njol/skript/expressions/ExprBlockHardness.java index 74eb4c422a6..082a4379d0e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBlockHardness.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBlockHardness.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -13,8 +13,8 @@ @Name("Block Hardness") @Description("Obtains the block's hardness level (also known as \"strength\"). This number is used to calculate the time required to break each block.") -@Examples({"set {_hard} to block hardness of target block", - "if block hardness of target block > 5:"}) +@Example("set {_hard} to block hardness of target block") +@Example("if block hardness of target block > 5:") @RequiredPlugins("Minecraft 1.13+") @Since("2.6") public class ExprBlockHardness extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBlockSound.java b/src/main/java/ch/njol/skript/expressions/ExprBlockSound.java index ab3bd0a7d4c..1626f1539a7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBlockSound.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBlockSound.java @@ -3,7 +3,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.bukkitutil.SoundUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -29,10 +29,8 @@ "Check out this website for a list of sounds in Minecraft, " + "or this one to go to the Sounds wiki page." }) -@Examples({ - "play sound (break sound of dirt) at all players", - "set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone" -}) +@Example("play sound (break sound of dirt) at all players") +@Example("set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone") @Since("2.10") public class ExprBlockSound extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBlockSphere.java b/src/main/java/ch/njol/skript/expressions/ExprBlockSphere.java index bce1ce8e435..04171c276d5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBlockSphere.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBlockSphere.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -27,8 +27,10 @@ */ @Name("Block Sphere") @Description("All blocks in a sphere around a center, mostly useful for looping.") -@Examples({"loop blocks in radius 5 around the player:", - "\tset loop-block to air"}) +@Example(""" + loop blocks in radius 5 around the player: + set loop-block to air + """) @Since("1.0") public class ExprBlockSphere extends SimpleExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBlocks.java b/src/main/java/ch/njol/skript/expressions/ExprBlocks.java index ae96c454b44..d4acbcc7af4 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBlocks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBlocks.java @@ -14,7 +14,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.SkriptConfig; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -31,11 +31,11 @@ @Description({"Blocks relative to other blocks or between other blocks.", "Can be used to get blocks relative to other blocks or for looping.", "Blocks from/to and between will return a straight line whereas blocks within will return a cuboid."}) -@Examples({"loop blocks above the player:", - "loop blocks between the block below the player and the targeted block:", - "set the blocks below the player, the victim and the targeted block to air", - "set all blocks within {loc1} and {loc2} to stone", - "set all blocks within chunk at player to air"}) +@Example("loop blocks above the player:") +@Example("loop blocks between the block below the player and the targeted block:") +@Example("set the blocks below the player, the victim and the targeted block to air") +@Example("set all blocks within {loc1} and {loc2} to stone") +@Example("set all blocks within chunk at player to air") @Since("1.0, 2.5.1 (within/cuboid/chunk)") public class ExprBlocks extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBookAuthor.java b/src/main/java/ch/njol/skript/expressions/ExprBookAuthor.java index dfb96413fb5..b787fd373f5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBookAuthor.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBookAuthor.java @@ -3,7 +3,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,10 +15,10 @@ @Name("Book Author") @Description("The author of a book.") -@Examples({ - "on book sign:", - "\tmessage \"Book Title: %author of event-item%\"" -}) +@Example(""" + on book sign: + message "Book Title: %author of event-item%" + """) @Since("2.2-dev31") public class ExprBookAuthor extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBookPages.java b/src/main/java/ch/njol/skript/expressions/ExprBookPages.java index d7c28425942..f939fd81715 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBookPages.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBookPages.java @@ -16,7 +16,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -36,13 +36,12 @@ "Note: In order to modify the pages of a new written book, you must have the title and author", "of the book set. Skript will do this for you, but if you want your own, please set those values." }) -@Examples({ - "on book sign:", - "\tmessage \"Book Pages: %pages of event-item%\"", - "\tmessage \"Book Page 1: %page 1 of event-item%\"", - "", - "set page 1 of player's held item to \"Book writing\"" -}) +@Example(""" + on book sign: + message "Book Pages: %pages of event-item%" + message "Book Page 1: %page 1 of event-item%" + """) +@Example("set page 1 of player's held item to \"Book writing\"") @Since("2.2-dev31, 2.7 (changers)") public class ExprBookPages extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBookTitle.java b/src/main/java/ch/njol/skript/expressions/ExprBookTitle.java index c8773550103..457a308c37f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBookTitle.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBookTitle.java @@ -3,7 +3,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -14,8 +14,10 @@ @Name("Book Title") @Description("The title of a book.") -@Examples({"on book sign:", - "\tmessage \"Book Title: %title of event-item%\""}) +@Example(""" + on book sign: + message "Book Title: %title of event-item%" + """) @Since("2.2-dev31") public class ExprBookTitle extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBreakSpeed.java b/src/main/java/ch/njol/skript/expressions/ExprBreakSpeed.java index 4bea0487830..32b31ee0cdc 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBreakSpeed.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBreakSpeed.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -25,11 +25,11 @@ "breaking the block each tick. When the total breaking progress reaches 1.0, the block is broken. Note that the " + "break speed can change in the course of breaking a block, e.g. if a potion effect is applied or expires, or the " + "player jumps/enters water.") -@Examples({ - "on left click using diamond pickaxe:", - "\tevent-block is set", - "\tsend \"Break Speed: %break speed for player%\" to player" -}) +@Example(""" + on left click using diamond pickaxe: + event-block is set + send "Break Speed: %break speed for player%" to player + """) @Since("2.7") @RequiredPlugins("1.17+") public class ExprBreakSpeed extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprBrushableItem.java b/src/main/java/ch/njol/skript/expressions/ExprBrushableItem.java index 89a79064f19..35e60b61f51 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprBrushableItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprBrushableItem.java @@ -18,10 +18,8 @@ "Represents the item that is uncovered when dusting.", "The only blocks that can currently be \"dusted\" are Suspicious Gravel and Suspicious Sand." }) -@Examples({ - "send target block's brushable item", - "set {_gravel}'s brushable item to emerald" -}) +@Example("send target block's brushable item") +@Example("set {_gravel}'s brushable item to emerald") @Since("2.12") @RequiredPlugins("Minecraft 1.20+") public class ExprBrushableItem extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCarryingBlockData.java b/src/main/java/ch/njol/skript/expressions/ExprCarryingBlockData.java index 86c0f24e3d8..8c980707db5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCarryingBlockData.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCarryingBlockData.java @@ -4,7 +4,7 @@ import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -24,13 +24,11 @@ "Custom attributes such as NBT or names do not transfer over.", "Blocks, blockdatas and items are acceptable objects to change the carrying block." }) -@Examples({ - "broadcast the carrying blockdata of last spawned enderman", - "set the carried block of last spawned enderman to an oak log", - "set the carrying block data of {_enderman} to oak stairs[facing=north]", - "set the carried blockdata of {_enderman} to {_item}", - "clear the carried blockdata of {_enderman}" -}) +@Example("broadcast the carrying blockdata of last spawned enderman") +@Example("set the carried block of last spawned enderman to an oak log") +@Example("set the carrying block data of {_enderman} to oak stairs[facing=north]") +@Example("set the carried blockdata of {_enderman} to {_item}") +@Example("clear the carried blockdata of {_enderman}") @Since("2.11") public class ExprCarryingBlockData extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCharacterFromCodepoint.java b/src/main/java/ch/njol/skript/expressions/ExprCharacterFromCodepoint.java index 7e87f6841b9..ac24be33fe4 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCharacterFromCodepoint.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCharacterFromCodepoint.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,18 +15,18 @@ @Name("Character from Codepoint") @Description("Returns the character at the specified codepoint") -@Examples({ - "function chars_between(lower: string, upper: string) :: strings:", - "\tset {_lower} to codepoint of {_lower}", - "\treturn {_none} if {_lower} is not set", - "", - "\tset {_upper} to codepoint of {_upper}", - "\treturn {_none} if {_upper} is not set", - "", - "\tloop integers between {_lower} and {_upper}:", - "\t\tadd character from codepoint loop-value to {_chars::*}", - "\treturn {_chars::*}", -}) +@Example(""" + function chars_between(lower: string, upper: string) :: strings: + set {_lower} to codepoint of {_lower} + return {_none} if {_lower} is not set + + set {_upper} to codepoint of {_upper} + return {_none} if {_upper} is not set + + loop integers between {_lower} and {_upper}: + add character from codepoint loop-value to {_chars::*} + return {_chars::*} + """) @Since("2.9.0") public class ExprCharacterFromCodepoint extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCharacters.java b/src/main/java/ch/njol/skript/expressions/ExprCharacters.java index 40800280a3a..e52b3cf37a0 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCharacters.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCharacters.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,16 +24,18 @@ "If you would like only alphanumeric characters you can use the 'alphanumeric' option in the expression.", "If strings of more than one character are given, only the first character of each is used." }) -@Examples({ - "loop characters from \"a\" to \"f\":", - "\tbroadcast \"%loop-value%\"", - "", - "# 0123456789:;<=>?@ABC... ...uvwxyz", - "send characters between \"0\" and \"z\"", - "", - "# 0123456789ABC... ...uvwxyz", - "send alphanumeric characters between \"0\" and \"z\"" -}) +@Example(""" + loop characters from "a" to "f": + broadcast "%loop-value%" + """) +@Example(""" + # 0123456789:;<=>?@ABC... ...uvwxyz + send characters between "0" and "z" + """) +@Example(""" + # 0123456789ABC... ...uvwxyz + send alphanumeric characters between "0" and "z" + """) @Since("2.8.0") public class ExprCharacters extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCharges.java b/src/main/java/ch/njol/skript/expressions/ExprCharges.java index 24f5f39767f..79c031d1a14 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCharges.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCharges.java @@ -4,7 +4,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -23,7 +23,7 @@ @Name("Respawn Anchor Charges") @Description("The charges of a respawn anchor.") -@Examples({"set the charges of event-block to 3"}) +@Example("set the charges of event-block to 3") @RequiredPlugins("Minecraft 1.16+") @Since("2.7") public class ExprCharges extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprChatFormat.java b/src/main/java/ch/njol/skript/expressions/ExprChatFormat.java index 99df19b3bd2..1443a35791a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprChatFormat.java +++ b/src/main/java/ch/njol/skript/expressions/ExprChatFormat.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -20,7 +20,7 @@ @Name("Chat Format") @Description("Can be used to get/retrieve the chat format. The sender of a message is " + "represented by [player] or [sender], and the message by [message] or [msg].") -@Examples({"set the chat format to \"<yellow>[player]<light gray>: <green>[message]\""}) +@Example("set the chat format to \"<yellow>[player]<light gray>: <green>[message]\"") @Since("2.2-dev31") public class ExprChatFormat extends SimpleExpression{ static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprChatRecipients.java b/src/main/java/ch/njol/skript/expressions/ExprChatRecipients.java index 462e518d859..5cff19d6c84 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprChatRecipients.java +++ b/src/main/java/ch/njol/skript/expressions/ExprChatRecipients.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,7 +23,7 @@ @Name("Chat Recipients") @Description("Recipients of chat events where this is called.") -@Examples("chat recipients") +@Example("chat recipients") @Since("2.2-Fixes-v7, 2.2-dev35 (clearing recipients)") public class ExprChatRecipients extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprChestInventory.java b/src/main/java/ch/njol/skript/expressions/ExprChestInventory.java index 3ed07a52255..9fe54564e20 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprChestInventory.java +++ b/src/main/java/ch/njol/skript/expressions/ExprChestInventory.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,15 +25,13 @@ @Name("Custom Chest Inventory") @Description("Returns a chest inventory with the given amount of rows and the name. Use the open inventory effect to open it.") -@Examples({ - "open chest inventory with 1 row named \"test\" to player", - "", - "set {_inventory} to a chest inventory with 1 row", - "set slot 4 of {_inventory} to a diamond named \"example\"", - "open {_inventory} to player", - "", - "open chest inventory named \"<#00ff00>hex coloured title!\" with 6 rows to player", -}) +@Example("open chest inventory with 1 row named \"test\" to player") +@Example(""" + set {_inventory} to a chest inventory with 1 row + set slot 4 of {_inventory} to a diamond named "example" + open {_inventory} to player + """) +@Example("open chest inventory named \"<#00ff00>hex coloured title!\" with 6 rows to player") @Since("2.2-dev34, 2.8.0 (chat format)") public class ExprChestInventory extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprChunk.java b/src/main/java/ch/njol/skript/expressions/ExprChunk.java index cd6c1a3f0e9..3f431de7f44 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprChunk.java +++ b/src/main/java/ch/njol/skript/expressions/ExprChunk.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,10 +22,8 @@ @Name("Chunk") @Description("Returns the chunk of a block, location or entity is in, or a list of the loaded chunks of a world.") -@Examples({ - "add the chunk at the player to {protected chunks::*}", - "set {_chunks::*} to the loaded chunks of the player's world" -}) +@Example("add the chunk at the player to {protected chunks::*}") +@Example("set {_chunks::*} to the loaded chunks of the player's world") @Since("2.0, 2.8.0 (loaded chunks)") public class ExprChunk extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprClicked.java b/src/main/java/ch/njol/skript/expressions/ExprClicked.java index 536da33b70f..d5f5d62b634 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprClicked.java +++ b/src/main/java/ch/njol/skript/expressions/ExprClicked.java @@ -19,7 +19,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -35,11 +35,11 @@ @Name("Clicked Block/Entity/Inventory/Slot") @Description("The clicked block, entity, inventory, inventory slot, inventory click type or inventory action.") -@Examples({ - "message \"You clicked on a %type of clicked entity%!\"", - "if the clicked block is a chest:", - "\tshow the inventory of the clicked block to the player" -}) +@Example(""" + message "You clicked on a %type of clicked entity%!" + if the clicked block is a chest: + show the inventory of the clicked block to the player + """) @Since("1.0, 2.2-dev35 (more clickable things)") @Events({"click", "inventory click"}) public class ExprClicked extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprClientViewDistance.java b/src/main/java/ch/njol/skript/expressions/ExprClientViewDistance.java index ea66c5a0688..1a9a391e4d7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprClientViewDistance.java +++ b/src/main/java/ch/njol/skript/expressions/ExprClientViewDistance.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -14,7 +14,8 @@ @Name("View Distance of Client") @Description("The view distance of the client. Can not be changed. " + "This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.") -@Examples({"set {_clientView} to the client view distance of player", "set view distance of player to client view distance of player"}) +@Example("set {_clientView} to the client view distance of player") +@Example("set view distance of player to client view distance of player") @RequiredPlugins("1.13.2+") @Since("2.5") public class ExprClientViewDistance extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCmdCooldownInfo.java b/src/main/java/ch/njol/skript/expressions/ExprCmdCooldownInfo.java index d952105fa22..1afd010d11e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCmdCooldownInfo.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCmdCooldownInfo.java @@ -12,7 +12,7 @@ import ch.njol.skript.command.ScriptCommand; import ch.njol.skript.command.ScriptCommandEvent; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -27,12 +27,13 @@ @Name("Cooldown Time/Remaining Time/Elapsed Time/Last Usage/Bypass Permission") @Description({"Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time,", "the last usage date, or the cooldown bypass permission."}) -@Examples({ - "command /home:", - "\tcooldown: 10 seconds", - "\tcooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.", - "\ttrigger:", - "\t\tteleport player to {home::%player%}"}) +@Example(""" + command /home: + cooldown: 10 seconds + cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%. + trigger: + teleport player to {home::%player%} + """) @Since("2.2-dev33") public class ExprCmdCooldownInfo extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCodepoint.java b/src/main/java/ch/njol/skript/expressions/ExprCodepoint.java index 037b415686c..d7d9aa714d7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCodepoint.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCodepoint.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -12,25 +12,25 @@ @Name("Character Codepoint") @Description("Returns the Unicode codepoint of a character") -@Examples({ - "function is_in_order(letters: strings) :: boolean:", - "\tloop {_letters::*}:", - "\t\tset {_codepoint} to codepoint of lowercase loop-value", - "", - "\t\treturn false if {_codepoint} is not set # 'loop-value is not a single character'", - "", - "\t\tif:", - "\t\t\t{_previous-codepoint} is set", - "\t\t\t# if the codepoint of the current character is not", - "\t\t\t# 1 more than the codepoint of the previous character", - "\t\t\t# then the letters are not in order", - "\t\t\t{_codepoint} - {_previous-codepoint} is not 1", - "\t\tthen:", - "\t\t\treturn false", - "", - "\t\tset {_previous-codepoint} to {_codepoint}", - "\treturn true" -}) +@Example(""" + function is_in_order(letters: strings) :: boolean: + loop {_letters::*}: + set {_codepoint} to codepoint of lowercase loop-value + + return false if {_codepoint} is not set # 'loop-value is not a single character' + + if: + {_previous-codepoint} is set + # if the codepoint of the current character is not + # 1 more than the codepoint of the previous character + # then the letters are not in order + {_codepoint} - {_previous-codepoint} is not 1 + then: + return false + + set {_previous-codepoint} to {_codepoint} + return true + """) @Since("2.9.0") public class ExprCodepoint extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprColorOf.java b/src/main/java/ch/njol/skript/expressions/ExprColorOf.java index 6652401c96e..8d4a914b3c0 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprColorOf.java +++ b/src/main/java/ch/njol/skript/expressions/ExprColorOf.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -42,12 +42,12 @@ "Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support " + "setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks." }) -@Examples({ - "on click on wool:", - "if event-block is tagged with minecraft tag \"wool\":", - "\tmessage \"This wool block is <%color of block%>%color of block%!\"", - "\tset the color of the block to black" -}) +@Example(""" + on click on wool: + if event-block is tagged with minecraft tag "wool": + message "This wool block is <%color of block%>%color of block%!" + set the color of the block to black + """) @Since("1.2, 2.10 (displays)") public class ExprColorOf extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprColoured.java b/src/main/java/ch/njol/skript/expressions/ExprColoured.java index 701ed2fd843..8428b4be99e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprColoured.java +++ b/src/main/java/ch/njol/skript/expressions/ExprColoured.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -20,14 +20,20 @@ "any colors and chat styles from the message. Parsing all", "chat styles requires this expression to be used in same line with", "the send effect."}) -@Examples({"on chat:", - " set message to colored message # Safe; only colors get parsed", - "command /fade <player>:", - " trigger:", - " set display name of the player-argument to uncolored display name of the player-argument", - "command /format <text>:", - " trigger:", - " message formatted text-argument # Safe, because we're sending to whoever used this command"}) +@Example(""" + on chat: + set message to colored message # Safe; only colors get parsed + """) +@Example(""" + command /fade : + trigger: + set display name of the player-argument to uncolored display name of the player-argument + """) +@Example(""" + command /format : + trigger: + message formatted text-argument # Safe, because we're sending to whoever used this command + """) @Since("2.0") public class ExprColoured extends PropertyExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCommand.java b/src/main/java/ch/njol/skript/expressions/ExprCommand.java index 8cb71f77e34..e570413b451 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCommand.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCommand.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,12 +25,14 @@ */ @Name("Command") @Description("The command that caused an 'on command' event (excluding the leading slash and all arguments)") -@Examples({"# prevent any commands except for the /exit command during some game", - "on command:", - "\tif {game::%player%::playing} is true:", - "\t\tif the command is not \"exit\":", - "\t\t\tmessage \"You're not allowed to use commands during the game\"", - "\t\t\tcancel the event"}) +@Example(""" + # prevent any commands except for the /exit command during some game + on command: + if {game::%player%::playing} is true: + if the command is not "exit": + message "You're not allowed to use commands during the game" + cancel the event + """) @Since("2.0, 2.7 (support for script commands)") @Events("command") public class ExprCommand extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCommandBlockCommand.java b/src/main/java/ch/njol/skript/expressions/ExprCommandBlockCommand.java index be034ed9325..0c0995f269b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCommandBlockCommand.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCommandBlockCommand.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -17,10 +17,8 @@ @Description( "Gets or sets the command associated with a command block or minecart with command block." ) -@Examples({ - "send command of {_block}", - "set command of {_cmdMinecart} to \"say asdf\"" -}) +@Example("send command of {_block}") +@Example("set command of {_cmdMinecart} to \"say asdf\"") @Since("2.10") public class ExprCommandBlockCommand extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCommandInfo.java b/src/main/java/ch/njol/skript/expressions/ExprCommandInfo.java index 8e88a9751b7..39ac41c8ccc 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCommandInfo.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCommandInfo.java @@ -21,7 +21,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.command.Commands; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -32,25 +32,24 @@ @Name("Command Info") @Description("Get information about a command.") -@Examples({ - "main command label of command \"skript\"", - "description of command \"help\"", - "label of command \"pl\"", - "usage of command \"help\"", - "aliases of command \"bukkit:help\"", - "permission of command \"/op\"", - "command \"op\"'s permission message", - "command \"sk\"'s plugin owner", - "", - "command /greet :", - "\tusage: /greet ", - "\ttrigger:", - "\t\tif arg-1 is sender:", - "\t\t\tsend \"&cYou can't greet yourself! Usage: %the usage%\"", - "\t\t\tstop", - "\t\tsend \"%sender% greets you!\" to arg-1", - "\t\tsend \"You greeted %arg-1%!\"" -}) +@Example("main command label of command \"skript\"") +@Example("description of command \"help\"") +@Example("label of command \"pl\"") +@Example("usage of command \"help\"") +@Example("aliases of command \"bukkit:help\"") +@Example("permission of command \"/op\"") +@Example("command \"op\"'s permission message") +@Example("command \"sk\"'s plugin owner") +@Example(""" + command /greet : + usage: /greet + trigger: + if arg-1 is sender: + send "&cYou can't greet yourself! Usage: %the usage%" + stop + send "%sender% greets you!" to arg-1 + send "You greeted %arg-1%!" + """) @Since("2.6") public class ExprCommandInfo extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCommandSender.java b/src/main/java/ch/njol/skript/expressions/ExprCommandSender.java index 94193e6b3f7..f3eb52b11ab 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCommandSender.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCommandSender.java @@ -4,7 +4,7 @@ import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -14,12 +14,11 @@ "The player or the console who sent a command. Mostly useful in commands and command events.", "If the command sender is a command block, its location can be retrieved by using %block's location%" }) -@Examples({ - "make the command sender execute \"/say hi!\"", - "", - "on command:", - "\tlog \"%executor% used command /%command% %arguments%\" to \"commands.log\"" -}) +@Example("make the command sender execute \"/say hi!\"") +@Example(""" + on command: + log "%executor% used command /%command% %arguments%" to "commands.log" + """) @Since("2.0") @Events("command") public class ExprCommandSender extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCompassTarget.java b/src/main/java/ch/njol/skript/expressions/ExprCompassTarget.java index 9228c9d6ea0..87054814af7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCompassTarget.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCompassTarget.java @@ -7,7 +7,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -19,10 +19,12 @@ @Description({"The location a player's compass is pointing at.", "As of Minecraft 1.21.4, the compass is controlled by the resource pack and by default will not point to " + "this compass target when used outside of the overworld dimension."}) -@Examples({"# make all player's compasses target a player stored in {compass::target::%player%}", - "every 5 seconds:", - "\tloop all players:", - "\t\tset the loop-player's compass target to location of {compass::target::%%loop-player%}"}) +@Example(""" + # make all player's compasses target a player stored in {compass::target::%player%} + every 5 seconds: + loop all players: + set the loop-player's compass target to location of {compass::target::%%loop-player%} + """) @Since("2.0") public class ExprCompassTarget extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprConfig.java b/src/main/java/ch/njol/skript/expressions/ExprConfig.java index 689ba081270..55fef0c027c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprConfig.java +++ b/src/main/java/ch/njol/skript/expressions/ExprConfig.java @@ -4,7 +4,7 @@ import ch.njol.skript.SkriptConfig; import ch.njol.skript.config.Config; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -21,11 +21,11 @@ "The Skript config.", "This can be reloaded, or navigated to retrieve options." }) -@Examples({""" +@Example(""" set {_node} to node "language" in the skript config if text value of {_node} is "french": broadcast "Bonjour!" - """}) + """) @Since("2.10") public class ExprConfig extends SimpleExpression implements ReflectionExperimentSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCoordinate.java b/src/main/java/ch/njol/skript/expressions/ExprCoordinate.java index 9f4380e0a7a..301a99d9ad4 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCoordinate.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCoordinate.java @@ -3,7 +3,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -21,8 +21,10 @@ */ @Name("Coordinate") @Description("Represents a given coordinate of a location. ") -@Examples({"player's y-coordinate is smaller than 40:", - " message \"Watch out for lava!\""}) +@Example(""" + player's y-coordinate is smaller than 40: + message "Watch out for lava!" + """) @Since("1.4.3") public class ExprCoordinate extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCreeperMaxFuseTicks.java b/src/main/java/ch/njol/skript/expressions/ExprCreeperMaxFuseTicks.java index 53d6b26ae5a..a14766b6341 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCreeperMaxFuseTicks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCreeperMaxFuseTicks.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,7 +16,7 @@ @Name("Creeper Max Fuse Ticks") @Description("The max fuse ticks that a creeper has.") -@Examples("set target entity's max fuse ticks to 20 #1 second") +@Example("set target entity's max fuse ticks to 20 #1 second") @Since("2.5") public class ExprCreeperMaxFuseTicks extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprCursorSlot.java b/src/main/java/ch/njol/skript/expressions/ExprCursorSlot.java index 0b6580a0d9b..5b2a2daf73f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprCursorSlot.java +++ b/src/main/java/ch/njol/skript/expressions/ExprCursorSlot.java @@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -22,10 +22,8 @@ */ @Name("Cursor Slot") @Description("The item which the player has on their inventory cursor. This slot is always empty if player has no inventory open.") -@Examples({ - "cursor slot of player is dirt", - "set cursor slot of player to 64 diamonds" -}) +@Example("cursor slot of player is dirt") +@Example("set cursor slot of player to 64 diamonds") @Since("2.2-dev17") public class ExprCursorSlot extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDamage.java b/src/main/java/ch/njol/skript/expressions/ExprDamage.java index 962e20262f2..77af9b89b35 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDamage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDamage.java @@ -11,7 +11,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -28,13 +28,15 @@ "For entity damage events, possibly ignoring armour, criticals and/or enchantments (remember that in Skript '1' is one full heart, not half a heart).", "For items, it's the amount of durability damage the item will be taking." }) -@Examples({ - "on item damage:", - "\tevent-item is any tool", - "\tclear damage # unbreakable tools as the damage will be 0", - "on damage:", - "\tincrease the damage by 2" -}) +@Example(""" + on item damage: + event-item is any tool + clear damage # unbreakable tools as the damage will be 0 + """) +@Example(""" + on damage: + increase the damage by 2 + """) @Since("1.3.5, 2.8.0 (item damage event)") @Events({"Damage", "Vehicle Damage", "Item Damage"}) public class ExprDamage extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDamageCause.java b/src/main/java/ch/njol/skript/expressions/ExprDamageCause.java index 56589adb4af..88d06ce6b20 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDamageCause.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDamageCause.java @@ -3,7 +3,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -11,7 +11,7 @@ @Name("Damage Cause") @Description("The damage cause of a damage event. Please click on the link for more information.") -@Examples("damage cause is lava, fire or burning") +@Example("damage cause is lava, fire or burning") @Since("2.0") public class ExprDamageCause extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDamagedItem.java b/src/main/java/ch/njol/skript/expressions/ExprDamagedItem.java index ae5735e1ef8..9806b264afc 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDamagedItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDamagedItem.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -17,9 +17,10 @@ @Name("Damaged Item") @Description("Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks") -@Examples({"give player diamond sword with damage value 100", "set player's tool to diamond hoe damaged by 250", - "give player diamond sword with damage 700 named \"BROKEN SWORD\"", - "set {_item} to diamond hoe with damage value 50 named \"SAD HOE\""}) +@Example("give player diamond sword with damage value 100") +@Example("set player's tool to diamond hoe damaged by 250") +@Example("give player diamond sword with damage 700 named \"BROKEN SWORD\"") +@Example("set {_item} to diamond hoe with damage value 50 named \"SAD HOE\"") @Since("2.4") public class ExprDamagedItem extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDateAgoLater.java b/src/main/java/ch/njol/skript/expressions/ExprDateAgoLater.java index 9081be58e52..cf31b714eec 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDateAgoLater.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDateAgoLater.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,9 +19,9 @@ @Name("Date Ago/Later") @Description("A date the specified timespan before/after another date.") -@Examples({"set {_yesterday} to 1 day ago", - "set {_hourAfter} to 1 hour after {someOtherDate}", - "set {_hoursBefore} to 5 hours before {someOtherDate}"}) +@Example("set {_yesterday} to 1 day ago") +@Example("set {_hourAfter} to 1 hour after {someOtherDate}") +@Example("set {_hoursBefore} to 5 hours before {someOtherDate}") @Since("2.2-dev33") public class ExprDateAgoLater extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDefaultValue.java b/src/main/java/ch/njol/skript/expressions/ExprDefaultValue.java index 29c510246a4..d66c1862498 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDefaultValue.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDefaultValue.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,7 +23,7 @@ @Name("Default Value") @Description("A shorthand expression for giving things a default value. If the first thing isn't set, the second thing will be returned.") -@Examples({"broadcast {score::%player's uuid%} otherwise \"%player% has no score!\""}) +@Example("broadcast {score::%player's uuid%} otherwise \"%player% has no score!\"") @Since("2.2-dev36") public class ExprDefaultValue extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDequeuedQueue.java b/src/main/java/ch/njol/skript/expressions/ExprDequeuedQueue.java index 29c6566beea..2dcc1cdbc33 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDequeuedQueue.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDequeuedQueue.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,12 +23,11 @@ The order of the list will be the same as the order of the elements in the queue. If a list variable is set to this, it will use numerical indices. The original queue will not be changed.""") -@Examples({ - """ - set {queue} to a new queue - add "hello" and "there" to {queue} - set {list::*} to dequeued {queue}""" -}) +@Example(""" + set {queue} to a new queue + add "hello" and "there" to {queue} + set {list::*} to dequeued {queue} + """) @Since("2.10 (experimental)") public class ExprDequeuedQueue extends SimpleExpression implements QueueExperimentSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDifference.java b/src/main/java/ch/njol/skript/expressions/ExprDifference.java index 745c2fb4460..d44c675216a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDifference.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDifference.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.conditions.CondCompare; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -27,10 +27,10 @@ "The difference between two values", "Supported types include numbers, dates and times." }) -@Examples({ - "if difference between {command::%player%::lastuse} and now is smaller than a minute:", - "\tmessage \"You have to wait a minute before using this command again!\"" -}) +@Example(""" + if difference between {command::%player%::lastuse} and now is smaller than a minute: + message "You have to wait a minute before using this command again!" + """) @Since("1.4") public class ExprDifference extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDifficulty.java b/src/main/java/ch/njol/skript/expressions/ExprDifficulty.java index 79210ededf5..c7fed7180c3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDifficulty.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDifficulty.java @@ -7,7 +7,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,7 +15,7 @@ @Name("Difficulty") @Description("The difficulty of a world.") -@Examples("set the difficulty of \"world\" to hard") +@Example("set the difficulty of \"world\" to hard") @Since("2.3") public class ExprDifficulty extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDirection.java b/src/main/java/ch/njol/skript/expressions/ExprDirection.java index 5f9ba5cc7ff..b0a709accc8 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDirection.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDirection.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -26,20 +26,22 @@ */ @Name("Direction") @Description("A helper expression for the direction type.") -@Examples({"thrust the player upwards", - "set the block behind the player to water", - "loop blocks above the player:", - " set {_rand} to a random integer between 1 and 10", - " set the block {_rand} meters south east of the loop-block to stone", - "block in horizontal facing of the clicked entity from the player is air", - "spawn a creeper 1.5 meters horizontally behind the player", - "spawn a TNT 5 meters above and 2 meters horizontally behind the player", - "thrust the last spawned TNT in the horizontal direction of the player with speed 0.2", - "push the player upwards and horizontally forward at speed 0.5", - "push the clicked entity in in the direction of the player at speed -0.5", - "open the inventory of the block 2 blocks below the player to the player", - "teleport the clicked entity behind the player", - "grow a regular tree 2 meters horizontally behind the player"}) +@Example("thrust the player upwards") +@Example("set the block behind the player to water") +@Example(""" + loop blocks above the player: + set {_rand} to a random integer between 1 and 10 + set the block {_rand} meters south east of the loop-block to stone + """) +@Example("block in horizontal facing of the clicked entity from the player is air") +@Example("spawn a creeper 1.5 meters horizontally behind the player") +@Example("spawn a TNT 5 meters above and 2 meters horizontally behind the player") +@Example("thrust the last spawned TNT in the horizontal direction of the player with speed 0.2") +@Example("push the player upwards and horizontally forward at speed 0.5") +@Example("push the clicked entity in in the direction of the player at speed -0.5") +@Example("open the inventory of the block 2 blocks below the player to the player") +@Example("teleport the clicked entity behind the player") +@Example("grow a regular tree 2 meters horizontally behind the player") @Since("1.0 (basic), 2.0 (extended)") public class ExprDirection extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDistance.java b/src/main/java/ch/njol/skript/expressions/ExprDistance.java index 749031b11a2..2698b600fab 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDistance.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDistance.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,8 +19,10 @@ @Name("Distance") @Description("The distance between two points.") -@Examples({"if the distance between the player and {home::%uuid of player%} is smaller than 20:", - "\tmessage \"You're very close to your home!\""}) +@Example(""" + if the distance between the player and {home::%uuid of player%} is smaller than 20: + message "You're very close to your home!" + """) @Since("1.0") public class ExprDistance extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDomestication.java b/src/main/java/ch/njol/skript/expressions/ExprDomestication.java index cd7dbc72f72..5de1f45dc8e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDomestication.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDomestication.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -22,13 +22,13 @@ "The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse).", "The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0)." }) -@Examples({ - "function domesticateAndTame(horse: entity, p: offline player, i: int = 10):", - "\tadd {_i} to domestication level of {_horse}", - "\tif domestication level of {_horse} >= max domestication level of {_horse}:", - "\t\ttame {_horse}", - "\t\tset tamer of {_horse} to {_p}" -}) +@Example(""" + function domesticateAndTame(horse: entity, p: offline player, i: int = 10): + add {_i} to domestication level of {_horse} + if domestication level of {_horse} >= max domestication level of {_horse}: + tame {_horse} + set tamer of {_horse} to {_p} + """) @Since("2.10") public class ExprDomestication extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDrops.java b/src/main/java/ch/njol/skript/expressions/ExprDrops.java index 436129221d9..4d37038976a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDrops.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDrops.java @@ -29,10 +29,8 @@ "Drops can be prevented by removing them with \"remove ... from drops\", " + "e.g. \"remove all pickaxes from the drops\", or \"clear drops\" if you don't want any drops at all." }) -@Examples({ - "clear drops", - "remove 4 planks from the drops" -}) +@Example("clear drops") +@Example("remove 4 planks from the drops") @Since("1.0") @Events("death") public class ExprDrops extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDropsOfBlock.java b/src/main/java/ch/njol/skript/expressions/ExprDropsOfBlock.java index fd809b73b56..19a1862f296 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDropsOfBlock.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDropsOfBlock.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -25,8 +25,10 @@ @Name("Drops Of Block") @Description("A list of the items that will drop when a block is broken.") @RequiredPlugins("Minecraft 1.15+ ('as %entity%')") -@Examples({"on break of block:", - "\tgive drops of block using player's tool to player"}) +@Example(""" + on break of block: + give drops of block using player's tool to player + """) @Since("2.5.1") public class ExprDropsOfBlock extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDuplicateCooldown.java b/src/main/java/ch/njol/skript/expressions/ExprDuplicateCooldown.java index 7a5af5a9bc2..2b02e9538e6 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDuplicateCooldown.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDuplicateCooldown.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -20,13 +20,11 @@ "The cooldown time until an allay can duplicate again naturally.", "Resetting the cooldown time will set the cooldown time to the same amount of time after an allay has duplicated." }) -@Examples({ - "set {_time} to the duplicate cooldown of last spawned allay", - "add 5 seconds to the duplication cool down time of last spawned allay", - "remove 3 seconds from the duplicating cooldown time of last spawned allay", - "clear the clone cool down of last spawned allay", - "reset the cloning cool down time of last spawned allay" -}) +@Example("set {_time} to the duplicate cooldown of last spawned allay") +@Example("add 5 seconds to the duplication cool down time of last spawned allay") +@Example("remove 3 seconds from the duplicating cooldown time of last spawned allay") +@Example("clear the clone cool down of last spawned allay") +@Example("reset the cloning cool down time of last spawned allay") @Since("2.11") public class ExprDuplicateCooldown extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDurability.java b/src/main/java/ch/njol/skript/expressions/ExprDurability.java index 06b176bccdb..bb0a9b68866 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDurability.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDurability.java @@ -4,7 +4,7 @@ import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -19,11 +19,9 @@ @Name("Damage Value/Durability") @Description("The damage value/durability of an item.") -@Examples({ - "set damage value of player's tool to 10", - "reset the durability of {_item}", - "set durability of player's held item to 0" -}) +@Example("set damage value of player's tool to 10") +@Example("reset the durability of {_item}") +@Example("set durability of player's held item to 0") @Since("1.2, 2.7 (durability reversed)") public class ExprDurability extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprDustedStage.java b/src/main/java/ch/njol/skript/expressions/ExprDustedStage.java index c8f971f5411..ee6ec9cb89b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprDustedStage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprDustedStage.java @@ -19,10 +19,8 @@ "Represents how far the block has been uncovered.", "The only blocks that can currently be \"dusted\" are Suspicious Gravel and Suspicious Sand." }) -@Examples({ - "send target block's maximum dusted stage", - "set {_sand}'s dusted stage to 2" -}) +@Example("send target block's maximum dusted stage") +@Example("set {_sand}'s dusted stage to 2") @Since("2.12") @RequiredPlugins("Minecraft 1.20+") public class ExprDustedStage extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEgg.java b/src/main/java/ch/njol/skript/expressions/ExprEgg.java index 17b18ad73f1..960b43fa920 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEgg.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEgg.java @@ -6,14 +6,14 @@ import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @Name("The Egg") @Description("The egg thrown in a Player Egg Throw event.") -@Examples("spawn an egg at the egg") +@Example("spawn an egg at the egg") @Events("Egg Throw") @Since("2.7") public class ExprEgg extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprElement.java b/src/main/java/ch/njol/skript/expressions/ExprElement.java index 67d354768a3..01c307030ef 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprElement.java +++ b/src/main/java/ch/njol/skript/expressions/ExprElement.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -33,15 +33,13 @@ "Asking for elements from a queue will also remove them from the queue, see the new queue expression for more information.", "See also: random expression" }) -@Examples({ - "broadcast the first 3 elements of {top players::*}", - "set {_last} to last element of {top players::*}", - "set {_random player} to random element out of all players", - "send 2nd last element of {top players::*} to player", - "set {page2::*} to elements from 11 to 20 of {top players::*}", - "broadcast the 1st element in {queue}", - "broadcast the first 3 elements in {queue}" -}) +@Example("broadcast the first 3 elements of {top players::*}") +@Example("set {_last} to last element of {top players::*}") +@Example("set {_random player} to random element out of all players") +@Example("send 2nd last element of {top players::*} to player") +@Example("set {page2::*} to elements from 11 to 20 of {top players::*}") +@Example("broadcast the 1st element in {queue}") +@Example("broadcast the first 3 elements in {queue}") @Since("2.0, 2.7 (relative to last element), 2.8.0 (range of elements)") public class ExprElement extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantItem.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantItem.java index cf06ff046bc..59c31f6b364 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantItem.java @@ -10,7 +10,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,10 +24,14 @@ @Name("Enchant Item") @Description({"The enchant item in an enchant prepare event or enchant event.", "It can be modified, but enchantments will still be applied in the enchant event."}) -@Examples({"on enchant:", - "\tset the enchanted item to a diamond chestplate", - "on enchant prepare:", - "\tset the enchant item to a wooden sword"}) +@Example(""" + on enchant: + set the enchanted item to a diamond chestplate + """) +@Example(""" + on enchant prepare: + set the enchant item to a wooden sword + """) @Events({"enchant prepare", "enchant"}) @Since("2.5") public class ExprEnchantItem extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantingExpCost.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantingExpCost.java index 4f9a52763dd..e22595e946b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantingExpCost.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantingExpCost.java @@ -8,7 +8,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,8 +23,10 @@ @Name("Enchanting Experience Cost") @Description({"The cost of enchanting in an enchant event.", "This is number that was displayed in the enchantment table, not the actual number of levels removed."}) -@Examples({"on enchant:", - "\tsend \"Cost: %the displayed enchanting cost%\" to player"}) +@Example(""" + on enchant: + send "Cost: %the displayed enchanting cost%" to player + """) @Events("enchant") @Since("2.5") public class ExprEnchantingExpCost extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentBonus.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentBonus.java index 0e599582871..fce4094a136 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentBonus.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentBonus.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,8 +19,10 @@ @Name("Enchantment Bonus") @Description("The enchantment bonus in an enchant prepare event. This represents the number of bookshelves affecting/surrounding the enchantment table.") -@Examples({"on enchant:", - "\tsend \"There are %enchantment bonus% bookshelves surrounding this enchantment table!\" to player"}) +@Example(""" + on enchant: + send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player + """) @Events("enchant prepare") @Since("2.5") public class ExprEnchantmentBonus extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentLevel.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentLevel.java index c67b2ba8b38..9fa8ffd771f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentLevel.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentLevel.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,8 +22,10 @@ @Name("Enchantment Level") @Description("The level of a particular enchantment on an item.") -@Examples({"player's tool is a sword of sharpness:", - "\tmessage \"You have a sword of sharpness %level of sharpness of the player's tool% equipped\""}) +@Example(""" + player's tool is a sword of sharpness: + message "You have a sword of sharpness %level of sharpness of the player's tool% equipped" + """) @Since("2.0") public class ExprEnchantmentLevel extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOffer.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOffer.java index e96f501b1a2..ffac6e92301 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOffer.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOffer.java @@ -14,7 +14,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -29,8 +29,10 @@ @Name("Enchantment Offer") @Description("The enchantment offer in enchant prepare events.") -@Examples({"on enchant prepare:", - "\tsend \"Your enchantment offers are: %the enchantment offers%\" to player"}) +@Example(""" + on enchant prepare: + send "Your enchantment offers are: %the enchantment offers%" to player + """) @Since("2.5") @Events("enchant prepare") @RequiredPlugins("1.11 or newer") diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOfferCost.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOfferCost.java index f01d87a476b..1aa1844b024 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOfferCost.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantmentOfferCost.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -22,7 +22,7 @@ "This changes how many levels are required to enchant, but does not change the number of levels removed.", "To change the number of levels removed, use the enchant event." }) -@Examples("set cost of enchantment offer 1 to 50") +@Example("set cost of enchantment offer 1 to 50") @Since("2.5") @RequiredPlugins("1.11 or newer") public class ExprEnchantmentOfferCost extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnchantments.java b/src/main/java/ch/njol/skript/expressions/ExprEnchantments.java index 2df142c0bce..2df74875524 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnchantments.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnchantments.java @@ -12,7 +12,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -25,7 +25,7 @@ @Name("Item Enchantments") @Description("All the enchantments an item type has.") -@Examples("clear enchantments of event-item") +@Example("clear enchantments of event-item") @Since("2.2-dev36") public class ExprEnchantments extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEnderChest.java b/src/main/java/ch/njol/skript/expressions/ExprEnderChest.java index dca7814af51..52f2fa0030e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEnderChest.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEnderChest.java @@ -5,7 +5,7 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,7 +15,7 @@ */ @Name("Ender Chest") @Description("The ender chest of a player.") -@Examples("open the player's ender chest to the player") +@Example("open the player's ender chest to the player") @Since("2.0") public class ExprEnderChest extends SimplePropertyExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntities.java b/src/main/java/ch/njol/skript/expressions/ExprEntities.java index 5ddd011b747..620fafb84f3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntities.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntities.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -31,12 +31,12 @@ @Name("Entities") @Description("All entities in all worlds, in a specific world, in a chunk, in a radius around a certain location or within two locations. " + "e.g. all players, all creepers in the player's world, or players in radius 100 of the player.") -@Examples({"kill all creepers in the player's world", - "send \"Psst!\" to all players within 100 meters of the player", - "give a diamond to all ops", - "heal all tamed wolves in radius 2000 around {town center}", - "delete all monsters in chunk at player", - "size of all players within {_corner::1} and {_corner::2}}"}) +@Example("kill all creepers in the player's world") +@Example("send \"Psst!\" to all players within 100 meters of the player") +@Example("give a diamond to all ops") +@Example("heal all tamed wolves in radius 2000 around {town center}") +@Example("delete all monsters in chunk at player") +@Example("size of all players within {_corner::1} and {_corner::2}}") @Since("1.2.1, 2.5 (chunks), 2.10 (within)") public class ExprEntities extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntity.java b/src/main/java/ch/njol/skript/expressions/ExprEntity.java index 0b92213e627..31862bff9e9 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntity.java @@ -8,7 +8,7 @@ import ch.njol.skript.aliases.Aliases; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -29,10 +29,10 @@ @Name("Creature/Entity/Player/Projectile/Villager/Powered Creeper/etc.") @Description({"The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow).", "You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'."}) -@Examples({"give a diamond sword of sharpness 3 to the player", - "kill the creeper", - "kill all powered creepers in the wolf's world", - "projectile is an arrow"}) +@Example("give a diamond sword of sharpness 3 to the player") +@Example("kill the creeper") +@Example("kill all powered creepers in the wolf's world") +@Example("projectile is an arrow") @Since("1.0") public class ExprEntity extends SimpleExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java b/src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java index 6c672c59ed6..9254998b0a9 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -28,11 +28,11 @@ "Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead.", "Resetting an entity's attribute is only available in Minecraft 1.11 and above." }) -@Examples({ - "on damage of player:", - "\tsend \"You are wounded!\" to victim", - "\tset victim's attack speed attribute to 2" -}) +@Example(""" + on damage of player: + send "You are wounded!" to victim + set victim's attack speed attribute to 2 + """) @Since("2.5, 2.6.1 (final attribute value)") public class ExprEntityAttribute extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntityItemUseTime.java b/src/main/java/ch/njol/skript/expressions/ExprEntityItemUseTime.java index 8604b9192d2..75f055cc91d 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntityItemUseTime.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntityItemUseTime.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -19,12 +19,12 @@ "or the time left for them to finish using an item.", "If an entity is not using any item, this will return 0 seconds." }) -@Examples({ - "on right click:", - "\tbroadcast player's remaining item use time", - "\twait 1 second", - "\tbroadcast player's item use time" -}) +@Example(""" + on right click: + broadcast player's remaining item use time + wait 1 second + broadcast player's item use time + """) @Since("2.8.0") public class ExprEntityItemUseTime extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntitySnapshot.java b/src/main/java/ch/njol/skript/expressions/ExprEntitySnapshot.java index 9ce582aea5a..744336f78b6 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntitySnapshot.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntitySnapshot.java @@ -19,14 +19,14 @@ + "(name, health, attributes, etc.) at the time this expression is used.", "Individual attributes of a snapshot cannot be modified or retrieved." }) -@Examples({ - "spawn a pig at location(0, 0, 0):", - "\tset the max health of entity to 20", - "\tset the health of entity to 20", - "\tset {_snapshot} to the entity snapshot of entity", - "\tclear entity", - "spawn {_snapshot} at location(0, 0, 0)" -}) +@Example(""" + spawn a pig at location(0, 0, 0): + set the max health of entity to 20 + set the health of entity to 20 + set {_snapshot} to the entity snapshot of entity + clear entity + spawn {_snapshot} at location(0, 0, 0) + """) @RequiredPlugins("Minecraft 1.20.2+") @Since("2.10") public class ExprEntitySnapshot extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntitySound.java b/src/main/java/ch/njol/skript/expressions/ExprEntitySound.java index 177c124e9de..166c8976988 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntitySound.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntitySound.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.bukkitutil.SoundUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -26,10 +26,8 @@ @Name("Entity Sound") @Description("Gets the sound that a given entity will make in a specific scenario.") -@Examples({ - "play sound (hurt sound of player) at player", - "set {_sounds::*} to death sounds of (all mobs in radius 10 of player)" -}) +@Example("play sound (hurt sound of player) at player") +@Example("set {_sounds::*} to death sounds of (all mobs in radius 10 of player)") @Since("2.10") @RequiredPlugins("Spigot 1.19.2+") public class ExprEntitySound extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEntityStorageEntityCount.java b/src/main/java/ch/njol/skript/expressions/ExprEntityStorageEntityCount.java index 8bad77a4e00..1690c6b565b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEntityStorageEntityCount.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEntityStorageEntityCount.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -23,10 +23,8 @@ "The current number of entities stored inside an entity block storage (i.e. beehive).", "The maximum amount of entities an entity block storage can hold." }) -@Examples({ - "broadcast the stored entity count of {_beehive}", - "set the maximum entity count of {_beehive} to 20" -}) +@Example("broadcast the stored entity count of {_beehive}") +@Example("set the maximum entity count of {_beehive} to 20") @Since("2.11") public class ExprEntityStorageEntityCount extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEvtInitiator.java b/src/main/java/ch/njol/skript/expressions/ExprEvtInitiator.java index 5749ed1803c..6ec2f503161 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEvtInitiator.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEvtInitiator.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,11 +19,11 @@ @Name("Initiator Inventory") @Description("Returns the initiator inventory in an on inventory item move event.") -@Examples({ - "on inventory item move:", - "\tholder of event-initiator-inventory is a chest", - "\tbroadcast \"Item transport happening at %location at holder of event-initiator-inventory%!\"" -}) +@Example(""" + on inventory item move: + holder of event-initiator-inventory is a chest + broadcast "Item transport happening at %location at holder of event-initiator-inventory%!" + """) @Events("Inventory Item Move") @Since("2.8.0") public class ExprEvtInitiator extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExactItem.java b/src/main/java/ch/njol/skript/expressions/ExprExactItem.java index afd24f6e916..b8064833e33 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExactItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExactItem.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -17,7 +17,7 @@ + "For example, using this expression on a chest block with items stored inside will return a chest " + "item with the exact same items in its inventory as the chest block." ) -@Examples("set {_item} to exact item of block at location(0, 0, 0)") +@Example("set {_item} to exact item of block at location(0, 0, 0)") @Since("2.12") public class ExprExactItem extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExhaustion.java b/src/main/java/ch/njol/skript/expressions/ExprExhaustion.java index 1cab6371c1d..7fce33bf412 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExhaustion.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExhaustion.java @@ -6,7 +6,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -14,7 +14,7 @@ @Name("Exhaustion") @Description("The exhaustion of a player. This is mainly used to determine the rate of hunger depletion.") -@Examples("set exhaustion of all players to 1") +@Example("set exhaustion of all players to 1") @Since("2.2-dev35") public class ExprExhaustion extends SimplePropertyExpression{ diff --git a/src/main/java/ch/njol/skript/expressions/ExprExperience.java b/src/main/java/ch/njol/skript/expressions/ExprExperience.java index aba4975419e..c2baad35f2e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExperience.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExperience.java @@ -23,24 +23,28 @@ @Name("Experience") @Description("How much experience was spawned in an experience spawn or block break event. Can be changed.") -@Examples({ - "on experience spawn:", - "\tadd 5 to the spawned experience", - "", - "on break of coal ore:", - "\tclear dropped experience", - "", - "on break of diamond ore:", - "\tif tool of player = diamond pickaxe:", - "\t\tadd 100 to dropped experience", - "", - "on breed:", - "\tbreeding father is a cow", - "\tset dropped experience to 10", - "", - "on fish catch:", - "\tadd 70 to dropped experience", -}) +@Example(""" + on experience spawn: + add 5 to the spawned experience + """) +@Example(""" + on break of coal ore: + clear dropped experience + """) +@Example(""" + on break of diamond ore: + if tool of player = diamond pickaxe: + add 100 to dropped experience + """) +@Example(""" + on breed: + breeding father is a cow + set dropped experience to 10 + """) +@Example(""" + on fish catch: + add 70 to dropped experience + """) @Since("2.1, 2.5.3 (block break event), 2.7 (experience change event), 2.10 (breeding, fishing)") @Events({"experience spawn", "break / mine", "experience change", "entity breeding"}) public class ExprExperience extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldown.java b/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldown.java index f28d8f3b36b..c582b8fa8ff 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldown.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldown.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -19,12 +19,12 @@ "Experience cooldown is how long until a player can pick up another orb of experience.", "The cooldown of a player must be 0 to pick up another orb of experience." }) -@Examples({ - "send experience cooldown of player", - "set the xp pickup cooldown of player to 1 hour", - "if exp collection cooldown of player >= 10 minutes:", - "\tclear the experience pickup cooldown of player" -}) +@Example("send experience cooldown of player") +@Example("set the xp pickup cooldown of player to 1 hour") +@Example(""" + if exp collection cooldown of player >= 10 minutes: + clear the experience pickup cooldown of player + """) @Since("2.10") public class ExprExperienceCooldown extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldownChangeReason.java b/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldownChangeReason.java index 805ba5ac019..aacfc9f65ff 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldownChangeReason.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExperienceCooldownChangeReason.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -14,13 +14,13 @@ "The experience change reason within an " + "experience cooldown change event." }) -@Examples({ - "on player experience cooldown change:", - "\tif xp cooldown change reason is plugin:", - "\t\t#Changed by a plugin", - "\telse if xp cooldown change reason is orb pickup:", - "\t\t#Changed by picking up xp orb" -}) +@Example(""" + on player experience cooldown change: + if xp cooldown change reason is plugin: + #Changed by a plugin + else if xp cooldown change reason is orb pickup: + #Changed by picking up xp orb + """) @Since("2.10") public class ExprExperienceCooldownChangeReason extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExplodedBlocks.java b/src/main/java/ch/njol/skript/expressions/ExprExplodedBlocks.java index d67b502f56b..1a2bc61fc99 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExplodedBlocks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExplodedBlocks.java @@ -13,7 +13,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,24 +24,29 @@ @Name("Exploded Blocks") @Description("Get all the blocks that were destroyed in an explode event. Supports add/remove/set/clear/delete blocks.") -@Examples({ - "on explode:", - "\tloop exploded blocks:", - "\t\tadd loop-block to {exploded::blocks::*}", - "", - "on explode:", - "\tloop exploded blocks:", - "\t\tif loop-block is grass:", - "\t\t\tremove loop-block from exploded blocks", - "", - "on explode:", - "\tclear exploded blocks", - "", - "on explode:", - "\tset exploded blocks to blocks in radius 10 around event-entity", - "", - "on explode:", - "\tadd blocks above event-entity to exploded blocks"}) +@Example(""" + on explode: + loop exploded blocks: + add loop-block to {exploded::blocks::*} + """) +@Example(""" + on explode: + loop exploded blocks: + if loop-block is grass: + remove loop-block from exploded blocks + """) +@Example(""" + on explode: + clear exploded blocks + """) +@Example(""" + on explode: + set exploded blocks to blocks in radius 10 around event-entity + """) +@Example(""" + on explode: + add blocks above event-entity to exploded blocks + """) @Events("explode") @Since("2.5, 2.8.6 (modify blocks)") public class ExprExplodedBlocks extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExplosionBlockYield.java b/src/main/java/ch/njol/skript/expressions/ExprExplosionBlockYield.java index d38b373cfb3..a8c6d178585 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExplosionBlockYield.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExplosionBlockYield.java @@ -8,7 +8,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,8 +23,10 @@ @Description({"The percentage of exploded blocks dropped in an explosion event.", "When changing the yield, a value greater than 1 will function the same as using 1.", "Attempting to change the yield to a value less than 0 will have no effect."}) -@Examples({"on explode:", - "set the explosion's block yield to 10%"}) +@Example(""" + on explode: + set the explosion's block yield to 10% + """) @Events("explosion") @Since("2.5") public class ExprExplosionBlockYield extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExplosionYield.java b/src/main/java/ch/njol/skript/expressions/ExprExplosionYield.java index 78605dbef38..a1012d7f921 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExplosionYield.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExplosionYield.java @@ -8,7 +8,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,8 +23,10 @@ @Description({"The yield of the explosion in an explosion prime event. This is how big the explosion is.", " When changing the yield, values less than 0 will be ignored.", " Read this wiki page for more information"}) -@Examples({"on explosion prime:", - "\tset the yield of the explosion to 10"}) +@Example(""" + on explosion prime: + set the yield of the explosion to 10 + """) @Events("explosion prime") @Since("2.5") public class ExprExplosionYield extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprExplosiveYield.java b/src/main/java/ch/njol/skript/expressions/ExprExplosiveYield.java index 2c5dec98dc4..8c8aec56f99 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprExplosiveYield.java +++ b/src/main/java/ch/njol/skript/expressions/ExprExplosiveYield.java @@ -22,10 +22,10 @@ "Read this wiki page for more information.", "The yield of ghasts can only be set to between 0 and 127." }) -@Examples({ - "on spawn of a creeper:", - "\tset the explosive yield of the event-entity to 10" -}) +@Example(""" + on spawn of a creeper: + set the explosive yield of the event-entity to 10 + """) @Since("2.5, 2.11 (ghasts)") public class ExprExplosiveYield extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprEyeLocation.java b/src/main/java/ch/njol/skript/expressions/ExprEyeLocation.java index bd4249c3f9d..f802f919722 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprEyeLocation.java +++ b/src/main/java/ch/njol/skript/expressions/ExprEyeLocation.java @@ -5,7 +5,7 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,9 +16,9 @@ @Name("Head location") @Description({"The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight.", "Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows."}) -@Examples({"set the block at the player's head to air", - "set the block in front of the player's eyes to glass", - "loop blocks in front of the player's head:"}) +@Example("set the block at the player's head to air") +@Example("set the block in front of the player's eyes to glass") +@Example("loop blocks in front of the player's head:") @Since("2.0") public class ExprEyeLocation extends SimplePropertyExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFacing.java b/src/main/java/ch/njol/skript/expressions/ExprFacing.java index 6b21e748a7c..71ce2444345 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFacing.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFacing.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -24,9 +24,11 @@ */ @Name("Facing") @Description("The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')") -@Examples({"# makes a bridge", - "loop blocks from the block below the player in the horizontal facing of the player:", - "\tset loop-block to cobblestone"}) +@Example(""" + # makes a bridge + loop blocks from the block below the player in the horizontal facing of the player: + set loop-block to cobblestone + """) @Since("1.4") public class ExprFacing extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFallDistance.java b/src/main/java/ch/njol/skript/expressions/ExprFallDistance.java index 161fa4dfe1d..be05c3d1abb 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFallDistance.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFallDistance.java @@ -6,7 +6,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -14,9 +14,11 @@ @Name("Fall Distance") @Description({"The distance an entity has fallen for."}) -@Examples({"set all entities' fall distance to 10", - "on damage:", - "\tsend \"%victim's fall distance%\" to victim"}) +@Example(""" + set all entities' fall distance to 10 + on damage: + send "%victim's fall distance%" to victim + """) @Since("2.5") public class ExprFallDistance extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFertilizedBlocks.java b/src/main/java/ch/njol/skript/expressions/ExprFertilizedBlocks.java index 9c8cc950ab0..750967d0bc0 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFertilizedBlocks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFertilizedBlocks.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -25,7 +25,7 @@ @Description("The blocks fertilized in block fertilize events.") @RequiredPlugins("Minecraft 1.13 or newer") @Events("block fertilize") -@Examples("the fertilized blocks") +@Example("the fertilized blocks") @Since("2.5") public class ExprFertilizedBlocks extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFilter.java b/src/main/java/ch/njol/skript/expressions/ExprFilter.java index f9cc0b1786d..208ea4d2f78 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFilter.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFilter.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.ClassInfo; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.*; @@ -29,10 +29,8 @@ "For example, if you ran 'broadcast \"something\" and \"something else\" where [string input is \"something\"]', ", "only \"something\" would be broadcast as it is the only string that matched the condition." }) -@Examples({ - "send \"congrats on being staff!\" to all players where [player input has permission \"staff\"]", - "loop (all blocks in radius 5 of player) where [block input is not air]:" -}) +@Example("send \"congrats on being staff!\" to all players where [player input has permission \"staff\"]") +@Example("loop (all blocks in radius 5 of player) where [block input is not air]:") @Since("2.2-dev36, 2.10 (parenthesis pattern)") public class ExprFilter extends SimpleExpression implements InputSource, KeyProviderExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFinalDamage.java b/src/main/java/ch/njol/skript/expressions/ExprFinalDamage.java index 324ded1aef7..d9c80c51825 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFinalDamage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFinalDamage.java @@ -9,7 +9,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -21,7 +21,7 @@ @Name("Final Damage") @Description("How much damage is done in a damage event, considering all types of damage reduction. Can NOT be changed.") -@Examples({"send \"%final damage%\" to victim"}) +@Example("send \"%final damage%\" to victim") @Since("2.2-dev19") @Events("damage") public class ExprFinalDamage extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFireTicks.java b/src/main/java/ch/njol/skript/expressions/ExprFireTicks.java index a68e248487d..6dffb46f841 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFireTicks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFireTicks.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -18,10 +18,8 @@ @Name("Entity Fire Burn Duration") @Description("How much time an entity will be burning for.") -@Examples({ - "send \"You will stop burning in %fire time of player%\"", - "send the max burn time of target" -}) +@Example("send \"You will stop burning in %fire time of player%\"") +@Example("send the max burn time of target") @Since("2.7, 2.10 (maximum)") public class ExprFireTicks extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFireworkEffect.java b/src/main/java/ch/njol/skript/expressions/ExprFireworkEffect.java index af29cad8785..02eb27612e0 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFireworkEffect.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFireworkEffect.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -20,9 +20,9 @@ @Name("Firework Effect") @Description("Represents a 'firework effect' which can be used in the launch firework effect.") -@Examples({"launch flickering trailing burst firework colored blue and green at player", - "launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity", - "launch ball large colored red, purple and white fading to light green and black at player's location with duration 1"}) +@Example("launch flickering trailing burst firework colored blue and green at player") +@Example("launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity") +@Example("launch ball large colored red, purple and white fading to light green and black at player's location with duration 1") @Since("2.4") public class ExprFireworkEffect extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFlightMode.java b/src/main/java/ch/njol/skript/expressions/ExprFlightMode.java index 681200a8189..47032801823 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFlightMode.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFlightMode.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -13,7 +13,8 @@ @Name("Flight Mode") @Description("Whether the player(s) are allowed to fly. Use Make Fly effect to force player(s) to fly.") -@Examples({"set flight mode of player to true", "send \"%flying state of all players%\""}) +@Example("set flight mode of player to true") +@Example("send \"%flying state of all players%\"") @Since("2.2-dev34") public class ExprFlightMode extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFoodLevel.java b/src/main/java/ch/njol/skript/expressions/ExprFoodLevel.java index 2ac18e7acba..c7130b6ebdf 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFoodLevel.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFoodLevel.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.effects.Delay; @@ -24,7 +24,7 @@ */ @Name("Food Level") @Description("The food level of a player from 0 to 10. Has several aliases: food/hunger level/meter/bar. ") -@Examples({"set the player's food level to 10"}) +@Example("set the player's food level to 10") @Since("1.0") public class ExprFoodLevel extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFormatDate.java b/src/main/java/ch/njol/skript/expressions/ExprFormatDate.java index 0f731fa09ea..7270da8cbfe 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFormatDate.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFormatDate.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -24,12 +24,12 @@ "Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this " + "Wikipedia article." }) -@Examples({ - "command /date:", - "\ttrigger:", - "\t\tsend \"Full date: %now formatted human-readable%\" to sender", - "\t\tsend \"Short date: %now formatted as \"yyyy-MM-dd\"%\" to sender" -}) +@Example(""" + command /date: + trigger: + send "Full date: %now formatted human-readable%" to sender + send "Short date: %now formatted as "yyyy-MM-dd"%" to sender + """) @Since("2.2-dev31, 2.7 (support variables in format)") public class ExprFormatDate extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFreezeTicks.java b/src/main/java/ch/njol/skript/expressions/ExprFreezeTicks.java index c75766f09ea..fba909b1754 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFreezeTicks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFreezeTicks.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,10 +15,10 @@ @Name("Freeze Time") @Description("How much time an entity has been in powdered snow for.") -@Examples({ - "player's freeze time is less than 3 seconds:", - "\tsend \"you're about to freeze!\" to the player" -}) +@Example(""" + player's freeze time is less than 3 seconds: + send "you're about to freeze!" to the player + """) @Since("2.7") public class ExprFreezeTicks extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFromUUID.java b/src/main/java/ch/njol/skript/expressions/ExprFromUUID.java index 32faafda9e3..2eb447c79c1 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFromUUID.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFromUUID.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -28,12 +28,10 @@ "Get an entity, player, offline player or world from a UUID.", "Unloaded entities or players that are offline (when using 'player from %uuid%') will return nothing." }) -@Examples({ - "set {_player} to player from \"a0789aeb-7b46-43f6-86fb-cb671fed5775\" parsed as uuid", - "set {_offline player} to offline player from {_some uuid}", - "set {_entity} to entity from {_some uuid}", - "set {_world} to world from {_some uuid}" -}) +@Example("set {_player} to player from \"a0789aeb-7b46-43f6-86fb-cb671fed5775\" parsed as uuid") +@Example("set {_offline player} to offline player from {_some uuid}") +@Example("set {_entity} to entity from {_some uuid}") +@Example("set {_world} to world from {_some uuid}") @Since("2.11") public class ExprFromUUID extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprFunction.java b/src/main/java/ch/njol/skript/expressions/ExprFunction.java index c5c4b97b40b..b3481c758d1 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprFunction.java +++ b/src/main/java/ch/njol/skript/expressions/ExprFunction.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,10 +23,8 @@ @Name("Function (Experimental)") @Description("Obtain a function by name, which can be executed.") -@Examples({ - "set {_function} to the function named \"myFunction\"", - "run {_function} with arguments 13 and true" -}) +@Example("set {_function} to the function named \"myFunction\"") +@Example("run {_function} with arguments 13 and true") @Since("2.10") @SuppressWarnings("rawtypes") public class ExprFunction extends SimpleExpression implements ReflectionExperimentSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprGameMode.java b/src/main/java/ch/njol/skript/expressions/ExprGameMode.java index a005c701e7e..3de7356dae7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprGameMode.java +++ b/src/main/java/ch/njol/skript/expressions/ExprGameMode.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.effects.Delay; @@ -25,8 +25,8 @@ */ @Name("Game Mode") @Description("The gamemode of a player. (Gamemodes)") -@Examples({"player's gamemode is survival", - "set the player's gamemode to creative"}) +@Example("player's gamemode is survival") +@Example("set the player's gamemode to creative") @Since("1.0") public class ExprGameMode extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprGameRule.java b/src/main/java/ch/njol/skript/expressions/ExprGameRule.java index 72c8236a3af..f32b00b5552 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprGameRule.java +++ b/src/main/java/ch/njol/skript/expressions/ExprGameRule.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,7 +22,7 @@ @Name("Gamerule Value") @Description("The gamerule value of a world.") -@Examples({"set the gamerule commandBlockOutput of world \"world\" to false"}) +@Example("set the gamerule commandBlockOutput of world \"world\" to false") @Since("2.5") public class ExprGameRule extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprGlidingState.java b/src/main/java/ch/njol/skript/expressions/ExprGlidingState.java index b616707c6e4..fc3dfee01ae 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprGlidingState.java +++ b/src/main/java/ch/njol/skript/expressions/ExprGlidingState.java @@ -7,14 +7,14 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @Name("Gliding State") @Description("Sets of gets gliding state of player. It allows you to set gliding state of entity even if they do not have an Elytra equipped.") -@Examples({"set gliding of player to off"}) +@Example("set gliding of player to off") @Since("2.2-dev21") public class ExprGlidingState extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprGlowing.java b/src/main/java/ch/njol/skript/expressions/ExprGlowing.java index d6cbb3e1d82..31770fcc7e7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprGlowing.java +++ b/src/main/java/ch/njol/skript/expressions/ExprGlowing.java @@ -6,14 +6,14 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @Name("Glowing") @Description("Indicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls.") -@Examples({"set glowing of player to true"}) +@Example("set glowing of player to true") @Since("2.2-dev18") public class ExprGlowing extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprGravity.java b/src/main/java/ch/njol/skript/expressions/ExprGravity.java index fdc07803b15..e71c4cbb408 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprGravity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprGravity.java @@ -7,14 +7,14 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @Name("Gravity") @Description("If entity is affected by gravity or not, i.e. if it has Minecraft 1.10+ NoGravity flag.") -@Examples({"set gravity of player off"}) +@Example("set gravity of player off") @Since("2.2-dev21") public class ExprGravity extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHanging.java b/src/main/java/ch/njol/skript/expressions/ExprHanging.java index 960980b7c65..01395ec06c3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHanging.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHanging.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -20,11 +20,13 @@ @Name("Hanging Entity/Remover") @Description("Returns the hanging entity or remover in hanging break and place events.") -@Examples({"on break of item frame:", - "\tif item of hanging entity is diamond pickaxe:", - "\t\tcancel event", - "\t\tif hanging remover is a player:", - "\t\t\tsend \"You can't break that item frame!\" to hanging remover"}) +@Example(""" + on break of item frame: + if item of hanging entity is diamond pickaxe: + cancel event + if hanging remover is a player: + send "You can't break that item frame!" to hanging remover + """) @Since("2.6.2") public class ExprHanging extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHatchingNumber.java b/src/main/java/ch/njol/skript/expressions/ExprHatchingNumber.java index 49228742570..6004abae9e1 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHatchingNumber.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHatchingNumber.java @@ -4,7 +4,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,10 +22,10 @@ "The number of entities that will be hatched in a Player Egg Throw event.", "Please note that no more than 127 entities can be hatched at once." }) -@Examples({ - "on player egg throw:", - "\tset the hatching number to 10" -}) +@Example(""" + on player egg throw: + set the hatching number to 10 + """) @Events("Egg Throw") @Since("2.7") public class ExprHatchingNumber extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHatchingType.java b/src/main/java/ch/njol/skript/expressions/ExprHatchingType.java index c5b8639657c..46dcec5479d 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHatchingType.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHatchingType.java @@ -5,7 +5,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -22,10 +22,10 @@ @Name("Hatching Entity Type") @Description("The type of the entity that will be hatched in a Player Egg Throw event.") -@Examples({ - "on player egg throw:", - "\tset the hatching entity type to a primed tnt" -}) +@Example(""" + on player egg throw: + set the hatching entity type to a primed tnt + """) @Events("Egg Throw") @Since("2.7") public class ExprHatchingType extends SimpleExpression> { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHealAmount.java b/src/main/java/ch/njol/skript/expressions/ExprHealAmount.java index 1c39d80668d..433c514e326 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHealAmount.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHealAmount.java @@ -10,7 +10,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,11 +22,11 @@ @Name("Heal Amount") @Description("The amount of health healed in a heal event.") -@Examples({ - "on player healing:", - "\tincrease the heal amount by 2", - "\tremove 0.5 from the healing amount" -}) +@Example(""" + on player healing: + increase the heal amount by 2 + remove 0.5 from the healing amount + """) @Events("heal") @Since("2.5.1") public class ExprHealAmount extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHealReason.java b/src/main/java/ch/njol/skript/expressions/ExprHealReason.java index bf1f3695522..33c80f4fb75 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHealReason.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHealReason.java @@ -2,7 +2,7 @@ import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -12,11 +12,11 @@ @Name("Heal Reason") @Description("The heal reason of a heal event.") -@Examples({ - "on heal:", - "\theal reason is satiated", - "\tsend \"You ate enough food and gained full health back!\"" -}) +@Example(""" + on heal: + heal reason is satiated + send "You ate enough food and gained full health back!" + """) @Events("heal") @Since("2.5") public class ExprHealReason extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHealth.java b/src/main/java/ch/njol/skript/expressions/ExprHealth.java index 9459a1b20d4..e973bca2561 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHealth.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHealth.java @@ -17,7 +17,7 @@ */ @Name("Health") @Description("The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).") -@Examples({"message \"You have %health% HP left.\""}) +@Example("message \"You have %health% HP left.\"") @Since("1.0") @Events("damage") public class ExprHealth extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java b/src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java index fea5f72429f..3bcb80739a7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,7 +19,7 @@ @Name("Hidden Players") @Description({"The players hidden from a player that were hidden using the entity visibility effect."}) -@Examples({"message \"<light red>You are currently hiding: <light gray>%hidden players of the player%\""}) +@Example("message \"<light red>You are currently hiding: <light gray>%hidden players of the player%\"") @Since("2.3") public class ExprHiddenPlayers extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHostname.java b/src/main/java/ch/njol/skript/expressions/ExprHostname.java index 98dcc58e7cf..2ce724c0c6e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHostname.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHostname.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,10 +17,11 @@ @Name("Hostname") @Description("The hostname used by the connecting player to connect to the server in a connect event.") -@Examples({ - "on connect:", - "\thostname is \"testers.example.com\"", - "\tsend \"Welcome back tester!\""}) +@Example(""" + on connect: + hostname is "testers.example.com" + send "Welcome back tester!" + """) @Since("2.6.1") public class ExprHostname extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHotbarButton.java b/src/main/java/ch/njol/skript/expressions/ExprHotbarButton.java index c3ff30360de..cdad734b128 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHotbarButton.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHotbarButton.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,8 +17,10 @@ @Name("Hotbar Button") @Description("The hotbar button clicked in an inventory click event.") -@Examples({"on inventory click:", - " send \"You clicked the hotbar button %hotbar button%!\""}) +@Example(""" + on inventory click: + send "You clicked the hotbar button %hotbar button%!" + """) @Since("2.5") public class ExprHotbarButton extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHotbarSlot.java b/src/main/java/ch/njol/skript/expressions/ExprHotbarSlot.java index 4c14daefd9d..319d60f3ade 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHotbarSlot.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHotbarSlot.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -24,16 +24,14 @@ "To retrieve its number use Slot Index expression.", "Use future and past tense to grab the previous slot in an item change event, see example." }) -@Examples({ - "message \"%player's current hotbar slot%\"", - "set player's selected hotbar slot to slot 4 of player", - "", - "send \"index of player's current hotbar slot = 1\" # second slot from the left", - "", - "on item held change:", - "\tif the selected hotbar slot was a diamond:", - "\t\tset the currently selected hotbar slot to slot 5 of player" -}) +@Example("message \"%player's current hotbar slot%\"") +@Example("set player's selected hotbar slot to slot 4 of player") +@Example("send \"index of player's current hotbar slot = 1\" # second slot from the left") +@Example(""" + on item held change: + if the selected hotbar slot was a diamond: + set the currently selected hotbar slot to slot 5 of player + """) @Since("2.2-dev36") public class ExprHotbarSlot extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHoverList.java b/src/main/java/ch/njol/skript/expressions/ExprHoverList.java index 7a4cff0c145..f1d3689af90 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHoverList.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHoverList.java @@ -28,13 +28,13 @@ "And note that, for example if there are 5 online players (includes fake online count) " + "in the server and the hover list is set to 3 values, Minecraft will show \"... and 2 more ...\" at end of the list." }) -@Examples({ - "on server list ping:", - "\tclear the hover list", - "\tadd \"&aWelcome to the &6Minecraft &aserver!\" to the hover list", - "\tadd \"\" to the hover list # A blank line", - "\tadd \"&cThere are &6%online players count% &conline players!\" to the hover list" -}) +@Example(""" + on server list ping: + clear the hover list + add "&aWelcome to the &6Minecraft &aserver!" to the hover list + add "" to the hover list # A blank line + add "&cThere are &6%online players count% &conline players!" to the hover list + """) @Since("2.3") @Events("server list ping") public class ExprHoverList extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprHumidity.java b/src/main/java/ch/njol/skript/expressions/ExprHumidity.java index 6dd9f54c256..449bae7d6f2 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprHumidity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprHumidity.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -9,7 +9,7 @@ @Name("Humidity") @Description("Humidity of given blocks.") -@Examples("set {_humidity} to event-block's humidity") +@Example("set {_humidity} to event-block's humidity") @Since("2.2-dev35") public class ExprHumidity extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprIP.java b/src/main/java/ch/njol/skript/expressions/ExprIP.java index 59c7202428a..c6da46554ea 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprIP.java +++ b/src/main/java/ch/njol/skript/expressions/ExprIP.java @@ -13,7 +13,7 @@ import com.destroystokyo.paper.event.server.PaperServerListPingEvent; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -26,14 +26,18 @@ @Name("IP") @Description("The IP address of a player, or the connected player in a connect event, " + "or the pinger in a server list ping event.") -@Examples({"ban the IP address of the player", - "broadcast \"Banned the IP %IP of player%\"", - "", - "on connect:", - "\tlog \"[%now%] %player% (%ip%) is connected to the server.\"", - "", - "on server list ping:", - "\tsend \"%IP-address%\" to the console"}) +@Example(""" + ban the IP address of the player") + broadcast "Banned the IP %IP of player%" + """) +@Example(""" + on connect: + log "[%now%] %player% (%ip%) is connected to the server." + """) +@Example(""" + on server list ping: + send "%IP-address%" to the console + """) @Since("1.4, 2.2-dev26 (when used in connect event), 2.3 (when used in server list ping event)") public class ExprIP extends SimpleExpression { @@ -125,4 +129,4 @@ public String toString(@Nullable Event e, boolean debug) { return "the IP address of " + players.toString(e, debug); } -} \ No newline at end of file +} diff --git a/src/main/java/ch/njol/skript/expressions/ExprInput.java b/src/main/java/ch/njol/skript/expressions/ExprInput.java index 0f089228c51..abba709aa69 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInput.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInput.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.ClassInfo; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -32,10 +32,8 @@ "the condition would be checked twice, using \"something\" and \"something else\" as the inputs.", "The 'input index' pattern can be used when acting on a variable to access the index of the input." }) -@Examples({ - "send \"congrats on being staff!\" to all players where [input has permission \"staff\"]", - "sort {_list::*} based on length of input index" -}) +@Example("send \"congrats on being staff!\" to all players where [input has permission \"staff\"]") +@Example("sort {_list::*} based on length of input index") @Since("2.2-dev36, 2.9.0 (input index)") public class ExprInput extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprInventory.java b/src/main/java/ch/njol/skript/expressions/ExprInventory.java index 702f2411332..7d5d7de67c6 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInventory.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInventory.java @@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; @@ -34,9 +34,9 @@ */ @Name("Inventory") @Description("The inventory of a block or player. You can usually omit this expression and can directly add or remove items to/from blocks or players.") -@Examples({"add a plank to the player's inventory", - "clear the player's inventory", - "remove 5 wool from the inventory of the clicked block"}) +@Example("add a plank to the player's inventory") +@Example("clear the player's inventory") +@Example("remove 5 wool from the inventory of the clicked block") @Since("1.0") public class ExprInventory extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprInventoryAction.java b/src/main/java/ch/njol/skript/expressions/ExprInventoryAction.java index 87b74542809..b8077c27510 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInventoryAction.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInventoryAction.java @@ -3,14 +3,14 @@ import org.bukkit.event.inventory.InventoryAction; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @Name("Inventory Action") @Description("The inventory action of an inventory event. Please click on the link for more information.") -@Examples("inventory action is pickup all") +@Example("inventory action is pickup all") @Since("2.2-dev16") public class ExprInventoryAction extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprInventoryCloseReason.java b/src/main/java/ch/njol/skript/expressions/ExprInventoryCloseReason.java index d1490f03f16..0131239bb87 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInventoryCloseReason.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInventoryCloseReason.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -18,11 +18,11 @@ @Name("Inventory Close Reason") @Description("The inventory close reason of an inventory close event.") -@Examples({ - "on inventory close:", - "\tinventory close reason is teleport", - "\tsend \"Your inventory closed due to teleporting!\" to player" -}) +@Example(""" + on inventory close: + inventory close reason is teleport + send "Your inventory closed due to teleporting!" to player + """) @Events("Inventory Close") @Since("2.8.0") public class ExprInventoryCloseReason extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprInventoryInfo.java b/src/main/java/ch/njol/skript/expressions/ExprInventoryInfo.java index eef9f939ad5..651fa6e4f03 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInventoryInfo.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInventoryInfo.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,9 +25,9 @@ @Description({"Gets the amount of rows/slots, viewers and holder of an inventory.", "", "NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open."}) -@Examples({"event-inventory's amount of rows", - "holder of player's top inventory", - "{_inventory}'s viewers"}) +@Example("event-inventory's amount of rows") +@Example("holder of player's top inventory") +@Example("{_inventory}'s viewers") @Since("2.2-dev34, 2.5 (slots)") public class ExprInventoryInfo extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprInventorySlot.java b/src/main/java/ch/njol/skript/expressions/ExprInventorySlot.java index 4a3fc3618e7..d335f8ea7b4 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInventorySlot.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInventorySlot.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,11 +25,13 @@ @Name("Inventory Slot") @Description({"Represents a slot in an inventory. It can be used to change the item in an inventory too."}) -@Examples({"if slot 0 of player is air:", - "\tset slot 0 of player to 2 stones", - "\tremove 1 stone from slot 0 of player", - "\tadd 2 stones to slot 0 of player", - "\tclear slot 1 of player"}) +@Example(""" + if slot 0 of player is air: + set slot 0 of player to 2 stones + remove 1 stone from slot 0 of player + add 2 stones to slot 0 of player + clear slot 1 of player + """) @Since("2.2-dev24") public class ExprInventorySlot extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprInverse.java b/src/main/java/ch/njol/skript/expressions/ExprInverse.java index b52e12dfd7a..e49744b8ad8 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprInverse.java +++ b/src/main/java/ch/njol/skript/expressions/ExprInverse.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -16,7 +16,7 @@ @Name("Inverse Boolean") @Description("An expression to obtain the inverse value of a boolean") -@Examples("set {_gravity} to inverse of player's flight mode") +@Example("set {_gravity} to inverse of player's flight mode") @Since("2.12") public class ExprInverse extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItem.java b/src/main/java/ch/njol/skript/expressions/ExprItem.java index 814a477a06f..fa23db38392 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItem.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItem.java @@ -8,7 +8,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -16,11 +16,11 @@ @Name("Item") @Description("The item involved in an event, e.g. in a drop, dispense, pickup or craft event.") -@Examples({ - "on dispense:", - "\titem is a clock", - "\tset the time to 6:00" -}) +@Example(""" + on dispense: + item is a clock + set the time to 6:00 + """) @Since("unknown (before 2.1)") public class ExprItem extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemAmount.java b/src/main/java/ch/njol/skript/expressions/ExprItemAmount.java index 2b96ec4b86b..e74df08e32d 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItemAmount.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemAmount.java @@ -3,7 +3,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,7 +15,7 @@ @Name("Item Amount") @Description("The amount of an item stack.") -@Examples("send \"You have got %item amount of player's tool% %player's tool% in your hand!\" to player") +@Example("send \"You have got %item amount of player's tool% %player's tool% in your hand!\" to player") @Since("2.2-dev24") public class ExprItemAmount extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemCooldown.java b/src/main/java/ch/njol/skript/expressions/ExprItemCooldown.java index 33ddadbc8ad..c45856a6d23 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItemCooldown.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemCooldown.java @@ -30,12 +30,12 @@ If the provided item has a cooldown group component specified the cooldown of the group will be prioritized. Otherwise the cooldown of the item material will be used. """) -@Examples({ - "on right click using stick:", - "\tset item cooldown of player's tool for player to 1 minute", - "\tset item cooldown of stone and grass for all players to 20 seconds", - "\treset item cooldown of cobblestone and dirt for all players" -}) +@Example(""" + on right click using stick: + set item cooldown of player's tool for player to 1 minute + set item cooldown of stone and grass for all players to 20 seconds + reset item cooldown of cobblestone and dirt for all players + """) @RequiredPlugins("MC 1.21.2 (cooldown group)") @Since({"2.8.0", "2.12 (cooldown group)"}) public class ExprItemCooldown extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemFlags.java b/src/main/java/ch/njol/skript/expressions/ExprItemFlags.java index 3b04e6e0a21..616052fee33 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItemFlags.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemFlags.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -21,11 +21,9 @@ @Name("Item Flags") @Description("The item flags of an item. Can be modified.") -@Examples({ - "set item flags of player's tool to hide enchants and hide attributes", - "add hide potion effects to item flags of player's held item", - "remove hide enchants from item flags of {legendary sword}" -}) +@Example("set item flags of player's tool to hide enchants and hide attributes") +@Example("add hide potion effects to item flags of player's held item") +@Example("remove hide enchants from item flags of {legendary sword}") @Since("2.10") public class ExprItemFlags extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java b/src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java index 9e245471f31..e763798f487 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java @@ -15,10 +15,8 @@ @Name("Item with Enchantment Glint") @Description("Get an item with or without enchantment glint.") -@Examples({ - "set {_item with glint} to diamond with enchantment glint", - "set {_item without glint} to diamond without enchantment glint" -}) +@Example("set {_item with glint} to diamond with enchantment glint") +@Example("set {_item without glint} to diamond without enchantment glint") @RequiredPlugins("Spigot 1.20.5+") @Since("2.10") public class ExprItemWithEnchantmentGlint extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemWithLore.java b/src/main/java/ch/njol/skript/expressions/ExprItemWithLore.java index 636e5ab8134..fbe971fa694 100755 --- a/src/main/java/ch/njol/skript/expressions/ExprItemWithLore.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemWithLore.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -23,8 +23,10 @@ @Name("Item with Lore") @Description({"Returns the given item type with the specified lore added to it.", "If multiple strings are passed, each of them will be a separate line in the lore."}) -@Examples({"set {_test} to stone with lore \"line 1\" and \"line 2\"", - "give {_test} to player"}) +@Example(""" + set {_test} to stone with lore "line 1" and "line 2" + give {_test} to player + """) @Since("2.3") public class ExprItemWithLore extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemWithTooltip.java b/src/main/java/ch/njol/skript/expressions/ExprItemWithTooltip.java index 470fbc12369..6e88f15bc71 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItemWithTooltip.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemWithTooltip.java @@ -19,10 +19,8 @@ "If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it.", "If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden." }) -@Examples({ - "set {_item with additional tooltip} to diamond with additional tooltip", - "set {_item without entire tooltip} to diamond without entire tooltip" -}) +@Example("set {_item with additional tooltip} to diamond with additional tooltip") +@Example("set {_item without entire tooltip} to diamond without entire tooltip") @RequiredPlugins("Minecraft 1.20.5+") @Since("2.11") public class ExprItemWithTooltip extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItems.java b/src/main/java/ch/njol/skript/expressions/ExprItems.java index 7f124d71691..d38dc2c52b8 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItems.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItems.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -26,12 +26,12 @@ @Name("Items") @Description("Items or blocks of a specific type, useful for looping.") -@Examples({ - "loop tag values of tag \"diamond_ores\" and tag values of tag \"oak_logs\":", - "\tblock contains loop-item", - "\tmessage \"Theres at least one %loop-item% in this block\"", - "drop all blocks at the player # drops one of every block at the player" -}) +@Example(""" + loop tag values of tag "diamond_ores" and tag values of tag "oak_logs": + block contains loop-item + message "Theres at least one %loop-item% in this block" + """) +@Example("drop all blocks at the player # drops one of every block at the player") @Since("1.0 pre-5") public class ExprItems extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprItemsIn.java b/src/main/java/ch/njol/skript/expressions/ExprItemsIn.java index 4f24751430e..97568e29ee5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprItemsIn.java +++ b/src/main/java/ch/njol/skript/expressions/ExprItemsIn.java @@ -13,7 +13,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -30,12 +30,12 @@ "All items or specific type(s) of items in an inventory. Useful for looping or storing in a list variable.", "Please note that the positions of the items in the inventory are not saved, only their order is preserved." }) -@Examples({ - "loop all items in the player's inventory:", - "\tloop-item is enchanted", - "\tremove loop-item from the player", - "set {inventory::%uuid of player%::*} to items in the player's inventory" -}) +@Example(""" + loop all items in the player's inventory: + loop-item is enchanted + remove loop-item from the player + """) +@Example("set {inventory::%uuid of player%::*} to items in the player's inventory") @Since("2.0, 2.8.0 (specific types of items)") public class ExprItemsIn extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprJoinSplit.java b/src/main/java/ch/njol/skript/expressions/ExprJoinSplit.java index 1d52644d5c3..fe1ec50628c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprJoinSplit.java +++ b/src/main/java/ch/njol/skript/expressions/ExprJoinSplit.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.SkriptConfig; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,10 +23,8 @@ @Name("Join & Split") @Description("Joins several texts with a common delimiter (e.g. \", \"), or splits a text into multiple texts at a given delimiter.") -@Examples({ - "message \"Online players: %join all players' names with \"\" | \"\"%\" # %all players% would use the default \"x, y, and z\"", - "set {_s::*} to the string argument split at \",\"" -}) +@Example("message \"Online players: %join all players' names with \"\" | \"\"%\" # %all players% would use the default \"x, y, and z\"") +@Example("set {_s::*} to the string argument split at \",\"") @Since("2.1, 2.5.2 (regex support), 2.7 (case sensitivity), 2.10 (without trailing string)") public class ExprJoinSplit extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLanguage.java b/src/main/java/ch/njol/skript/expressions/ExprLanguage.java index 401f0757936..3ad9088424a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLanguage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLanguage.java @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -17,7 +17,7 @@ @Name("Language") @Description({"Currently selected game language of a player. The value of the language is not defined properly.", "The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish."}) -@Examples({"message player's current language"}) +@Example("message player's current language") @Since("2.3") public class ExprLanguage extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastAttacker.java b/src/main/java/ch/njol/skript/expressions/ExprLastAttacker.java index 93dad0c3f27..d545ea2aa63 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastAttacker.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastAttacker.java @@ -4,14 +4,14 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @Name("Last Attacker") @Description("The last block or entity that attacked an entity.") -@Examples({"send \"%last attacker of event-entity%\""}) +@Example("send \"%last attacker of event-entity%\"") @Since("2.5.1") public class ExprLastAttacker extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastDamage.java b/src/main/java/ch/njol/skript/expressions/ExprLastDamage.java index 29fa9e87a4f..2450442f6d3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastDamage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastDamage.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -13,7 +13,7 @@ @Name("Last Damage") @Description("The last damage that was done to an entity. Note that changing it doesn't deal more/less damage.") -@Examples({"set last damage of event-entity to 2"}) +@Example("set last damage of event-entity to 2") @Since("2.5.1") public class ExprLastDamage extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastDamageCause.java b/src/main/java/ch/njol/skript/expressions/ExprLastDamageCause.java index 0ec087b10f0..48eb47589df 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastDamageCause.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastDamageCause.java @@ -3,7 +3,7 @@ import ch.njol.skript.bukkitutil.HealthUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -23,7 +23,7 @@ */ @Name("Last Damage Cause") @Description("Cause of last damage done to an entity") -@Examples({"set last damage cause of event-entity to fire tick"}) +@Example("set last damage cause of event-entity to fire tick") @Since("2.2-Fixes-V10") public class ExprLastDamageCause extends PropertyExpression{ diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastDeathLocation.java b/src/main/java/ch/njol/skript/expressions/ExprLastDeathLocation.java index 937d5ce1e9f..fa33326da8e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastDeathLocation.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastDeathLocation.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -18,10 +18,8 @@ "Gets the last death location of a player, or offline player, if available.", "Can also be set, reset, and deleted if the player is online." }) -@Examples({ - "set {_loc} to the last death location of player", - "teleport player to last death location of (random element out of all players)" -}) +@Example("set {_loc} to the last death location of player") +@Example("teleport player to last death location of (random element out of all players)") @Since("2.10") public class ExprLastDeathLocation extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastLoadedServerIcon.java b/src/main/java/ch/njol/skript/expressions/ExprLastLoadedServerIcon.java index cb3e84c73b3..c91ecb47ee3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastLoadedServerIcon.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastLoadedServerIcon.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.effects.EffLoadServerIcon; @@ -18,7 +18,7 @@ @Name("Last Loaded Server Icon") @Description({"Returns the last loaded server icon with the load server icon effect."}) -@Examples("set {server-icon} to the last loaded server icon") +@Example("set {server-icon} to the last loaded server icon") @Since("2.3") public class ExprLastLoadedServerIcon extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastLoginTime.java b/src/main/java/ch/njol/skript/expressions/ExprLastLoginTime.java index 25ab2ba82fc..ea64747f647 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastLoginTime.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastLoginTime.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,10 +16,12 @@ @Name("Last/First Login Time") @Description("When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.") -@Examples({"command /onlinefor:", - "\ttrigger:", - "\t\tsend \"You have been online for %difference between player's last login and now%.\"", - "\t\tsend \"You first joined the server %difference between player's first login and now% ago.\""}) +@Example(""" + command /onlinefor: + trigger: + send "You have been online for %difference between player's last login and now%." + send "You first joined the server %difference between player's first login and now% ago." + """) @Since("2.5") public class ExprLastLoginTime extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastResourcePackResponse.java b/src/main/java/ch/njol/skript/expressions/ExprLastResourcePackResponse.java index be39e76755b..8ea93417d2f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastResourcePackResponse.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastResourcePackResponse.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -12,7 +12,7 @@ @Name("Last Resource Pack Response") @Description("Returns the last resource pack response received from a player.") -@Examples("if player's last resource pack response is deny or download fail:") +@Example("if player's last resource pack response is deny or download fail:") @Since("2.4") public class ExprLastResourcePackResponse extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLastSpawnedEntity.java b/src/main/java/ch/njol/skript/expressions/ExprLastSpawnedEntity.java index 3135c3d22fe..414ddb4b853 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLastSpawnedEntity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLastSpawnedEntity.java @@ -14,7 +14,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.effects.EffDrop; @@ -31,16 +31,20 @@ @Description("Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. " + "Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. " + "If you spawn an entity, shoot a projectile and drop an item you can however access all them together.") -@Examples({ - "spawn a priest", - "set {healer::%spawned priest%} to true", - "shoot an arrow from the last spawned entity", - "ignite the shot projectile", - "drop a diamond sword", - "push last dropped item upwards", - "teleport player to last struck lightning", - "delete last launched firework" -}) +@Example(""" + spawn a priest + set {healer::%spawned priest%} to true + """) +@Example(""" + shoot an arrow from the last spawned entity + ignite the shot projectile + """) +@Example(""" + drop a diamond sword + push last dropped item upwards + """) +@Example("teleport player to last struck lightning") +@Example("delete last launched firework") @Since("1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), 2.7 (struck lightning, firework)") public class ExprLastSpawnedEntity extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLeashHolder.java b/src/main/java/ch/njol/skript/expressions/ExprLeashHolder.java index 7e223c2e3f7..c962c6b146a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLeashHolder.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLeashHolder.java @@ -5,14 +5,14 @@ import org.jetbrains.annotations.Nullable; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @Name("Leash Holder") @Description("The leash holder of a living entity.") -@Examples("set {_example} to the leash holder of the target mob") +@Example("set {_example} to the leash holder of the target mob") @Since("2.3") public class ExprLeashHolder extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLength.java b/src/main/java/ch/njol/skript/expressions/ExprLength.java index 4e0374515a5..dfe4ab81a22 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLength.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLength.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -14,7 +14,7 @@ */ @Name("Length") @Description("The length of a text, in number of characters.") -@Examples("set {_l} to length of the string argument") +@Example("set {_l} to length of the string argument") @Since("2.1") public class ExprLength extends SimplePropertyExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLevel.java b/src/main/java/ch/njol/skript/expressions/ExprLevel.java index 073b4a1d154..ab2fa4e0a75 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLevel.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLevel.java @@ -12,7 +12,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.effects.Delay; @@ -23,8 +23,8 @@ */ @Name("Level") @Description("The level of a player.") -@Examples({"reduce the victim's level by 1", - "set the player's level to 0"}) +@Example("reduce the victim's level by 1") +@Example("set the player's level to 0") @Since("unknown (before 2.1)") @Events("level change") public class ExprLevel extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLevelProgress.java b/src/main/java/ch/njol/skript/expressions/ExprLevelProgress.java index 7c682609082..0094dc95db8 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLevelProgress.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLevelProgress.java @@ -7,7 +7,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -21,19 +21,21 @@ "Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar).", "Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. " + "increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%."}) -@Examples({"# use the exp bar as mana", - "on rightclick with a blaze rod:", - "\tplayer's level progress is larger than 0.2", - "\tshoot a fireball from the player", - "\treduce the player's level progress by 0.2", - "every 2 seconds:", - "\tloop all players:", - "\t\tlevel progress of loop-player is smaller than 0.9:", - "\t\t\tincrease level progress of the loop-player by 0.1", - "\t\telse:", - "\t\t\tset level progress of the loop-player to 0.99", - "on xp spawn:", - "\tcancel event"}) +@Example(""" + # use the exp bar as mana + on rightclick with a blaze rod: + player's level progress is larger than 0.2 + shoot a fireball from the player + reduce the player's level progress by 0.2 + every 2 seconds: + loop all players: + level progress of loop-player is smaller than 0.9: + increase level progress of the loop-player by 0.1 + else: + set level progress of the loop-player to 0.99 + on xp spawn: + cancel event + """) @Since("2.0") @Events("level change") public class ExprLevelProgress extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLightLevel.java b/src/main/java/ch/njol/skript/expressions/ExprLightLevel.java index 4cd45e781fa..cad8dca3944 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLightLevel.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLightLevel.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -22,12 +22,14 @@ @Name("Light Level") @Description({"Gets the light level at a certain location which ranges from 0 to 15.", "It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types."}) -@Examples({"# set vampire players standing in bright sunlight on fire", - "every 5 seconds:", - " loop all players:", - " {vampire::%uuid of loop-player%} is true", - " sunlight level at the loop-player is greater than 10", - " ignite the loop-player for 5 seconds"}) +@Example(""" + # set vampire players standing in bright sunlight on fire + every 5 seconds: + loop all players: + {vampire::%uuid of loop-player%} is true + sunlight level at the loop-player is greater than 10 + ignite the loop-player for 5 seconds + """) @Since("1.3.4") public class ExprLightLevel extends PropertyExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLocation.java b/src/main/java/ch/njol/skript/expressions/ExprLocation.java index c4a61f0f58c..d2dc61d162f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLocation.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLocation.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -22,8 +22,8 @@ */ @Name("Location") @Description("The location where an event happened (e.g. at an entity or block), or a location relative to another (e.g. 1 meter above another location).") -@Examples({"drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'", - "set {_loc} to the location 1 meter above the player"}) +@Example("drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'") +@Example("set {_loc} to the location 1 meter above the player") @Since("2.0") public class ExprLocation extends WrapperExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLocationAt.java b/src/main/java/ch/njol/skript/expressions/ExprLocationAt.java index 336d3739d66..965d18c9a00 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLocationAt.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLocationAt.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,8 +23,8 @@ */ @Name("Location At") @Description("Allows to create a location from three coordinates and a world.") -@Examples({"set {_loc} to the location at arg-1, arg-2, arg-3 of the world arg-4", - "distance between the player and the location (0, 0, 0) is less than 200"}) +@Example("set {_loc} to the location at arg-1, arg-2, arg-3 of the world arg-4") +@Example("distance between the player and the location (0, 0, 0) is less than 200") @Since("2.0") public class ExprLocationAt extends SimpleExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLocationFromVector.java b/src/main/java/ch/njol/skript/expressions/ExprLocationFromVector.java index d4c2b0545ef..878a01e5181 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLocationFromVector.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLocationFromVector.java @@ -8,7 +8,7 @@ import org.bukkit.util.Vector; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,9 +23,9 @@ */ @Name("Vectors - Create Location from Vector") @Description("Creates a location from a vector in a world.") -@Examples({"set {_loc} to {_v} to location in world \"world\"", - "set {_loc} to {_v} to location in world \"world\" with yaw 45 and pitch 90", - "set {_loc} to location of {_v} in \"world\" with yaw 45 and pitch 90"}) +@Example("set {_loc} to {_v} to location in world \"world\"") +@Example("set {_loc} to {_v} to location in world \"world\" with yaw 45 and pitch 90") +@Example("set {_loc} to location of {_v} in \"world\" with yaw 45 and pitch 90") @Since("2.2-dev28") public class ExprLocationFromVector extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLocationOf.java b/src/main/java/ch/njol/skript/expressions/ExprLocationOf.java index 04a2050fbec..2a3d981a927 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLocationOf.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLocationOf.java @@ -6,7 +6,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.WrapperExpression; @@ -22,8 +22,8 @@ @Description({"The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking " + "(e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time).", "Please note that the location of an entity is at it's feet, use head location to get the location of the head."}) -@Examples({"set {home::%uuid of player%} to the location of the player", - "message \"You home was set to %player's location% in %player's world%.\""}) +@Example("set {home::%uuid of player%} to the location of the player") +@Example("message \"You home was set to %player's location% in %player's world%.\"") @Since("") public class ExprLocationOf extends WrapperExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLocationVectorOffset.java b/src/main/java/ch/njol/skript/expressions/ExprLocationVectorOffset.java index 2139551122a..87756cb7e62 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLocationVectorOffset.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLocationVectorOffset.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,7 +25,7 @@ */ @Name("Vectors - Location Vector Offset") @Description("Returns the location offset by vectors.") -@Examples({"set {_loc} to {_loc} ~ {_v}"}) +@Example("set {_loc} to {_loc} ~ {_v}") @Since("2.2-dev28") public class ExprLocationVectorOffset extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLoopIteration.java b/src/main/java/ch/njol/skript/expressions/ExprLoopIteration.java index 19c889ef00d..decd86e403e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLoopIteration.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLoopIteration.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,17 +18,18 @@ @Name("Loop Iteration") @Description("Returns the loop's current iteration count (for both normal and while loops).") -@Examples({ - "while player is online:", - "\tgive player 1 stone", - "\twait 5 ticks", - "\tif loop-counter > 30:", - "\t\tstop loop", - "", - "loop {top-balances::*}:", - "\tif loop-iteration <= 10:", - "\t\tbroadcast \"#%loop-iteration% %loop-index% has $%loop-value%\"", -}) +@Example(""" + while player is online: + give player 1 stone + wait 5 ticks + if loop-counter > 30: + stop loop + """) +@Example(""" + loop {top-balances::*}: + if loop-iteration <= 10: + broadcast "#%loop-iteration% %loop-index% has $%loop-value%" + """) @Since("2.8.0") public class ExprLoopIteration extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLoopValue.java b/src/main/java/ch/njol/skript/expressions/ExprLoopValue.java index dfb87138050..3ee6ce7ad4e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLoopValue.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLoopValue.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -27,29 +27,32 @@ */ @Name("Loop value") @Description("Returns the previous, current, or next looped value.") -@Examples({ - "# Countdown", - "loop 10 times:", - "\tmessage \"%11 - loop-number%\"", - "\twait a second", - "", - "# Generate a 10x10 floor made of randomly colored wool below the player", - "loop blocks from the block below the player to the block 10 east of the block below the player:", - "\tloop blocks from the loop-block to the block 10 north of the loop-block:", - "\t\tset loop-block-2 to any wool", - "", - "loop {top-balances::*}:", - "\tloop-iteration <= 10", - "\tsend \"#%loop-iteration% %loop-index% has $%loop-value%\"", - "", - "loop shuffled (integers between 0 and 8):", - "\tif all:", - "\t\tprevious loop-value = 1", - "\t\tloop-value = 4", - "\t\tnext loop-value = 8", - "\tthen:", - "\t\t kill all players" -}) +@Example(""" + # Countdown + loop 10 times: + message "%11 - loop-number%" + wait a second + """) +@Example(""" + # Generate a 10x10 floor made of randomly colored wool below the player + loop blocks from the block below the player to the block 10 east of the block below the player: + loop blocks from the loop-block to the block 10 north of the loop-block: + set loop-block-2 to any wool + """) +@Example(""" + loop {top-balances::*}: + loop-iteration <= 10 + send "#%loop-iteration% %loop-index% has $%loop-value%" + """) +@Example(""" + loop shuffled (integers between 0 and 8): + if all: + previous loop-value = 1 + loop-value = 4 + next loop-value = 8 + then: + kill all players + """) @Since("1.0, 2.8.0 (loop-counter), 2.10 (previous, next)") public class ExprLoopValue extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLore.java b/src/main/java/ch/njol/skript/expressions/ExprLore.java index 7b4c26361cf..7d9dd51ef38 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLore.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLore.java @@ -20,7 +20,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.classes.Changer.ChangerUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -39,7 +39,7 @@ */ @Name("Lore") @Description("An item's lore.") -@Examples("set the 1st line of the item's lore to \"<orange>Excalibur 2.0\"") +@Example("set the 1st line of the item's lore to \"<orange>Excalibur 2.0\"") @Since("2.1") public class ExprLore extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprLowestHighestSolidBlock.java b/src/main/java/ch/njol/skript/expressions/ExprLowestHighestSolidBlock.java index 599c142606b..70b35f081d6 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprLowestHighestSolidBlock.java +++ b/src/main/java/ch/njol/skript/expressions/ExprLowestHighestSolidBlock.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -22,10 +22,8 @@ "An expression to obtain the lowest or highest solid (impassable) block at a location.", "Note that the y-coordinate of the location is not taken into account for this expression." }) -@Examples({ - "teleport the player to the block above the highest block at the player", - "set the highest solid block at the player's location to the lowest solid block at the player's location" -}) +@Example("teleport the player to the block above the highest block at the player") +@Example("set the highest solid block at the player's location to the lowest solid block at the player's location") @Since("2.2-dev34, 2.9.0 (lowest solid block, 'non-air' option removed, additional syntax option)") public class ExprLowestHighestSolidBlock extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMOTD.java b/src/main/java/ch/njol/skript/expressions/ExprMOTD.java index cef396b1e6f..06310e93758 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMOTD.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMOTD.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,8 +23,10 @@ @Description({"The message of the day in the server list. " + "This can be changed in a server list ping event only.", "'default MOTD' returns the default MOTD always and can't be changed."}) -@Examples({"on server list ping:", - " set the motd to \"Join now!\""}) +@Example(""" + on server list ping: + set the motd to "Join now!" + """) @Since("2.3") public class ExprMOTD extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxDurability.java b/src/main/java/ch/njol/skript/expressions/ExprMaxDurability.java index ba9359fb1a4..3580ba650a4 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxDurability.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxDurability.java @@ -4,7 +4,7 @@ import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -18,14 +18,12 @@ @Name("Max Durability") @Description({"The maximum durability of an item. Changing requires Minecraft 1.20.5+", "Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+"}) -@Examples({ - "maximum durability of diamond sword", - "if max durability of player's tool is not 0: # Item is damageable", - "set max durability of player's tool to 5000", - "add 5 to max durability of player's tool", - "reset max durability of player's tool", - "delete max durability of player's tool" -}) +@Example("maximum durability of diamond sword") +@Example("if max durability of player's tool is not 0: # Item is damageable") +@Example("set max durability of player's tool to 5000") +@Example("add 5 to max durability of player's tool") +@Example("reset max durability of player's tool") +@Example("delete max durability of player's tool") @RequiredPlugins("Minecraft 1.20.5+ (custom amount)") @Since("2.5, 2.9.0 (change)") public class ExprMaxDurability extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxFreezeTicks.java b/src/main/java/ch/njol/skript/expressions/ExprMaxFreezeTicks.java index cc0bda4172f..f86c128e280 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxFreezeTicks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxFreezeTicks.java @@ -4,7 +4,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,10 +15,10 @@ @Name("Maximum Freeze Time") @Description("The maximum amount of time an entity can spend in powdered snow before taking damage.") -@Examples({ - "difference between player's freeze time and player's max freeze time is less than 1 second:", - "\tsend \"you're about to freeze!\" to the player" -}) +@Example(""" + difference between player's freeze time and player's max freeze time is less than 1 second: + send "you're about to freeze!" to the player + """) @Since("2.7") public class ExprMaxFreezeTicks extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxHealth.java b/src/main/java/ch/njol/skript/expressions/ExprMaxHealth.java index cfe64906bf0..e215bbf4b2a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxHealth.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxHealth.java @@ -9,7 +9,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -19,10 +19,14 @@ */ @Name("Max Health") @Description("The maximum health of an entity, e.g. 10 for a player.") -@Examples({"on join:", - " set the maximum health of the player to 100", - "spawn a giant", - "set the last spawned entity's max health to 1000"}) +@Example(""" + on join: + set the maximum health of the player to 100 + """) +@Example(""" + spawn a giant + set the last spawned entity's max health to 1000 + """) @Since("2.0") @Events({"damage", "death"}) public class ExprMaxHealth extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxItemUseTime.java b/src/main/java/ch/njol/skript/expressions/ExprMaxItemUseTime.java index afb0e1f8121..b33d97a4b48 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxItemUseTime.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxItemUseTime.java @@ -13,10 +13,10 @@ "E.g. it takes 1.6 seconds to drink a potion, or 1.4 seconds to load an unenchanted crossbow.", "Some items, like bows and shields, do not have a limit to their use. They will return 1 hour." }) -@Examples({ - "on right click:", - "\tbroadcast max usage duration of player's tool" -}) +@Example(""" + on right click: + broadcast max usage duration of player's tool + """) @Since("2.8.0") public class ExprMaxItemUseTime extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxMinecartSpeed.java b/src/main/java/ch/njol/skript/expressions/ExprMaxMinecartSpeed.java index 27b8bf6e774..d77a874c19f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxMinecartSpeed.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxMinecartSpeed.java @@ -7,7 +7,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,8 +15,10 @@ @Name("Max Minecart Speed") @Description("The maximum speed of a minecart.") -@Examples({"on right click on minecart:", - "\tset max minecart speed of event-entity to 1"}) +@Example(""" + on right click on minecart: + set max minecart speed of event-entity to 1 + """) @Since("2.5.1") public class ExprMaxMinecartSpeed extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxPlayers.java b/src/main/java/ch/njol/skript/expressions/ExprMaxPlayers.java index 03027778e4f..95a4e6cb500 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxPlayers.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxPlayers.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,8 +22,10 @@ @Name("Max Players") @Description({"The count of max players. This can be changed in a server list ping event only.", "'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later."}) -@Examples({"on server list ping:", - " set the max players count to (online players count + 1)"}) +@Example(""" + on server list ping: + set the max players count to (online players count + 1) + """) @Since("2.3, 2.7 (modify max real players)") public class ExprMaxPlayers extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMaxStack.java b/src/main/java/ch/njol/skript/expressions/ExprMaxStack.java index 360c202f753..26f51a5184f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMaxStack.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMaxStack.java @@ -12,7 +12,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -25,12 +25,10 @@ "The maximum stack size of an item (e.g. 64 for torches, 16 for buckets, 1 for swords, etc.) or inventory.", "In 1.20.5+, the maximum stack size of items can be changed to any integer from 1 to 99, and stacked up to the maximum stack size of the inventory they're in." }) -@Examples({ - "send \"You can hold %max stack size of player's tool% of %type of player's tool% in a slot.\" to player", - "set the maximum stack size of inventory of all players to 16", - "add 8 to the maximum stack size of player's tool", - "reset the maximum stack size of {_gui}" -}) +@Example("send \"You can hold %max stack size of player's tool% of %type of player's tool% in a slot.\" to player") +@Example("set the maximum stack size of inventory of all players to 16") +@Example("add 8 to the maximum stack size of player's tool") +@Example("reset the maximum stack size of {_gui}") @Since("2.1, 2.10 (changeable, inventories)") @RequiredPlugins("Spigot 1.20.5+ (changeable)") public class ExprMaxStack extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMe.java b/src/main/java/ch/njol/skript/expressions/ExprMe.java index a365c38bea6..554115537ab 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMe.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMe.java @@ -8,7 +8,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.command.EffectCommandEvent; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,7 +19,9 @@ @Name("Me") @Description("A 'me' expression that can be used in players' effect commands only.") -@Examples({"!heal me", "!kick myself", "!give a diamond axe to me"}) +@Example("!heal me") +@Example("!kick myself") +@Example("!give a diamond axe to me") @Since("2.1.1") public class ExprMe extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMemory.java b/src/main/java/ch/njol/skript/expressions/ExprMemory.java index 391ef7d73ce..e35fbc909c9 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMemory.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMemory.java @@ -4,7 +4,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,11 +18,11 @@ @Name("Free / Max / Total Memory") @Description("The free, max or total memory of the server in Megabytes.") -@Examples({ - "while player is online:", - "\tsend action bar \"Memory left: %free memory%/%max memory%MB\" to player", - "\twait 5 ticks" -}) +@Example(""" + while player is online: + send action bar "Memory left: %free memory%/%max memory%MB" to player + wait 5 ticks + """) @Since("2.8.0") public class ExprMemory extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMendingRepairAmount.java b/src/main/java/ch/njol/skript/expressions/ExprMendingRepairAmount.java index 39368c412ec..e562b75e35d 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMendingRepairAmount.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMendingRepairAmount.java @@ -8,7 +8,7 @@ import ch.njol.skript.bukkitutil.ItemUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,8 +22,10 @@ @Name("Mending Repair Amount") @Description({"The number of durability points an item is to be repaired in a mending event.", " Modifying the repair amount will affect how much experience is given to the player after mending."}) -@Examples({"on item mend:", - "\tset the mending repair amount to 100"}) +@Example(""" + on item mend: + set the mending repair amount to 100 + """) @Since("2.5.1") public class ExprMendingRepairAmount extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMessage.java b/src/main/java/ch/njol/skript/expressions/ExprMessage.java index 15c9dbc37de..95b545e804c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMessage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMessage.java @@ -27,30 +27,35 @@ "the death message of a death event or the broadcasted message in a broadcast event. " + "This expression is mostly useful for being changed." ) -@Examples({ - "on chat:", - "\tplayer has permission \"admin\"", - "\tset message to \"&c%message%\"", - "", - "on first join:", - "\tset join message to \"Welcome %player% to our awesome server!\"", - "", - "on join:", - "\tplayer has played before", - "\tset join message to \"Welcome back, %player%!\"", - "", - "on quit:", - "\tif {vanish::%player's uuid%} is set:", - "\t\tclear quit message", - "\telse:", - "\t\tset quit message to \"%player% left this awesome server!\"", - "", - "on death:", - "\tset the death message to \"%player% died!\"", - "", - "on broadcast:", - "\tset broadcast message to \"&a[BROADCAST] %broadcast message%\"" -}) +@Example(""" + on chat: + player has permission "admin" + set message to "&c%message%" + """) +@Example(""" + on first join: + set join message to "Welcome %player% to our awesome server!" + """) +@Example(""" + on join: + player has played before + set join message to "Welcome back, %player%!" + """) +@Example(""" + on quit: + if {vanish::%player's uuid%} is set: + clear quit message + else: + set quit message to "%player% left this awesome server!" + """) +@Example(""" + on death: + set the death message to "%player% died!" + """) +@Example(""" + on broadcast: + set broadcast message to "&a[BROADCAST] %broadcast message%" + """) @Since("1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message), 2.9.0 (clear message), 2.10 (broadcasted message)") @Events({"chat", "join", "quit", "death", "broadcast"}) public class ExprMessage extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMetadata.java b/src/main/java/ch/njol/skript/expressions/ExprMetadata.java index ca96b6af542..11dbcf1b9f0 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMetadata.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMetadata.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -32,11 +32,9 @@ @Name("Metadata") @Description("Metadata is a way to store temporary data on entities, blocks and more that disappears after a server restart.") -@Examples({ - "set metadata value \"healer\" of player to true", - "broadcast \"%metadata value \"\"healer\"\" of player%\"", - "clear metadata value \"healer\" of player" -}) +@Example("set metadata value \"healer\" of player to true") +@Example("broadcast \"%metadata value \"healer\" of player%\"") +@Example("clear metadata value \"healer\" of player") @Since("2.2-dev36, 2.10 (add, remove)") public class ExprMetadata extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMiddleOfLocation.java b/src/main/java/ch/njol/skript/expressions/ExprMiddleOfLocation.java index 132d2908ba0..7001432817f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMiddleOfLocation.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMiddleOfLocation.java @@ -1,7 +1,7 @@ package ch.njol.skript.expressions; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -13,12 +13,13 @@ @Name("Middle of Location") @Description("Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.") -@Examples({ - "command /stuck:", - "\texecutable by: players", - "\ttrigger:", - "\t\tteleport player to the center of player's location", - "\t\tsend \"You're no longer stuck.\""}) +@Example(""" + command /stuck: + executable by: players + trigger: + teleport player to the center of player's location + send "You're no longer stuck." + """) @Since("2.6.1") public class ExprMiddleOfLocation extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMinecartDerailedFlyingVelocity.java b/src/main/java/ch/njol/skript/expressions/ExprMinecartDerailedFlyingVelocity.java index f109a65dc6f..9a0d20facaa 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMinecartDerailedFlyingVelocity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMinecartDerailedFlyingVelocity.java @@ -8,7 +8,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -19,8 +19,10 @@ @Name("Minecart Derailed / Flying Velocity") @Description("The velocity of a minecart as soon as it has been derailed or as soon as it starts flying.") -@Examples({"on right click on minecart:", - "\tset derailed velocity of event-entity to vector 2, 10, 2"}) +@Example(""" + on right click on minecart: + set derailed velocity of event-entity to vector 2, 10, 2 + """) @Since("2.5.1") public class ExprMinecartDerailedFlyingVelocity extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprMoonPhase.java b/src/main/java/ch/njol/skript/expressions/ExprMoonPhase.java index 3d667c51730..4ad212b0de9 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprMoonPhase.java +++ b/src/main/java/ch/njol/skript/expressions/ExprMoonPhase.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -12,10 +12,10 @@ @Name("Moon Phase") @Description("The current moon phase of a world.") -@Examples({ - "if moon phase of player's world is full moon:", - "\tsend \"Watch for the wolves!\"" -}) +@Example(""" + if moon phase of player's world is full moon: + send "Watch for the wolves!" + """) @Since("2.7") public class ExprMoonPhase extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprName.java b/src/main/java/ch/njol/skript/expressions/ExprName.java index 9a3b05b34ba..c213650c4f5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprName.java +++ b/src/main/java/ch/njol/skript/expressions/ExprName.java @@ -5,7 +5,7 @@ import ch.njol.skript.bukkitutil.InventoryUtils; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -79,13 +79,13 @@ "Scripts:", "\tName: The name of a script, excluding its file extension." }) -@Examples({ - "on join:", - "\tplayer has permission \"name.red\"", - "\tset the player's display name to \"<red>[admin] <gold>%name of player%\"", - "\tset the player's tab list name to \"<green>%player's name%\"", - "set the name of the player's tool to \"Legendary Sword of Awesomeness\"" -}) +@Example(""" + on join: + player has permission "name.red" + set the player's display name to "<red>[admin] <gold>%name of player%" + set the player's tab list name to "<green>%player's name%" + """) +@Example("set the name of the player's tool to \"Legendary Sword of Awesomeness\"") @Since({ "before 2.1", "2.2-dev20 (inventory name)", diff --git a/src/main/java/ch/njol/skript/expressions/ExprNamed.java b/src/main/java/ch/njol/skript/expressions/ExprNamed.java index e87ad4b5170..39d302e29e7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNamed.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNamed.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -31,10 +31,10 @@ @Name("Named Item/Inventory") @Description("Directly names an item/inventory, useful for defining a named item/inventory in a script. " + "If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.") -@Examples({"give a diamond sword of sharpness 100 named \"<gold>Excalibur\" to the player", - "set tool of player to the player's tool named \"<gold>Wand\"", - "set the name of the player's tool to \"<gold>Wand\"", - "open hopper inventory named \"Magic Hopper\" to player"}) +@Example("give a diamond sword of sharpness 100 named \"Excalibur\" to the player") +@Example("set tool of player to the player's tool named \"Wand\"") +@Example("set the name of the player's tool to \"Wand\"") +@Example("open hopper inventory named \"Magic Hopper\" to player") @Since("2.0, 2.2-dev34 (inventories)") public class ExprNamed extends PropertyExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java b/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java index e2cc6631ad3..17e604a61ea 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNearestEntity.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.entity.EntityData; @@ -24,14 +24,13 @@ @Name("Nearest Entity") @Description("Gets the entity nearest to a location or another entity.") -@Examples({ - "kill the nearest pig and cow relative to player", - "teleport player to the nearest cow relative to player", - "teleport player to the nearest entity relative to player", - "", - "on click:", - "\tkill nearest pig" -}) +@Example("kill the nearest pig and cow relative to player") +@Example("teleport player to the nearest cow relative to player") +@Example("teleport player to the nearest entity relative to player") +@Example(""" + on click: + kill nearest pig + """) @Since("2.7") public class ExprNearestEntity extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNewBannerPattern.java b/src/main/java/ch/njol/skript/expressions/ExprNewBannerPattern.java index 75cc05d20f8..271834d0828 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNewBannerPattern.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNewBannerPattern.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -20,13 +20,11 @@ @Name("Banner Pattern") @Description("Creates a new banner pattern.") -@Examples({ - "set {_pattern} to a creeper banner pattern colored red", - "add {_pattern} to banner patterns of {_banneritem}", - "remove {_pattern} from banner patterns of {_banneritem}", - "set the 1st banner pattern of block at location(0,0,0) to {_pattern}", - "clear the 1st banner pattern of block at location(0,0,0)", -}) +@Example("set {_pattern} to a creeper banner pattern colored red") +@Example("add {_pattern} to banner patterns of {_banneritem}") +@Example("remove {_pattern} from banner patterns of {_banneritem}") +@Example("set the 1st banner pattern of block at location(0,0,0) to {_pattern}") +@Example("clear the 1st banner pattern of block at location(0,0,0)") @Since("2.10") public class ExprNewBannerPattern extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNoDamageTicks.java b/src/main/java/ch/njol/skript/expressions/ExprNoDamageTicks.java index ab33e23c5c9..6099800eb3a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNoDamageTicks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNoDamageTicks.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -18,10 +18,10 @@ @Name("No Damage Ticks") @Description("The number of ticks that an entity is invulnerable to damage for.") -@Examples({ - "on damage:", - "\tset victim's invulnerability ticks to 20 #Victim will not take damage for the next second" -}) +@Example(""" + on damage: + set victim's invulnerability ticks to 20 #Victim will not take damage for the next second + """) @Since("2.5, 2.11 (deprecated)") @Deprecated(since = "2.11.0", forRemoval = true) public class ExprNoDamageTicks extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNoDamageTime.java b/src/main/java/ch/njol/skript/expressions/ExprNoDamageTime.java index e7d57f1ed56..e1ec824acbd 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNoDamageTime.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNoDamageTime.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,13 +16,14 @@ @Name("No Damage Time") @Description("The amount of time an entity is invulnerable to any damage.") -@Examples({ - "on damage:", - "\tset victim's invulnerability time to 20 ticks #Victim will not take damage for the next second", - "", - "if the no damage timespan of {_entity} is 0 seconds:", - "\tset the invincibility time span of {_entity} to 1 minute" -}) +@Example(""" + on damage: + set victim's invulnerability time to 20 ticks #Victim will not take damage for the next second + """) +@Example(""" + if the no damage timespan of {_entity} is 0 seconds: + set the invincibility time span of {_entity} to 1 minute + """) @Since("2.11") public class ExprNoDamageTime extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNode.java b/src/main/java/ch/njol/skript/expressions/ExprNode.java index de0e2a1a498..6594ab492fb 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNode.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNode.java @@ -6,7 +6,7 @@ import ch.njol.skript.config.Node; import ch.njol.skript.config.SectionNode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -29,17 +29,16 @@ "Nodes in Skript configs are written in the format `key: value`.", "Section nodes can contain other nodes." }) -@Examples({ - """ - set {_node} to node "language" in the skript config - if text value of {_node} is "french": - broadcast "Bonjour!" - """, - """ - set {_script} to the current script - loop nodes of the current script: - broadcast name of loop-value""" -}) +@Example(""" + set {_node} to node "language" in the skript config + if text value of {_node} is "french": + broadcast "Bonjour!" + """) +@Example(""" + set {_script} to the current script + loop nodes of the current script: + broadcast name of loop-value + """) @Since("2.10") public class ExprNode extends PropertyExpression implements ReflectionExperimentSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNow.java b/src/main/java/ch/njol/skript/expressions/ExprNow.java index f0b980e7b25..76450bafd78 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNow.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNow.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,7 +17,7 @@ @Name("Now") @Description("The current system time of the server. Use time to get the Minecraft time of a world.") -@Examples({"broadcast \"Current server time: %now%\""}) +@Example("broadcast \"Current server time: %now%\"") @Since("1.4") public class ExprNow extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNumberOfCharacters.java b/src/main/java/ch/njol/skript/expressions/ExprNumberOfCharacters.java index daa5b6dab2d..e574420ba76 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNumberOfCharacters.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNumberOfCharacters.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,11 +17,13 @@ @Name("Number of Characters") @Description("The number of uppercase, lowercase, or digit characters in a string.") -@Examples({"#Simple Chat Filter", - "on chat:", - "\tif number of uppercase chars in message / length of message > 0.5", - "\t\tcancel event", - "\t\tsend \"<red>Your message has to many caps!\" to player"}) +@Example(""" + #Simple Chat Filter + on chat: + if number of uppercase chars in message / length of message > 0.5 + cancel event + send "<red>Your message has to many caps!" to player + """) @Since("2.5") public class ExprNumberOfCharacters extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprNumbers.java b/src/main/java/ch/njol/skript/expressions/ExprNumbers.java index 3f3080b4adb..d46043b50cd 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprNumbers.java +++ b/src/main/java/ch/njol/skript/expressions/ExprNumbers.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.SkriptConfig; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,9 +24,9 @@ "Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers.", "You may also use 'decimals' if you want to use the decimal precision of the start number.", "You may want to use the 'times' expression instead, for instance 'loop 5 times:'"}) -@Examples({"loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5", - "loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5", - "loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4"}) +@Example("loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5") +@Example("loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5") +@Example("loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4") @Since("1.4.6 (integers & numbers), 2.5.1 (decimals)") public class ExprNumbers extends SimpleExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprOfflinePlayers.java b/src/main/java/ch/njol/skript/expressions/ExprOfflinePlayers.java index d4a6f50c9b4..67739990265 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprOfflinePlayers.java +++ b/src/main/java/ch/njol/skript/expressions/ExprOfflinePlayers.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,7 +18,7 @@ @Name("Offline players") @Description("All players that have ever joined the server. This includes the players currently online.") -@Examples({"send \"Size of all players who have joined the server: %size of all offline players%\""}) +@Example("send \"Size of all players who have joined the server: %size of all offline players%\"") @Since("2.2-dev35") public class ExprOfflinePlayers extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprOnScreenKickMessage.java b/src/main/java/ch/njol/skript/expressions/ExprOnScreenKickMessage.java index bb63de37a8a..442d81abbce 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprOnScreenKickMessage.java +++ b/src/main/java/ch/njol/skript/expressions/ExprOnScreenKickMessage.java @@ -16,11 +16,11 @@ @Name("On-screen Kick Message") @Description("The kick message that is displayed on-screen when a player is kicked.") -@Examples({ - "on kick:", - "\ton-screen kick message is \"Invalid hotbar selection (Hacking?)\"", - "\tcancel event" -}) +@Example(""" + on kick: + on-screen kick message is "Invalid hotbar selection (Hacking?)" + cancel event + """) @Since("2.12") @Events("Kick") public class ExprOnScreenKickMessage extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprOnlinePlayersCount.java b/src/main/java/ch/njol/skript/expressions/ExprOnlinePlayersCount.java index ac675455100..e0a8af841ff 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprOnlinePlayersCount.java +++ b/src/main/java/ch/njol/skript/expressions/ExprOnlinePlayersCount.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,11 +24,11 @@ "server list ping event only to show fake online player amount.", "real online player count always return the real count of online players and can't be changed." }) -@Examples({ - "on server list ping:", - "\t# This will make the max players count 5 if there are 4 players online.", - "\tset the fake max players count to (online player count + 1)" -}) +@Example(""" + on server list ping: + # This will make the max players count 5 if there are 4 players online. + set the fake max players count to (online player count + 1) + """) @Since("2.3") public class ExprOnlinePlayersCount extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprOpenedInventory.java b/src/main/java/ch/njol/skript/expressions/ExprOpenedInventory.java index e4f4704a581..19f6313f565 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprOpenedInventory.java +++ b/src/main/java/ch/njol/skript/expressions/ExprOpenedInventory.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.bukkitutil.InventoryUtils; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -19,7 +19,7 @@ @Name("Opened Inventory") @Description({"Return the currently opened inventory of a player.", "If no inventory is open, it returns the own player's crafting inventory."}) -@Examples({"set slot 1 of player's current inventory to diamond sword"}) +@Example("set slot 1 of player's current inventory to diamond sword") @Since("2.2-dev24, 2.2-dev35 (Just 'current inventory' works in player events)") public class ExprOpenedInventory extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprOps.java b/src/main/java/ch/njol/skript/expressions/ExprOps.java index 554bf84544d..37a1052caca 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprOps.java +++ b/src/main/java/ch/njol/skript/expressions/ExprOps.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,7 +23,7 @@ @Name("All Operators") @Description("The list of operators on the server.") -@Examples("set {_ops::*} to all operators") +@Example("set {_ops::*} to all operators") @Since("2.7") public class ExprOps extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprParse.java b/src/main/java/ch/njol/skript/expressions/ExprParse.java index d1da502924c..edd49d2af56 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprParse.java +++ b/src/main/java/ch/njol/skript/expressions/ExprParse.java @@ -4,7 +4,7 @@ import ch.njol.skript.classes.ClassInfo; import ch.njol.skript.classes.Parser; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -45,17 +45,17 @@ "- You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as \"...\".", "- The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable," + " e.g. the values will be stored in {parsed::1::*}, not {parsed::1}."}) -@Examples({ - "set {var} to line 1 parsed as number", - "on chat:", - "\tset {var::*} to message parsed as \"buying %items% for %money%\"", - "\tif parse error is set:", - "\t\tmessage \"%parse error%\"", - "\telse if {var::*} is set:", - "\t\tcancel event", - "\t\tremove {var::2} from the player's balance", - "\t\tgive {var::1::*} to the player" -}) +@Example("set {var} to line 1 parsed as number") +@Example(""" + on chat: + set {var::*} to message parsed as "buying %items% for %money%" + if parse error is set: + message "%parse error%" + else if {var::*} is set: + cancel event + remove {var::2} from the player's balance + give {var::1::*} to the player + """) @Since("2.0") public class ExprParse extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprParseError.java b/src/main/java/ch/njol/skript/expressions/ExprParseError.java index 16607ccb64d..470a6f44f7e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprParseError.java +++ b/src/main/java/ch/njol/skript/expressions/ExprParseError.java @@ -5,7 +5,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,12 +19,14 @@ */ @Name("Parse Error") @Description("The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.") -@Examples({"set {var} to line 1 parsed as integer", - "if {var} is not set:", - " parse error is set:", - " message \"<red>Line 1 is invalid: %last parse error%\"", - " else:", - " message \"<red>Please put an integer on line 1!\""}) +@Example(""" + set {var} to line 1 parsed as integer + if {var} is not set: + parse error is set: + message "<red>Line 1 is invalid: %last parse error%" + else: + message "<red>Please put an integer on line 1!" + """) @Since("2.0") public class ExprParseError extends SimpleExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPassenger.java b/src/main/java/ch/njol/skript/expressions/ExprPassenger.java index 1be2b7d4c39..4714e035ce5 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPassenger.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPassenger.java @@ -15,7 +15,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import org.skriptlang.skript.lang.converter.Converter; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.effects.Delay; @@ -33,16 +33,14 @@ @Description({"The passenger of a vehicle, or the rider of a mob.", "For 1.11.2 and above, it returns a list of passengers and you can use all changers in it.", "See also: vehicle"}) -@Examples({"#for 1.11 and lower", - "passenger of the minecart is a creeper or a cow", - "the saddled pig's passenger is a player", - "#for 1.11.2+", - "passengers of the minecart contains a creeper or a cow", - "the boat's passenger contains a pig", - "add a cow and a zombie to passengers of last spawned boat", - "set passengers of player's vehicle to a pig and a horse", - "remove all pigs from player's vehicle", - "clear passengers of boat"}) +@Example(""" + passengers of the minecart contains a creeper or a cow + the boat's passenger contains a pig + add a cow and a zombie to passengers of last spawned boat + set passengers of player's vehicle to a pig and a horse + remove all pigs from player's vehicle + clear passengers of boat + """) @Since("2.0, 2.2-dev26 (Multiple passengers for 1.11.2+)") public class ExprPassenger extends SimpleExpression { // REMIND create 'vehicle' and 'passenger' expressions for vehicle enter/exit events? static { // It was necessary to convert to SimpleExpression due to the method 'isSingle()'. diff --git a/src/main/java/ch/njol/skript/expressions/ExprPercent.java b/src/main/java/ch/njol/skript/expressions/ExprPercent.java index fa21558fb81..edb48a360b3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPercent.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPercent.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -17,13 +17,11 @@ @Name("Percent of") @Description("Returns a percentage of one or more numbers.") -@Examples({ - "set damage to 10% of victim's health", - "set damage to 125 percent of damage", - "set {_result} to {_percent} percent of 999", - "set {_result::*} to 10% of {_numbers::*}", - "set experience to 50% of player's total experience" -}) +@Example("set damage to 10% of victim's health") +@Example("set damage to 125 percent of damage") +@Example("set {_result} to {_percent} percent of 999") +@Example("set {_result::*} to 10% of {_numbers::*}") +@Example("set experience to 50% of player's total experience") @Since("2.8.0") public class ExprPercent extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPermissions.java b/src/main/java/ch/njol/skript/expressions/ExprPermissions.java index 36a54f620ab..a1f02c68816 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPermissions.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPermissions.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,7 +24,7 @@ @Name("All Permissions") @Description("Returns all permissions of the defined player(s). Note that the modifications to resulting list do not actually change permissions.") -@Examples("set {_permissions::*} to all permissions of the player") +@Example("set {_permissions::*} to all permissions of the player") @Since("2.2-dev33") public class ExprPermissions extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPickupDelay.java b/src/main/java/ch/njol/skript/expressions/ExprPickupDelay.java index 98c41a54599..8b635d3f9dc 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPickupDelay.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPickupDelay.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,10 +15,8 @@ @Name("Pickup Delay") @Description("The amount of time before a dropped item can be picked up by an entity.") -@Examples({ - "drop diamond sword at {_location} without velocity", - "set pickup delay of last dropped item to 5 seconds" -}) +@Example("drop diamond sword at {_location} without velocity") +@Example("set pickup delay of last dropped item to 5 seconds") @Since("2.7") public class ExprPickupDelay extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPing.java b/src/main/java/ch/njol/skript/expressions/ExprPing.java index 855e435a05a..2fa5068c55e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPing.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPing.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -16,9 +16,11 @@ @Description("Pings of players, as Minecraft server knows them. Note that they will almost certainly" + " be different from the ones you'd get from using ICMP echo requests." + " This expression is only supported on some server software (PaperSpigot).") -@Examples({"command /ping :", - "\ttrigger:", - "\t\tsend \"%arg-1%'s ping is %arg-1's ping%\""}) +@Example(""" + command /ping : + trigger: + send "%arg-1%'s ping is %arg-1's ping%" + """) @Since("2.2-dev36") public class ExprPing extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPlain.java b/src/main/java/ch/njol/skript/expressions/ExprPlain.java index 3ff04713e9a..901b151c26c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPlain.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPlain.java @@ -4,7 +4,7 @@ import ch.njol.skript.aliases.ItemData; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,8 +19,10 @@ @Name("Plain Item") @Description("A plain item is an item with no modifications. It can be used to convert items to their default state or to match with other default items.") -@Examples({"if the player's tool is a plain diamond: # check if player's tool has no modifications", - "\tsend \"You are holding a plain diamond!\""}) +@Example(""" + if the player's tool is a plain diamond: # check if player's tool has no modifications + send "You are holding a plain diamond!" + """) @Since("2.6") public class ExprPlain extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPlayerChatCompletions.java b/src/main/java/ch/njol/skript/expressions/ExprPlayerChatCompletions.java index 4dea12cdfbe..c9822c7195c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPlayerChatCompletions.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPlayerChatCompletions.java @@ -13,7 +13,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -25,11 +25,9 @@ "The custom chat completion suggestions. You can add, set, remove, and clear them. Removing the names of online players with this expression is ineffective.", "This expression will not return anything due to Bukkit limitations." }) -@Examples({ - "add \"Skript\" and \"Njol\" to chat completions of all players", - "remove \"text\" from {_p}'s chat completions", - "clear player's chat completions" -}) +@Example("add \"Skript\" and \"Njol\" to chat completions of all players") +@Example("remove \"text\" from {_p}'s chat completions") +@Example("clear player's chat completions") @RequiredPlugins("Spigot 1.19+") @Since("2.10") public class ExprPlayerChatCompletions extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPlayerProtocolVersion.java b/src/main/java/ch/njol/skript/expressions/ExprPlayerProtocolVersion.java index 90b9280d49a..8f806f98660 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPlayerProtocolVersion.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPlayerProtocolVersion.java @@ -8,9 +8,11 @@ @Name("Player Protocol Version") @Description("Player's protocol version. For more information and list of protocol versions visit wiki.vg.") -@Examples({"command /protocolversion <player>:", - "\ttrigger:", - "\t\tsend \"Protocol version of %arg-1%: %protocol version of arg-1%\""}) +@Example(""" + command /protocolversion <player>: + trigger: + send "Protocol version of %arg-1%: %protocol version of arg-1%" + """) @Since("2.6.2") public class ExprPlayerProtocolVersion extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPlayerlistHeaderFooter.java b/src/main/java/ch/njol/skript/expressions/ExprPlayerlistHeaderFooter.java index 03dc81ba00b..196ee939388 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPlayerlistHeaderFooter.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPlayerlistHeaderFooter.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.RequiredPlugins; import ch.njol.skript.doc.Since; @@ -20,9 +20,9 @@ @Name("Player List Header and Footer") @Description("The message above and below the player list in the tab menu.") -@Examples({"set all players' tab list header to \"Welcome to the Server!\"", - "send \"%the player's tab list header%\" to player", - "reset all players' tab list header"}) +@Example("set all players' tab list header to \"Welcome to the Server!\"") +@Example("send \"%the player's tab list header%\" to player") +@Example("reset all players' tab list header") @Since("2.4") @RequiredPlugins("Minecraft 1.13 or newer") public class ExprPlayerlistHeaderFooter extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPlugins.java b/src/main/java/ch/njol/skript/expressions/ExprPlugins.java index 6c6b4924e0e..537708d6ff3 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPlugins.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPlugins.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -19,12 +19,11 @@ @Name("Loaded Plugins") @Description("An expression to obtain a list of the names of the server's loaded plugins.") -@Examples({ - "if the loaded plugins contains \"Vault\":", - "\tbroadcast \"This server uses Vault plugin!\"", - "", - "send \"Plugins (%size of loaded plugins%): %plugins%\" to player" -}) +@Example(""" + if the loaded plugins contains "Vault": + broadcast "This server uses Vault plugin!" + """) +@Example("send \"Plugins (%size of loaded plugins%): %plugins%\" to player") @Since("2.7") public class ExprPlugins extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPortal.java b/src/main/java/ch/njol/skript/expressions/ExprPortal.java index a3c3011febe..5bde4f7ce26 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPortal.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPortal.java @@ -12,7 +12,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,9 +23,11 @@ @Name("Portal") @Description("The blocks associated with a portal in the portal creation event.") -@Examples({"on portal creation:", - " loop portal blocks:", - " broadcast \"%loop-block% is part of a portal!\""}) +@Example(""" + on portal creation: + loop portal blocks: + broadcast "%loop-block% is part of a portal!" + """) @Since("2.4") @Events("portal_create") public class ExprPortal extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPortalCooldown.java b/src/main/java/ch/njol/skript/expressions/ExprPortalCooldown.java index 09762d8f437..c49050aa104 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPortalCooldown.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPortalCooldown.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -20,11 +20,11 @@ "Players in survival/adventure get a cooldown of 0.5 seconds, while those in creative get no cooldown.", "Resetting will set the cooldown back to the default 15 seconds for non-player entities and 0.5 seconds for players." }) -@Examples({ - "on portal:", - "\twait 1 tick", - "\tset portal cooldown of event-entity to 5 seconds" -}) +@Example(""" + on portal: + wait 1 tick + set portal cooldown of event-entity to 5 seconds + """) @Since("2.8.0") public class ExprPortalCooldown extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPotionEffect.java b/src/main/java/ch/njol/skript/expressions/ExprPotionEffect.java index d9b35538e9b..96788278d58 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPotionEffect.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPotionEffect.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -20,10 +20,10 @@ @Name("Potion Effect") @Description({"Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects ", "to tipped arrows/lingering potions, Minecraft reduces the timespan."}) -@Examples({"set {_p} to potion effect of speed of tier 1 without particles for 10 minutes", - "add {_p} to potion effects of player's tool", - "add {_p} to potion effects of target entity", - "add potion effect of speed 1 to potion effects of player"}) +@Example("set {_p} to potion effect of speed of tier 1 without particles for 10 minutes") +@Example("add {_p} to potion effects of player's tool") +@Example("add {_p} to potion effects of target entity") +@Example("add potion effect of speed 1 to potion effects of player") @Since("2.5.2") public class ExprPotionEffect extends SimpleExpression { static { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPotionEffectTier.java b/src/main/java/ch/njol/skript/expressions/ExprPotionEffectTier.java index 42158ac6bb2..b57b247bff2 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPotionEffectTier.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPotionEffectTier.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -21,7 +21,7 @@ @Name("Potion Effect Tier") @Description("An expression to obtain the amplifier of a potion effect applied to an entity.") -@Examples("if the amplifier of haste of player >= 3:") +@Example("if the amplifier of haste of player >= 3:") @Since("2.7") public class ExprPotionEffectTier extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPotionEffects.java b/src/main/java/ch/njol/skript/expressions/ExprPotionEffects.java index 89b66f570fa..a44749cde9a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPotionEffects.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPotionEffects.java @@ -12,7 +12,7 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -28,12 +28,12 @@ "You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype.", "Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle.", "When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1."}) -@Examples({"set {_p::*} to active potion effects of player", - "clear all the potion effects of player", - "clear all the potion effects of player's tool", - "add potion effects of player to potion effects of player's tool", - "add speed to potion effects of target entity", - "remove speed and night vision from potion effects of player"}) +@Example("set {_p::*} to active potion effects of player") +@Example("clear all the potion effects of player") +@Example("clear all the potion effects of player's tool") +@Example("add potion effects of player to potion effects of player's tool") +@Example("add speed to potion effects of target entity") +@Example("remove speed and night vision from potion effects of player") @Since("2.5.2") public class ExprPotionEffects extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprProjectileCriticalState.java b/src/main/java/ch/njol/skript/expressions/ExprProjectileCriticalState.java index 51f194c997b..806e36fb2e8 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprProjectileCriticalState.java +++ b/src/main/java/ch/njol/skript/expressions/ExprProjectileCriticalState.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -17,9 +17,11 @@ @Name("Projectile Critical State") @Description("A projectile's critical state. The only currently accepted projectiles are arrows and tridents.") -@Examples({"on shoot:", - "\tevent-projectile is an arrow", - "\tset projectile critical mode of event-projectile to true"}) +@Example(""" + on shoot: + event-projectile is an arrow + set projectile critical mode of event-projectile to true + """) @Since("2.5.1") public class ExprProjectileCriticalState extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprProtocolVersion.java b/src/main/java/ch/njol/skript/expressions/ExprProtocolVersion.java index 160149711bf..c83c8fbe892 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprProtocolVersion.java +++ b/src/main/java/ch/njol/skript/expressions/ExprProtocolVersion.java @@ -26,9 +26,11 @@ "", "This can be set in a server list ping event only", "(increase and decrease effects cannot be used because that wouldn't make sense).",}) -@Examples({"on server list ping:", - "\tset the version string to \"<light green>Version: <orange>%minecraft version%\"", - "\tset the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always"}) +@Example(""" + on server list ping: + set the version string to "<light green>Version: <orange>%minecraft version%" + set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always + """) @Since("2.3") @Events("server list ping") public class ExprProtocolVersion extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprPushedBlocks.java b/src/main/java/ch/njol/skript/expressions/ExprPushedBlocks.java index bdb6bb5a6bb..cd1eb8a582a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprPushedBlocks.java +++ b/src/main/java/ch/njol/skript/expressions/ExprPushedBlocks.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,7 +22,7 @@ @Name("Moved blocks") @Description("Blocks which are moved in a piston event. Cannot be used outside of piston events.") -@Examples("the moved blocks") +@Example("the moved blocks") @Since("2.2-dev27") public class ExprPushedBlocks extends SimpleExpression implements EventRestrictedSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprQueue.java b/src/main/java/ch/njol/skript/expressions/ExprQueue.java index 8956d1b85fd..9bebc478149 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprQueue.java +++ b/src/main/java/ch/njol/skript/expressions/ExprQueue.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -29,19 +29,19 @@ This means that removing an element from the queue will always return a value unless the queue is empty. Requesting an element from a queue (e.g. `the 1st element of {queue}`) also removes it from the queue.""") -@Examples({ - """ - set {queue} to a new queue - add "hello" and "there" to {queue} - broadcast the first element of {queue} # hello - broadcast the first element of {queue} # there - # queue is now empty""", - """ - set {queue} to a new queue of "hello" and "there" - broadcast the last element of {queue} # removes 'there' - add "world" to {queue} - broadcast the first 2 elements of {queue} # removes 'hello', 'world'""" -}) +@Example(""" + set {queue} to a new queue + add "hello" and "there" to {queue} + broadcast the first element of {queue} # hello + broadcast the first element of {queue} # there + # queue is now empty + """) +@Example(""" + set {queue} to a new queue of "hello" and "there" + broadcast the last element of {queue} # removes 'there' + add "world" to {queue} + broadcast the first 2 elements of {queue} # removes 'hello', 'world' + """) @Since("2.10 (experimental)") public class ExprQueue extends SimpleExpression implements QueueExperimentSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprQueueStartEnd.java b/src/main/java/ch/njol/skript/expressions/ExprQueueStartEnd.java index 824bd4b0c25..2b997737956 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprQueueStartEnd.java +++ b/src/main/java/ch/njol/skript/expressions/ExprQueueStartEnd.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -24,7 +24,7 @@ This is designed for use with the add changer: to add or remove elements from the start or the end of the queue. """) -@Examples(""" +@Example(""" set {queue} to a new queue add "hello" to {queue} add "foo" to the start of {queue} diff --git a/src/main/java/ch/njol/skript/expressions/ExprQuitReason.java b/src/main/java/ch/njol/skript/expressions/ExprQuitReason.java index 500cf83776c..74faeaf95b7 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprQuitReason.java +++ b/src/main/java/ch/njol/skript/expressions/ExprQuitReason.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.EventValueExpression; @@ -11,12 +11,12 @@ @Name("Quit Reason") @Description("The quit reason as to why a player disconnected in a quit event.") -@Examples({ - "on quit:", - "\tquit reason was kicked", - "\tplayer is banned", - "\tclear {server::player::%uuid of player%::*}" -}) +@Example(""" + on quit: + quit reason was kicked + player is banned + clear {server::player::%uuid of player%::*} + """) @Since("2.8.0") public class ExprQuitReason extends EventValueExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRandom.java b/src/main/java/ch/njol/skript/expressions/ExprRandom.java index 16db494d587..3245beabae6 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRandom.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRandom.java @@ -12,7 +12,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.ClassInfo; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -27,10 +27,8 @@ @Name("Random") @Description("Gets a random item out of a set, e.g. a random player out of all players online.") -@Examples({ - "give a diamond to a random player out of all players", - "give a random item out of all items to the player" -}) +@Example("give a diamond to a random player out of all players") +@Example("give a random item out of all items to the player") @Since("1.4.9") public class ExprRandom extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRandomCharacter.java b/src/main/java/ch/njol/skript/expressions/ExprRandomCharacter.java index 00d1ca08f87..e6daa4bcdbf 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRandomCharacter.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRandomCharacter.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -23,10 +23,8 @@ "This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters.", "If strings of more than one character are given, only the first character of each is used." }) -@Examples({ - "set {_captcha} to join (5 random characters between \"a\" and \"z\") with \"\"", - "send 3 random alphanumeric characters between \"0\" and \"z\"" -}) +@Example("set {_captcha} to join (5 random characters between \"a\" and \"z\") with \"\"") +@Example("send 3 random alphanumeric characters between \"0\" and \"z\"") @Since("2.8.0") public class ExprRandomCharacter extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRandomNumber.java b/src/main/java/ch/njol/skript/expressions/ExprRandomNumber.java index cc7df7c99bb..70c0d8c02b4 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRandomNumber.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRandomNumber.java @@ -11,7 +11,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -25,12 +25,10 @@ "A given amount of random numbers or integers between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers.", "Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2." }) -@Examples({ - "set the player's health to a random number between 5 and 10", - "send \"You rolled a %random integer from 1 to 6%!\" to the player", - "set {_chances::*} to 5 random integers between 5 and 96", - "set {_decimals::*} to 3 random numbers between 2.7 and -1.5" -}) +@Example("set the player's health to a random number between 5 and 10") +@Example("send \"You rolled a %random integer from 1 to 6%!\" to the player") +@Example("set {_chances::*} to 5 random integers between 5 and 96") +@Example("set {_decimals::*} to 3 random numbers between 2.7 and -1.5") @Since("1.4, 2.10 (Multiple random numbers)") public class ExprRandomNumber extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRandomUUID.java b/src/main/java/ch/njol/skript/expressions/ExprRandomUUID.java index 4d89b7eaed7..99d54185d02 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRandomUUID.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRandomUUID.java @@ -7,7 +7,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,7 +18,7 @@ @Name("Random UUID") @Description("Returns a random UUID.") -@Examples("set {_uuid} to random uuid") +@Example("set {_uuid} to random uuid") @Since("2.5.1, 2.11 (return UUIDs)") public class ExprRandomUUID extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRawName.java b/src/main/java/ch/njol/skript/expressions/ExprRawName.java index fec8a2d54b6..a10ba3dbe81 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRawName.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRawName.java @@ -9,7 +9,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.aliases.ItemType; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -20,7 +20,7 @@ @Name("Raw Name") @Description("The raw Minecraft material name of the given item. Note that this is not guaranteed to give same results on all servers.") -@Examples("raw name of tool of player") +@Example("raw name of tool of player") @Since("unknown (2.2)") public class ExprRawName extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRawString.java b/src/main/java/ch/njol/skript/expressions/ExprRawString.java index 13bdf4075b2..dcde487a54f 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRawString.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRawString.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -24,7 +24,7 @@ @Name("Raw String") @Description("Returns the string without formatting (colors etc.) and without stripping them from it, " + "e.g. raw \"&aHello There!\" would output &aHello There!") -@Examples("send raw \"&aThis text is unformatted!\" to all players") +@Example("send raw \"&aThis text is unformatted!\" to all players") @Since("2.7") public class ExprRawString extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprReadiedArrow.java b/src/main/java/ch/njol/skript/expressions/ExprReadiedArrow.java index 2d405d62ff4..9cd6a697d1e 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprReadiedArrow.java +++ b/src/main/java/ch/njol/skript/expressions/ExprReadiedArrow.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Events; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,12 +18,12 @@ @Name("Readied Arrow/Bow") @Description("The bow or arrow in a Ready Arrow event.") -@Examples({ - "on player ready arrow:", - "\tselected bow's name is \"Spectral Bow\"", - "\tif selected arrow is not a spectral arrow:", - "\t\tcancel event" -}) +@Example(""" + on player ready arrow: + selected bow's name is "Spectral Bow" + if selected arrow is not a spectral arrow: + cancel event + """) @Since("2.8.0") @Events("ready arrow") public class ExprReadiedArrow extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRedstoneBlockPower.java b/src/main/java/ch/njol/skript/expressions/ExprRedstoneBlockPower.java index 4e6538dbff1..ecb343d4a20 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRedstoneBlockPower.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRedstoneBlockPower.java @@ -2,15 +2,17 @@ import org.bukkit.block.Block; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @Name("Redstone Block Power") @Description("Power of a redstone block") -@Examples({"if redstone power of targeted block is 15:", - "\tsend \"This block is very powerful!\""}) +@Example(""" + if redstone power of targeted block is 15: + send "This block is very powerful!" + """) @Since("2.5") public class ExprRedstoneBlockPower extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRemainingAir.java b/src/main/java/ch/njol/skript/expressions/ExprRemainingAir.java index 9c2d5f0e036..6ca21cd812c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRemainingAir.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRemainingAir.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -15,10 +15,10 @@ @Name("Remaining Air") @Description("How much time a player has left underwater before starting to drown.") -@Examples({ - "if the player's remaining air is less than 3 seconds:", - "\tsend \"hurry, get to the surface!\" to the player" -}) +@Example(""" + if the player's remaining air is less than 3 seconds: + send "hurry, get to the surface!" to the player + """) @Since("2.0") public class ExprRemainingAir extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRepeat.java b/src/main/java/ch/njol/skript/expressions/ExprRepeat.java index b23d90d0ab7..96207bd294a 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRepeat.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRepeat.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -18,12 +18,12 @@ @Name("Repeat String") @Description("Repeats inputted strings a given amount of times.") -@Examples({ - "broadcast nl and nl repeated 200 times", - "broadcast \"Hello World \" repeated 5 times", - "if \"aa\" repeated 2 times is \"aaaa\":", - "\tbroadcast \"Ahhhh\" repeated 100 times" -}) +@Example(""" + broadcast nl and nl repeated 200 times + broadcast "Hello World " repeated 5 times + if "aa" repeated 2 times is "aaaa": + broadcast "Ahhhh" repeated 100 times + """) @Since("2.8.0") public class ExprRepeat extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprResonatingTime.java b/src/main/java/ch/njol/skript/expressions/ExprResonatingTime.java index a3563569e65..4a6c637c78b 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprResonatingTime.java +++ b/src/main/java/ch/njol/skript/expressions/ExprResonatingTime.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,7 +16,7 @@ "Returns the resonating time of a bell.", "A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks." }) -@Examples("broadcast \"The bell has been resonating for %resonating time of target block%\"") +@Example("broadcast \"The bell has been resonating for %resonating time of target block%\"") @Since("2.9.0") public class ExprResonatingTime extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRespawnLocation.java b/src/main/java/ch/njol/skript/expressions/ExprRespawnLocation.java index f90fc8e9ac9..ba480d51225 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRespawnLocation.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRespawnLocation.java @@ -9,7 +9,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -22,8 +22,10 @@ @Name("Respawn location") @Description("The location that a player should respawn at. This is used within the respawn event.") -@Examples({"on respawn:", - " set respawn location to {example::spawn}"}) +@Example(""" + on respawn: + set respawn location to {example::spawn} + """) @Since("2.2-dev35") public class ExprRespawnLocation extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprResult.java b/src/main/java/ch/njol/skript/expressions/ExprResult.java index 8cce7c62ef3..cd8099bea19 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprResult.java +++ b/src/main/java/ch/njol/skript/expressions/ExprResult.java @@ -21,12 +21,10 @@ "Runs something (like a function) and returns its result.", "If the thing is expected to return multiple values, use 'results' instead of 'result'." }) -@Examples({ - "set {_function} to the function named \"myFunction\"", - "set {_result} to the result of {_function}", - "set {_list::*} to the results of {_function}", - "set {_result} to the result of {_function} with arguments 13 and true" -}) +@Example("set {_function} to the function named \"myFunction\"") +@Example("set {_result} to the result of {_function}") +@Example("set {_list::*} to the results of {_function}") +@Example("set {_result} to the result of {_function} with arguments 13 and true") @Since("2.10") @Keywords({"run", "result", "execute", "function", "reflection"}) public class ExprResult extends PropertyExpression, Object> implements ReflectionExperimentSyntax { diff --git a/src/main/java/ch/njol/skript/expressions/ExprReversedList.java b/src/main/java/ch/njol/skript/expressions/ExprReversedList.java index bf1d65b3f86..5861ea6fa84 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprReversedList.java +++ b/src/main/java/ch/njol/skript/expressions/ExprReversedList.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -21,7 +21,7 @@ @Name("Reversed List") @Description("Reverses given list.") -@Examples({"set {_list::*} to reversed {_list::*}"}) +@Example("set {_list::*} to reversed {_list::*}") @Since("2.4") public class ExprReversedList extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRingingTime.java b/src/main/java/ch/njol/skript/expressions/ExprRingingTime.java index f17330e228f..0737689213c 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRingingTime.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRingingTime.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -16,7 +16,7 @@ "Returns the ringing time of a bell.", "A bell typically rings for 50 game ticks." }) -@Examples("broadcast \"The bell has been ringing for %ringing time of target block%\"") +@Example("broadcast \"The bell has been ringing for %ringing time of target block%\"") @Since("2.9.0") public class ExprRingingTime extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprRound.java b/src/main/java/ch/njol/skript/expressions/ExprRound.java index d547432fa83..a68734565a0 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprRound.java +++ b/src/main/java/ch/njol/skript/expressions/ExprRound.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.PropertyExpression; @@ -20,11 +20,9 @@ @Name("Rounding") @Description("Rounds numbers normally, up (ceiling) or down (floor) respectively.") -@Examples({ - "set {var} to rounded health of player", - "set line 1 of the block to rounded \"%(1.5 * player's level)%\"", - "add rounded down argument to the player's health" -}) +@Example("set {var} to rounded health of player") +@Example("set line 1 of the block to \"%rounded (1.5 * player's level)%\"") +@Example("add rounded down argument to the player's health") @Since("2.0") public class ExprRound extends PropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprSaturation.java b/src/main/java/ch/njol/skript/expressions/ExprSaturation.java index c5eb5a9a1f4..82c1f8a2400 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprSaturation.java +++ b/src/main/java/ch/njol/skript/expressions/ExprSaturation.java @@ -3,7 +3,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.expressions.base.SimplePropertyExpression; @@ -14,7 +14,7 @@ @Name("Saturation") @Description("The saturation of a player. If used in a player event, it can be omitted and will default to event-player.") -@Examples("set saturation of player to 20") +@Example("set saturation of player to 20") @Since("2.2-Fixes-v10, 2.2-dev35 (fully modifiable), 2.6.2 (syntax pattern changed)") public class ExprSaturation extends SimplePropertyExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprScoreboardTags.java b/src/main/java/ch/njol/skript/expressions/ExprScoreboardTags.java index 1890d5d3429..6d8dcd60030 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprScoreboardTags.java +++ b/src/main/java/ch/njol/skript/expressions/ExprScoreboardTags.java @@ -10,7 +10,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer.ChangeMode; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -28,14 +28,16 @@ "Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.", "", "Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot)."}) -@Examples({"on spawn of a monster:", - "\tif the spawn reason is mob spawner:", - "\t\tadd \"spawned by a spawner\" to the scoreboard tags of event-entity", - "", - "on death of a monster:", - "\tif the attacker is a player:", - "\t\tif the victim doesn't have the scoreboard tag \"spawned by a spawner\":", - "\t\t\tadd 1$ to attacker's balance"}) +@Example(""" + on spawn of a monster: + if the spawn reason is mob spawner: + add "spawned by a spawner" to the scoreboard tags of event-entity + + on death of a monster: + if the attacker is a player: + if the victim doesn't have the scoreboard tag "spawned by a spawner": + add 1$ to attacker's balance + """) @Since("2.3") public class ExprScoreboardTags extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/expressions/ExprScript.java b/src/main/java/ch/njol/skript/expressions/ExprScript.java index c217a5e5847..583e1e2ad27 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprScript.java +++ b/src/main/java/ch/njol/skript/expressions/ExprScript.java @@ -3,7 +3,7 @@ import ch.njol.skript.ScriptLoader; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; -import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Example; import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Since; import ch.njol.skript.lang.Expression; @@ -26,17 +26,23 @@ @Description({"The current script, or a script from its (file) name.", "If the script is enabled or disabled (or reloaded) this reference will become invalid.", "Therefore, it is recommended to obtain a script reference when needed."}) -@Examples({ - "on script load:", - "\tbroadcast \"Loaded %the current script%\"", - "on script load:", - "\tset {running::%script%} to true", - "on script unload:", - "\tset {running::%script%} to false", - "set {script} to the script named \"weather.sk\"", - "loop the scripts in directory \"quests/\":", - "\tenable loop-value" -}) +@Example(""" + on script load: + broadcast "Loaded %the current script%" + """) +@Example(""" + on script load: + set {running::%script%} to true + """) +@Example(""" + on script unload: + set {running::%script%} to false + """) +@Example("set {script} to the script named \"weather.sk\"") +@Example(""" + loop the scripts in directory "quests/": + enable loop-value + """) @Since("2.0") public class ExprScript extends SimpleExpression