diff --git a/src/main/java/ch/njol/skript/classes/data/DefaultComparators.java b/src/main/java/ch/njol/skript/classes/data/DefaultComparators.java index e59a5678403..87fa10b1089 100644 --- a/src/main/java/ch/njol/skript/classes/data/DefaultComparators.java +++ b/src/main/java/ch/njol/skript/classes/data/DefaultComparators.java @@ -60,6 +60,7 @@ import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffectType; import org.skriptlang.skript.lang.comparator.Comparator; import org.skriptlang.skript.lang.comparator.Comparators; import org.skriptlang.skript.lang.comparator.Relation; @@ -653,6 +654,9 @@ public boolean supportsOrdering() { return false; } }); + + // Potion Effect Type + Comparators.registerComparator(PotionEffectType.class, PotionEffectType.class, (one, two) -> Relation.get(one.equals(two))); } } diff --git a/src/test/skript/tests/regressions/pull-6832-potioneffecttype-compare.sk b/src/test/skript/tests/regressions/pull-6832-potioneffecttype-compare.sk new file mode 100644 index 00000000000..f0243b8a85f --- /dev/null +++ b/src/test/skript/tests/regressions/pull-6832-potioneffecttype-compare.sk @@ -0,0 +1,3 @@ +test "compare potion effect types": + assert nausea = nausea with "2 nausea potion effect types should match" + assert type of (potion effect of nausea for 1 minute) = nausea with "type of potion effect of nausea should equal nausea"