SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 370 forks source link

Bug Report: About Region + Consume Potion #6469

Open Panic-exe opened 7 months ago

Panic-exe commented 7 months ago

Skript/Server Version

[04:20:55 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[04:20:55 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[04:20:55 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[04:20:55 INFO]: [Skript] Server Version: git-Paper-393 (MC: 1.20.4)
[04:20:55 INFO]: [Skript] Skript Version: 2.8.2 (skriptlang-github)
[04:20:55 INFO]: [Skript] Installed Skript Addons: 
[04:20:55 INFO]: [Skript]  - skript-placeholders v1.6.0 (https://github.com/APickledWalrus/skript-placeholders)
[04:20:55 INFO]: [Skript]  - skript-bossbar v1.0
[04:20:55 INFO]: [Skript]  - skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui)
[04:20:55 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[04:20:55 INFO]: [Skript]  - SkJson v3.0.3 (https://www.skjson.xyz/)
[04:20:55 INFO]: [Skript]  - SkBee v3.3.0 (https://github.com/ShaneBeee/SkBee)
[04:20:55 INFO]: [Skript] Installed dependencies: 
[04:20:55 INFO]: [Skript]  - Vault v1.7.3-b131
[04:20:55 INFO]: [Skript]  - WorldGuard v7.0.9+5934e49

Bug Description

When u write the code like the code below, the event "consume" works with region...

on consume of potion of invisibility:
    wait 5 ticks
    if "%region at player%" contains "test":

But, if u write the code below, the code dont work.

on consume of potion of invisibility:
    wait 5 ticks
    if region is "test":

(I tried with)

On region enter:
On region leave:

And the

if region is "test":

Works normally, soo in conclusion, it is a bug.

Expected Behavior

Like in the description above

Steps to Reproduce

Like in the description above

Errors or Screenshots

No response

Other

No response

Agreement

Fusezion commented 7 months ago

with the fixed formatting, from what I see it's just inability to convert an event-value to a region. since from what I get he says region at ... is working as intended which makes sense we're passing a location. region is failing which seems more like an event-value converter returning null. it doesn't seem to be erroring so I ruled out the possibility of using region type

sovdeeth commented 7 months ago

This isn't a converter issue, per se. There is no event-region in the consume event, so it just parses as the region class info. Essentially testing if "test" is a region. You should be using if player is in region "test".

sovdeeth commented 7 months ago

I don't think this is a bug, but I'd like some more opinions before closing.

bluelhf commented 7 months ago

I don't think this is a bug, but I'd like some more opinions before closing.

Arguably this behaviour is unintuitive, so maybe it's something we should look into?

AyhamAl-Ali commented 7 months ago

I don't think this is a bug, but I'd like some more opinions before closing.

Agree. We can however make ExprRegionsAt have an optional location so it always defaults to the event's location however not sure if this may cause conflicts with event-region. Anyways, the correct usage is region at player.

Pikachu920 commented 7 months ago

I don't think this is a bug, but I'd like some more opinions before closing.

Arguably this behaviour is unintuitive, so maybe it's something we should look into?

maybe. another thing to know is that the region support is eventually planned to be split out into skript-worldguard.