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.07k stars 369 forks source link

Compare event-inventory against inventory type #6116

Open TheLimeGlass opened 1 year ago

TheLimeGlass commented 1 year ago

Skript/Server Version

Skript 2.8.0-dev
1.20.1 Paper
Addons:
   Khoryl v1.1.0

Bug Description

on inventory open:
    event-inventory is an enchantment table

This throws an error

Expected Behavior

To not throw an error and compare against it's inventory type.

Errors or Screenshots

Can't compare an inventory with a visual effect
line: event-inventory is an enchantment table

Other

Solution is to do type of event-inventory is an enchantment table

Also inventory type of %inventories% should be a thing.

ALSO

if event-inventory is an enchantment table inventory

is not valid where enchanting table inventory is

ALSO

I think without using the inventory in that comparison, Skript thinks it's comparing against a block...

This needs cleaning up badly.

moraedu commented 1 year ago

I believe the reason as to why inventory types have inventory as suffix is to avoid adding ItemType - InventoryType and VisualEffect - InventoryType converters, however as comparators it goes, adding those should work just fine? Unlike converters, comparators don't really break anything besides maybe providing faulty errors when it comes to comparison of undefined initialization type, but that's been broken since forever so I don't see how that would be an issue now