Skip to content

Syntax conflict with potion effect #5117

Description

@Romitou

Skript/Server Version

[18:52:36 INFO]: [Skript] Server Version: git-Paper-42 (MC: 1.18)
[18:52:36 INFO]: [Skript] Skript Version: 2.6.3 (selfbuilt-unknown)
[18:52:36 INFO]: [Skript] Installed Skript Addons:
[18:52:36 INFO]: [Skript] Installed dependencies: None

Bug Description

Using the apply %potioneffects% to %livingentities% effect is impossible: another pattern is matched instead of the one it should have been.

According to the EffPotion class, four patterns are registered:

  • apply [potion of] %potioneffecttypes% [potion] [[[of] tier] %-number%] to %livingentities% [for %-timespan%] [(1¦replacing [the] existing effect)]
  • apply ambient [potion of] %potioneffecttypes% [potion] [[[of] tier] %-number%] to %livingentities% [for %-timespan%] [(1¦replacing [the] existing effect)]
  • apply [potion of] %potioneffecttypes% [potion] [[[of] tier] %-number%] without [any] particles to %livingentities% [for %-timespan%] [(1¦replacing [the] existing effect)]
  • apply %potioneffects% to %livingentities%

Expected Behavior

The expected behaviour is that the fourth pattern is matched, except that the first is matched.

Steps to Reproduce

command /potion:
    trigger:
        set {_potion} to potion effect of slowness of tier 5 for 10 seconds
        apply {_potion} to player

The apply {_potion} to player effect is not effective because it matches the syntax apply [potion of] %potioneffecttypes% [potion] [[[of] tier] %-number%] to %livingentities% [for %-timespan%] [(1¦replacing [the] existing effect)].
https://github.com/SkriptLang/Skript/blob/master/src/main/java/ch/njol/skript/effects/EffPotion.java#L53

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.completedThe issue has been fully resolved and the change will be in the next Skript update.priority: lowIssues that are not harmful to the experience but are related to useful changes or additions.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions