diff --git a/skript-aliases b/skript-aliases index dcd1df2517f..1dc8353f006 160000 --- a/skript-aliases +++ b/skript-aliases @@ -1 +1 @@ -Subproject commit dcd1df2517f16fd7cdfaa6c5429827f44b910263 +Subproject commit 1dc8353f006a4f49eb04ec76ffa4ade4ffe9dd53 diff --git a/src/main/java/ch/njol/skript/events/EvtClick.java b/src/main/java/ch/njol/skript/events/EvtClick.java index edfc9389ce6..4eeff69ea67 100644 --- a/src/main/java/ch/njol/skript/events/EvtClick.java +++ b/src/main/java/ch/njol/skript/events/EvtClick.java @@ -258,7 +258,8 @@ public String toString(final @Nullable Event e, final boolean debug) { private static final ItemType usableBlocksMainOnly = Aliases.javaItemType("block usable with main hand"); public static boolean checkUseOffHand(Player player, int clickType, @Nullable Block block, @Nullable Entity entity) { - if (clickType != RIGHT) return false; // Attacking with off hand is not possible + if ((clickType & RIGHT) == 0) + return false; // Attacking with off hand is not possible boolean mainUsable = false; // Usable item boolean offUsable = false; @@ -317,8 +318,8 @@ public static boolean checkUseOffHand(Player player, int clickType, @Nullable Bl if (blockUsable) { // Special behavior if (isSneaking) { //Skript.info("Is sneaking on usable block!"); - if (offHand.getType() != Material.AIR) return false; - if (mainHand.getType() != Material.AIR) return true; + if (offHand.getType() == Material.AIR) return false; + if (mainHand.getType() == Material.AIR) return true; //Skript.info("Sneak checks didn't pass."); } else { // When not sneaking, main hand is ALWAYS used return false;