Skip to content
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/main/java/ch/njol/skript/conditions/CondAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<LivingEntity> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

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;
import org.bukkit.entity.LivingEntity;

@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<LivingEntity> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ch/njol/skript/conditions/CondCanFly.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Player> {

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ch/njol/skript/conditions/CondCanHold.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down
19 changes: 10 additions & 9 deletions src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<LivingEntity> {

Expand Down
15 changes: 8 additions & 7 deletions src/main/java/ch/njol/skript/conditions/CondCanSee.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/ch/njol/skript/conditions/CondCancelled.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/ch/njol/skript/conditions/CondChance.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/ch/njol/skript/conditions/CondChatColors.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <red>this<reset> message.\"",
"else:",
"\tsend \"You cannot partake in finding the colored word.\""
})
@Example("""
if player can see chat colors:
send "Find the red word in <red>this<reset> message."
else:
send "You cannot partake in finding the colored word."
""")
@Since("2.10")
public class CondChatColors extends PropertyCondition<Player> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \"<gray>This server may contain mature chat messages. You have been warned!\" to player",
})

@Example("""
if player doesn't have chat filtering enabled:
send "<gray>This server may contain mature chat messages. You have been warned!" to player
""")
@Since("2.10")
public class CondChatFiltering extends PropertyCondition<Player> {

Expand Down
20 changes: 12 additions & 8 deletions src/main/java/ch/njol/skript/conditions/CondChatVisibility.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ch/njol/skript/conditions/CondCompare.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 <code>(was|were)</code> or <code>will be</code> instead of <code>(is|are)</code> respectively, " +
"which check different <a href='#ExprTimeState'>time states</a> 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 {

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ch/njol/skript/conditions/CondContains.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
32 changes: 18 additions & 14 deletions src/main/java/ch/njol/skript/conditions/CondDamageCause.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -20,19 +20,23 @@
*/
@Name("Damage Cause")
@Description("Tests what kind of damage caused a <a href='#damage'>damage event</a>. Refer to the <a href='#damagecause'>Damage Cause</a> 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 {

Expand Down
Loading