Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public class SkriptUtils {
* @return True if parsed correctly else false
*/
public static boolean parseEffect(String stringEffect, CommandSender sender, Event parentEvent) {
Effect effect = Effect.parse(stringEffect, null);
if (effect == null) return false;

Event newEvent = new EffectCommandEvent(sender, stringEffect);
ParserInstance parserInstance = ParserInstance.get();
parserInstance.setCurrentEvent("effect command", EffectCommandEvent.class);

Effect effect = Effect.parse(stringEffect, null);
if (effect == null) return false;

AtomicBoolean parsed = new AtomicBoolean(false);
Variables.withLocalVariables(parentEvent, newEvent, () -> parsed.set(TriggerItem.walk(effect, newEvent)));
parserInstance.deleteCurrentEvent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ch.njol.util.Math2;
import com.github.shanebeee.skr.Registration;
import com.shanebeestudios.skbee.api.registry.KeyUtils;
import com.shanebeestudios.skbee.api.util.Util;
import io.papermc.paper.datacomponent.DataComponentType;
import io.papermc.paper.datacomponent.item.consumable.ConsumeEffect;
import io.papermc.paper.datacomponent.item.consumable.ConsumeEffect.ApplyStatusEffects;
Expand Down Expand Up @@ -60,7 +61,8 @@ public String toVariableNameString(ConsumeEffect consumeEffect) {
.user("data ?component ?types?")
.name("Data Component Type")
.description("Represents the different types of data components.",
"See [**Data Components**](https://minecraft.wiki/w/Data_component_format#List_of_components) on McWiki for more detailed info.")
"See [**Data Components**](https://minecraft.wiki/w/Data_component_format#List_of_components) on McWiki for more detailed info.",
Util.AUTO_GEN_NOTE)
.since("3.11.0")
.register();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
public class ExprKnockbackAttackerVictim extends SimpleExpression<Entity> implements EventRestrictedSyntax {

public static void register(Registration reg) {
reg.newSimpleExpression(ExprKnockbackAttackerVictim.class, Entity.class, "simple",
"[the] knockback (:attacker|victim)")
.name("Knockback Attacker/Victim")
.description("The attacker/victim in an entity knockback event.")
.examples("on entity knockback:",
"\tif knockback attacker is a player:",
"\t\tif knockback victim is a sheep:",
"\t\t\tcancel event")
.since("1.8.0")
.register();
reg.newSimpleExpression(ExprKnockbackAttackerVictim.class, Entity.class,
"[the] knockback (:attacker|victim)")
.name("Knockback Attacker/Victim")
.description("The attacker/victim in an entity knockback event.")
.examples("on entity knockback:",
"\tif knockback attacker is a player:",
"\t\tif knockback victim is a sheep:",
"\t\t\tcancel event")
.since("1.8.0")
.register();
}

private boolean useAttacker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
public class ExprKnockbackVelocity extends SimpleExpression<Vector> implements EventRestrictedSyntax {

public static void register(Registration reg) {
reg.newSimpleExpression(ExprKnockbackVelocity.class, Vector.class, "simple",
"[the] knockback velocity")
.name("Knockback Velocity")
.description("The knockback velocity in an entity knockback event.")
.examples("on entity knockback:",
"\tset knockback velocity to knockback velocity * -1")
.since("3.16.0")
.register();
reg.newSimpleExpression(ExprKnockbackVelocity.class, Vector.class,
"[the] knockback velocity")
.name("Knockback Velocity")
.description("The knockback velocity in an entity knockback event.")
.examples("on entity knockback:",
"\tset knockback velocity to knockback velocity * -1")
.since("3.16.0")
.register();
}

@Override
Expand Down
Loading