Skip to content
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
189cf10
Create AI effect and mark AI expression as deprecated
Phill310 May 2, 2026
c6c2fda
Create glowing effect and condition. Mark glow expression as deprecated
Phill310 May 2, 2026
954e54f
Create gravity effect. Mark gravity expression as deprecated
Phill310 May 2, 2026
bb3502f
Create projectile critical state effect and condition. Mark projectil…
Phill310 May 2, 2026
6a360c1
Register new syntax
Phill310 May 2, 2026
d9b262c
Add runtime warning when effect is used on a non-compatible projectile
Phill310 May 2, 2026
1436588
Use entity instead of living entity everywhere
Phill310 May 2, 2026
d8aa095
Allow deprecation warning to be suppressed
Phill310 May 5, 2026
7febfff
Improve syntax
Phill310 May 5, 2026
1fbf996
Merge branch 'dev/feature' into deprecate-boolean-expressions
Phill310 May 5, 2026
9246dbc
Use the infoBuilder and allow for multiple projectiles
Phill310 May 8, 2026
6c94d5c
Allow all entities to glow instead of just living entities
Phill310 May 8, 2026
b6343a0
Add condition for gravity
Phill310 May 8, 2026
6952919
Add tests
Phill310 May 8, 2026
baf6468
Merge remote-tracking branch 'upstream/dev/feature' into deprecate-bo…
Phill310 May 8, 2026
c4725a1
Merge remote-tracking branch 'origin/deprecate-boolean-expressions' i…
Phill310 May 8, 2026
e7cc66b
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
Phill310 May 9, 2026
d7380d2
Improve description
Phill310 May 9, 2026
63f0610
Merge remote-tracking branch 'origin/deprecate-boolean-expressions' i…
Phill310 May 9, 2026
15dd43d
Deprecate Flight Mode expression
Phill310 May 9, 2026
42c84c6
Apply suggestions from code review
Phill310 May 9, 2026
6510462
Make deprecation messages more forceful
Phill310 Jun 2, 2026
da5660c
Make syntax simpler
Phill310 Jun 2, 2026
9b7f7fe
Improve Description
Phill310 Jun 2, 2026
2b850d7
Remove redundant innit
Phill310 Jun 2, 2026
4bfc25a
import ParseResult from skriptparser
Phill310 Jun 2, 2026
20a4204
Update to reflect new syntax
Phill310 Jun 2, 2026
eddabb4
Clean up imports
Phill310 Jun 2, 2026
35423a8
Include the projectile in the runtime error
Phill310 Jun 2, 2026
4e6a6e4
Improve description
Phill310 Jun 2, 2026
d585281
Improve description
Phill310 Jun 2, 2026
0edbe1f
Make gravity use experiences for its syntax
Phill310 Jun 2, 2026
3e3093d
Merge branch 'dev/feature' into deprecate-boolean-expressions
Phill310 Jun 2, 2026
adf580f
Update example
Phill310 Jun 2, 2026
04b75c8
Merge remote-tracking branch 'origin/deprecate-boolean-expressions' i…
Phill310 Jun 2, 2026
452ebb3
Make sure the runtime error works
Phill310 Jun 2, 2026
fba035c
Add deprecation message to description
Phill310 Jun 10, 2026
7d70146
Merge branch 'dev/feature' into deprecate-boolean-expressions
Phill310 Jun 10, 2026
23ee712
Apply suggestions from code review
Phill310 Jun 10, 2026
204addc
add [the] to syntax
Phill310 Jun 10, 2026
5cd15ee
Use the user's input to make a working example in the deprecation mes…
Phill310 Jun 15, 2026
54d2dcf
Use property condition
Phill310 Jun 15, 2026
9e3a154
Make toString match the pattern
Phill310 Jun 15, 2026
006f24f
Move tests to their own module
Phill310 Jun 15, 2026
468dd76
Add toggle mode to syntax
Phill310 Jun 15, 2026
89c0b82
Merge branch 'dev/feature' into deprecate-boolean-expressions
Phill310 Jun 15, 2026
5e02e59
Add toggle mode to syntax
Phill310 Jun 15, 2026
abb4db0
Remove toggle syntax since this will be handled by whether
Phill310 Jun 23, 2026
e788da9
Use isNegated() instead of a constant False
Phill310 Jun 23, 2026
5a74d49
Merge branch 'dev/feature' into deprecate-boolean-expressions
Phill310 Jun 23, 2026
71f7528
Merge branch 'dev/feature' into deprecate-boolean-expressions
Phill310 Aug 15, 2026
bc58d2d
Fix indentation
Phill310 Aug 15, 2026
5a56190
Fix example
Phill310 Aug 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/main/java/ch/njol/skript/conditions/CondAI.java

This file was deleted.

13 changes: 12 additions & 1 deletion src/main/java/ch/njol/skript/expressions/ExprAI.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package ch.njol.skript.expressions;

import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand All @@ -11,16 +14,24 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.expressions.base.SimplePropertyExpression;
import ch.njol.util.coll.CollectionUtils;
import org.skriptlang.skript.lang.script.ScriptWarning;

@Name("Entity AI")
@Description("Returns whether an entity has AI.")
@Description("Returns whether an entity has AI. This expression is deprecated and will be removed in a future version. Use the <a href='#EffAI'>Entity AI</a> effect instead.")
@Example("set artificial intelligence of target entity to false")
@Since("2.5")
@Deprecated(since = "INSERT VERSION", forRemoval = true)
public class ExprAI extends SimplePropertyExpression<LivingEntity, Boolean> {

static {
register(ExprAI.class, Boolean.class, "(ai|artificial intelligence)", "livingentities");
}

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
ScriptWarning.printDeprecationWarning("This expression is deprecated and will be removed in a future version. Use the AI effect instead: 'enable ai for %livingentities%'.");
Comment thread
Phill310 marked this conversation as resolved.
Outdated
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}

@Override
@Nullable
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/ch/njol/skript/expressions/ExprFlightMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,33 @@
import ch.njol.skript.doc.Name;
import ch.njol.skript.doc.Since;
import ch.njol.skript.expressions.base.SimplePropertyExpression;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.lang.script.ScriptWarning;

@Name("Flight Mode")
@Description("Whether the player(s) are allowed to fly. Use <a href=#EffMakeFly>Make Fly</a> effect to force player(s) to fly.")
@Description("Whether the player(s) are allowed to fly. This expression is deprecated and will be removed in a future version. Use <a href=#EffMakeFly>Make Fly</a> effect to force player(s) to fly instead.")
@Example("set flight mode of player to true")
@Example("send \"%flying state of all players%\"")
@Since("2.2-dev34")
@Deprecated(since = "INSERT VERSION", forRemoval = true)
public class ExprFlightMode extends SimplePropertyExpression<Player, Boolean> {

static {
register(ExprFlightMode.class, Boolean.class, "fl(y[ing]|ight) (mode|state)", "players");
}

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
ScriptWarning.printDeprecationWarning("This expression is deprecated and will be removed in a future version. Use the Make Fly effect instead: 'make %players% fly'");
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}

@Override
public Boolean convert(final Player player) {
return player.getAllowFlight();
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/ch/njol/skript/expressions/ExprGlowing.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package ch.njol.skript.expressions;

import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand All @@ -10,16 +13,24 @@
import ch.njol.skript.doc.Name;
import ch.njol.skript.doc.Since;
import ch.njol.skript.expressions.base.SimplePropertyExpression;
import org.skriptlang.skript.lang.script.ScriptWarning;

@Name("Glowing")
@Description("Indicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls.")
@Description("Indicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls. This expression is deprecated and will be removed in a future version. Use the <a href='#EffGlowing'>Entity Glow/a> effect instead.")
@Example("set glowing of player to true")
@Since("2.2-dev18")
@Deprecated(since = "INSERT VERSION", forRemoval = true)
public class ExprGlowing extends SimplePropertyExpression<Entity, Boolean> {

static {
register(ExprGlowing.class, Boolean.class, "glowing", "entities");
}

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
ScriptWarning.printDeprecationWarning("This expression is deprecated and will be removed in a future version. Use the glowing effect instead: 'make %entities% glow'");
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}

@Override
public Boolean convert(final Entity e) {
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/ch/njol/skript/expressions/ExprGravity.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
package ch.njol.skript.expressions;

import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.classes.Changer.ChangeMode;
import ch.njol.skript.doc.Description;
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;
import org.skriptlang.skript.lang.script.ScriptWarning;

@Name("Gravity")
@Description("If entity is affected by gravity or not, i.e. if it has Minecraft 1.10+ NoGravity flag.")
@Description("If entity is affected by gravity or not, i.e. if it has Minecraft 1.10+ NoGravity flag. This expression is deprecated and will be removed in a future version. Use the <a href='#EffGravity'>Entity Gravity</a> effect instead.")
@Example("set gravity of player off")
Comment thread
Phill310 marked this conversation as resolved.
Outdated
@Since("2.2-dev21")
@Deprecated(since = "INSERT VERSION", forRemoval = true)
public class ExprGravity extends SimplePropertyExpression<Entity, Boolean> {

static {
register(ExprGravity.class, Boolean.class, "gravity", "entities");
}

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
ScriptWarning.printDeprecationWarning("This expression is deprecated and will be removed in a future version. Use the gravity effect instead: 'enable gravity of %entities%'");
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}

@Override
public Boolean convert(final Entity e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package ch.njol.skript.expressions;

import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Projectile;
Expand All @@ -14,22 +17,30 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.expressions.base.SimplePropertyExpression;
import ch.njol.util.coll.CollectionUtils;
import org.skriptlang.skript.lang.script.ScriptWarning;

@Name("Projectile Critical State")
@Description("A projectile's critical state. The only currently accepted projectiles are arrows and tridents.")
@Description("A projectile's critical state. The only currently accepted projectiles are arrows and tridents. This expression is deprecated and will be removed in a future version. Use the <a href='#EffProjectileCriticalState'>Projectile Critical State</a> effect instead.")
@Example("""
on shoot:
event-projectile is an arrow
set projectile critical mode of event-projectile to true
""")
@Since("2.5.1")
@Deprecated(since = "INSERT VERSION", forRemoval = true)
public class ExprProjectileCriticalState extends SimplePropertyExpression<Projectile, Boolean> {

private static final boolean abstractArrowExists = Skript.classExists("org.bukkit.entity.AbstractArrow");

static {
register(ExprProjectileCriticalState.class, Boolean.class, "(projectile|arrow) critical (state|ability|mode)", "projectiles");
}

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
ScriptWarning.printDeprecationWarning("This expression is deprecated and will be removed in a future version. Use the projectile critical state effect instead: 'make %projectiles% crit'");
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}

@Nullable
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
import org.skriptlang.skript.addon.HierarchicalAddonModule;
import org.skriptlang.skript.addon.SkriptAddon;
import org.skriptlang.skript.bukkit.entity.displays.DisplayModule;
import org.skriptlang.skript.bukkit.entity.elements.conditions.CondAI;
import org.skriptlang.skript.bukkit.entity.elements.conditions.CondGravity;
import org.skriptlang.skript.bukkit.entity.elements.conditions.CondIsGlowing;
import org.skriptlang.skript.bukkit.entity.elements.conditions.CondProjectileIsCritical;
import org.skriptlang.skript.bukkit.entity.elements.effects.EffAI;
import org.skriptlang.skript.bukkit.entity.elements.effects.EffGlowing;
import org.skriptlang.skript.bukkit.entity.elements.effects.EffGravity;
import org.skriptlang.skript.bukkit.entity.elements.effects.EffProjectileCriticalState;
import org.skriptlang.skript.bukkit.entity.interactions.InteractionModule;
import org.skriptlang.skript.bukkit.entity.elements.expressions.ExprDeathMessage;
import org.skriptlang.skript.bukkit.entity.entitydata.NautilusData;
Expand Down Expand Up @@ -38,6 +46,16 @@ protected void loadSelf(SkriptAddon addon) {
}

register(addon,
CondAI::register,
CondGravity::register,
CondIsGlowing::register,
CondProjectileIsCritical::register,

EffAI::register,
EffGlowing::register,
EffGravity::register,
EffProjectileCriticalState::register,

ExprDeathMessage::register
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package org.skriptlang.skript.bukkit.entity.elements.conditions;

import org.bukkit.entity.LivingEntity;

import ch.njol.skript.conditions.base.PropertyCondition;
import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Example;
import ch.njol.skript.doc.Name;
import ch.njol.skript.doc.Since;
import org.skriptlang.skript.registration.SyntaxRegistry;

@Name("Has AI")
@Description(
"Check whether an entity has AI. Entities without AI will not try to attack " +
"other entities and will not be able to move at all. This includes knockback " +
"from getting hit, falling due to gravity, getting pushed by entities/water, " +
"changing velocity with commands and any other form of movement. Accumulated " +
"knockback and velocity changes will be applied when ai is enabled again."
)
@Example("target entity has ai")
@Since("2.5")
public class CondAI extends PropertyCondition<LivingEntity> {

public static void register(SyntaxRegistry registry) {
registry.register(
SyntaxRegistry.CONDITION,
infoBuilder(
CondAI.class,
PropertyType.HAVE,
"(ai|artificial intelligence)",
"livingentities"
)
.supplier(CondAI::new)
.build()
);
}

@Override
public boolean check(LivingEntity entity) {
return entity.hasAI();
}

@Override
protected PropertyType getPropertyType() {
return PropertyType.HAVE;
}

@Override
protected String getPropertyName() {
return "artificial intelligence";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package org.skriptlang.skript.bukkit.entity.elements.conditions;

import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Example;
import ch.njol.skript.doc.Name;
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.SyntaxStringBuilder;
import ch.njol.util.Kleenean;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.registration.SyntaxInfo;
import org.skriptlang.skript.registration.SyntaxRegistry;

@Name("Experiences Gravity")
@Description(
"Change whether an entity is affected by gravity. This will override any effects " +
"from the gravity attribute or potions like slow falling."
)
@Example("send whether player experiences gravity")
@Since("INSERT VERSION")
public class CondGravity extends Condition {
Comment thread
Phill310 marked this conversation as resolved.
Outdated

public static void register(SyntaxRegistry registry) {
registry.register(
SyntaxRegistry.CONDITION,
SyntaxInfo.builder(CondGravity.class)
.addPatterns(
"%entities% experience[s] gravity",
"%entities% (doesn't|does not|do not|don't) experience gravity",
"%entities% (is|are) affected by gravity",
"%entities% (isn't|is not|aren't|are not) affected by gravity"
Comment thread
Phill310 marked this conversation as resolved.
Outdated
)
.supplier(CondGravity::new)
.build()
);
}

private Expression<Entity> entities;

@Override
public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
Comment thread
Phill310 marked this conversation as resolved.
Outdated
//noinspection unchecked
entities = (Expression<Entity>) exprs[0];
setNegated(matchedPattern % 2 == 1);
return true;
}

@Override
public boolean check(Event event) {
return entities.check(event, Entity::hasGravity, isNegated());
}

@Override
public String toString(final @Nullable Event event, final boolean debug) {
Comment thread
Phill310 marked this conversation as resolved.
Outdated
return new SyntaxStringBuilder(event, debug)
.append(entities)
.appendIf(isNegated(), "do not")
.append("experience gravity")
.toString();
}

}
Loading