Skript: "any door" alias not working

Created on 6 Dec 2016  路  18Comments  路  Source: SkriptLang/Skript

Attempting to use any door or wooden door to try and match any (wooden) door causes a Skript error. This is despite aliases-english.sk defining both as valid aliases.

Testing

  • Local Spigot 1.11 server

    • CraftBukkit version git-Spigot-f950f8e-9dee108 (MC: 1.11) (Implementing API version 1.11-R0.1-SNAPSHOT)

    • Plugins (1): Skript dev22e

    • Using default Skript config and aliases

    • No Skript addons

Reproduction

  1. Create plugins/Skript/scripts/test.sk with contents:
on right click:
    if clicked block is any door:
        message "*** Door: %clicked block%"
  1. Reload Skript with sk reload all

    • Expected: Skript loads with no errors

    • Actual:

[15:49:13 ERROR]: Can't compare a block with 'any door' (test.sk, line 2: if clicked block is any door:')
[15:49:13 INFO]: Loaded 1 script with a total of 1 trigger and 0 commands in 0 seconds
[15:49:13 INFO]: [Skript] Encountered 1 error while reloading the config and all scripts!
bug

All 18 comments

Pinging @tim740 since I just updated aliases.

Cannot reproduce; any door and any wooden door are both in the aliases file, just tested both aliases and both worked flawlessly.

Marking as invalid; this may have been any issue at the time of reporting, though to me looking at the alias file's history in the repo it looks like it's had those aliases since before this issue. Make sure your alias file is up to date, as it doesn't automatically update with new entries.

Sorry to be difficult, but this is still reproducible on a clean Skript install. Can you please share your reproduction method and code?

New testing environment:

  • Local Spigot 1.11.2 server

    • CraftBukkit version git-Spigot-7d78b81-0fb3f8b (MC: 1.11.2) (Implementing API version 1.11.2-R0.1-SNAPSHOT)

    • Plugins (1): Skript dev22g

    • Using default Skript config and aliases

    • No Skript addons

Welp, you're right. It's weird, I was testing with some extra plugins and addons installed (but with fresh aliases), and I was not getting this issue. Which is contrary to what you'd expect, as normally the addons are what break something. I'll see if I can narrow down what fixed it (what a strange thing to say!).

How curious; I would expect the same. Perhaps an addon is overriding/patching the alias list internally?

Thanks for looking into this!

Now that this comes up, I recall having this issue on my server when trying to create an "any shulker box" alias (I use my own aliases instead of straight up copying in Tim's because I have some of my own). I just tested with the latest aliases (freshly generated from dev22g). The following alias is defined:

any(_| )shulker(_| )(box|chest)娄s = 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234

And I'm using this code (the only script running)

on right click on any shulker box:
    send "%clicked block%"

This one DOESN'T give an error, but [it only fires for white shulker boxes](https://gyazo.com/ab294410588514ecb434a86af601c26b (ID 219) even though it should of course fire for all of them. Tested a few others, this also happens for the any bed alias:

any(_| )bed娄s = 26, 355

This alias DOES give an error, just like the door one in this issue.

im pretty sure any door is in my aliases

I've actually just found that the issue is the (_| ) that's included in place of spaces in most aliases. Tim does this to make it so you can optionally put a space or an underscore, but it seems to just not work. For example, with fresh aliases, on right click on any wooden door doesn't work, but on right click on any_wooden_door does work. This is also the case with the any door alias, the any shulker box alias, etc. -- all of them need to have underscores instead of spaces to work.

After looking at some other aliases, I've found that the solution is to replace the any in the alias with <any>. It seems that "any" is a keyword when it comes to aliases, and using it without using the <>'s around it causes registration issues (which is why the underscore was required unnecessarily).

After changing the any(_| )door娄s alias to <any>(_| )door娄s, I can now do on right click on any door without issue, and it works with or without an underscore. You can also put square brackets around the any (i.e. [<any>](_| )door娄s) to make the "any" optional if you'd like, so e.g. on right click on door would then work, and would fire for any door.

I'll look to make a PR on Tim's alias repository soon to fix this issue.

i can do it
you said any doesn't work but <any> does?

message me on discord tim740#1139

Will do now.

We have worked through the issues in Discord and fixed most (if not all) instances of this all syntax issue and all of the aliases we noted here (and more!) seem to be working far better now. I presume Tim will be pushing a fixing push to his repository soon which @bensku can grab for the next Skript release.

released

@bensku this issue can be resolved as soon as you update the default aliases to Tim's newest ones. (I will do so upon alias update if you don't get to it before me).

So, was this fixed or?

Sorry, have not been able to test; lost motivation to work on Minecraft stuff

It works fine for me now.

Sorry, totally forgot about this issue since it's so old. But yeah, the aliases changes Tim and I worked through back then should have fixed this, so I'm ready to close. Thanks for the confirmation @Blueyescat!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GiraffeCubed picture GiraffeCubed  路  3Comments

Romitou picture Romitou  路  3Comments

TheClassic36 picture TheClassic36  路  3Comments

ghost picture ghost  路  3Comments

dhgameryt picture dhgameryt  路  3Comments