Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ef781fb
Removes entitytoggleglideevent from simplevents removes boolean expre…
AnOwlBe Apr 23, 2026
1acc1c8
Fix SimpleEvents
AnOwlBe Apr 23, 2026
3339cb1
Fix SimpleEvents attempt #2
AnOwlBe Apr 23, 2026
9f1a0ab
Implemented suggestions
AnOwlBe Apr 25, 2026
40a2b98
Implemented syntax change
AnOwlBe Apr 25, 2026
0c1acee
Changes ExprGlidingState.java from deletion to deprecated
AnOwlBe Apr 26, 2026
7857ac4
Update src/main/java/ch/njol/skript/expressions/ExprGlidingState.java
AnOwlBe Apr 28, 2026
eca4427
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe Apr 28, 2026
d9bf39d
Warning message for ExprGlidingState
AnOwlBe Apr 28, 2026
bf44c32
Update src/main/java/ch/njol/skript/expressions/ExprGlidingState.java
AnOwlBe Apr 29, 2026
e869391
Some fixes
AnOwlBe Apr 29, 2026
be3cef5
Merge remote-tracking branch 'origin/feature/EvtGlideStateChange' int…
AnOwlBe Apr 29, 2026
59b8d6a
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe Apr 29, 2026
ba1c283
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe Apr 29, 2026
6b3a176
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe Apr 29, 2026
7a637c0
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe May 5, 2026
40b81ab
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe May 5, 2026
2e2bb33
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe May 5, 2026
730a7a6
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe May 5, 2026
53d0bc1
Changes to printing deprecation warning
AnOwlBe May 5, 2026
36afed3
Merge remote-tracking branch 'origin/feature/EvtGlideStateChange' int…
AnOwlBe May 5, 2026
75a5e9c
Merge branch 'dev/feature' into feature/EvtGlideStateChange
AnOwlBe May 7, 2026
a3d0e30
Merge branch 'dev/feature' into feature/EvtGlideStateChange
AnOwlBe May 8, 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
5 changes: 0 additions & 5 deletions src/main/java/ch/njol/skript/events/SimpleEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,6 @@ public class SimpleEvents {
}
}

Skript.registerEvent("Gliding State Change", SimpleEvent.class, EntityToggleGlideEvent.class, "(gliding state change|toggl(e|ing) gliding)")
.description("Called when an entity toggles glider on or off, or when server toggles gliding state of an entity forcibly.")
.examples("on toggling gliding:",
" cancel the event # bad idea, but you CAN do it!")
.since("2.2-dev21");
Skript.registerEvent("AoE Cloud Effect", SimpleEvent.class, AreaEffectCloudApplyEvent.class, "(area|AoE) [cloud] effect")
.description("Called when area effect cloud applies its potion effect. This happens every 5 ticks by default.")
.examples("on area cloud effect:")
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.LivingEntity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand All @@ -16,12 +19,17 @@
@Description("Sets of gets gliding state of player. It allows you to set gliding state of entity even if they do not have an <a href=\"https://minecraft.wiki/w/Elytra\">Elytra</a> equipped.")
@Example("set gliding of player to off")
@Since("2.2-dev21")
@Deprecated(since = "INSERT VERSION", forRemoval = true)
public class ExprGlidingState extends SimplePropertyExpression<LivingEntity, Boolean> {

static {
register(ExprGlidingState.class, Boolean.class, "(gliding|glider) [state]", "livingentities");
}

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
Skript.warning("This expression is deprecated. Consider using the glide effect instead.");
Comment thread
AnOwlBe marked this conversation as resolved.
Outdated
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}
@Override
public Boolean convert(final LivingEntity e) {
return e.isGliding();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

import ch.njol.skript.Skript;
import ch.njol.skript.entity.SimpleEntityData;
import ch.njol.skript.lang.util.SimpleEvent;
import org.bukkit.entity.AbstractNautilus;
import org.bukkit.event.entity.EntityToggleGlideEvent;
import org.skriptlang.skript.addon.AddonModule;
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.effects.EffGlide;
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;
import org.skriptlang.skript.bukkit.entity.entitydata.ZombieNautilusData;
import org.skriptlang.skript.bukkit.entity.player.PlayerModule;
import org.skriptlang.skript.bukkit.registration.BukkitSyntaxInfos;
import org.skriptlang.skript.registration.SyntaxRegistry;

import java.util.List;

Expand All @@ -36,9 +41,25 @@ protected void loadSelf(SkriptAddon addon) {
ZombieNautilusData.register();
SimpleEntityData.addSuperEntity("any nautilus", AbstractNautilus.class);
}

SyntaxRegistry syntaxRegistry = moduleRegistry(addon);
syntaxRegistry.register(BukkitSyntaxInfos.Event.KEY, BukkitSyntaxInfos.Event.builder(SimpleEvent.class, "Toggle Glide")
.addDescription("Called when an entity starts or stops gliding, or when the server toggles the gliding state of an entity forcibly.")
.addExample("""
on toggling gliding:
cancel the event # bad idea, but you CAN do it!
""")
.addSince("2.2-dev21")
.addSince("INSERT VERSION","Pattern changed")
Comment thread
AnOwlBe marked this conversation as resolved.
Outdated
.addPatterns(
"[on] gliding state change[d]",
"[on] (toggle|toggling) glid(e|ing)",
"[on] glid(e|ing) toggl(e|d)"
Comment thread
AnOwlBe marked this conversation as resolved.
Outdated
)
.addEvent(EntityToggleGlideEvent.class)
.build());
register(addon,
ExprDeathMessage::register
ExprDeathMessage::register,
EffGlide::register
);
}

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

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.Effect;
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.LivingEntity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.registration.SyntaxInfo;
import org.skriptlang.skript.registration.SyntaxRegistry;

@Name("Make Entity Glide")
@Description("""
Makes an entity start/stop gliding if they have an elytra or a chestplate with a glider component. If the entity has neither, the state of the entity will flicker for 1 tick.
""")
Comment thread
AnOwlBe marked this conversation as resolved.
Outdated
@Example("make last spawned zombie start gliding")
@Since("INSERT VERSION")
public class EffGlide extends Effect {

public static void register(SyntaxRegistry registry) {
registry.register(
SyntaxRegistry.EFFECT,
SyntaxInfo.builder(EffGlide.class)
.addPatterns(
"make %livingentities% ((start|begin) gliding|glide)",
"make %livingentities% (stop[ ]gliding|no longer glide)"
Comment thread
AnOwlBe marked this conversation as resolved.
Outdated
)
.supplier(EffGlide::new)
.build()
);
}

private Expression<LivingEntity> entities;
private boolean negated;

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
entities = (Expression<LivingEntity>) expressions[0];
negated = matchedPattern == 1;
return true;
}

@Override
protected void execute(Event event) {
for (LivingEntity entity : entities.getArray(event)) {
entity.setGliding(!negated);
}
}

@Override
public String toString(@Nullable Event event, boolean debug) {
return new SyntaxStringBuilder(event, debug)
.append("make", entities)
.appendIf(negated, "not")
.append("glide")
.toString();
}

}
Comment thread
AnOwlBe marked this conversation as resolved.

Comment thread
AnOwlBe marked this conversation as resolved.
Loading