mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 08:36:45 +01:00
Require sneaking to activate abilities if the player is holding an item on the offhand.
This commit is contained in:
parent
28a2b9668d
commit
87056a2d96
@ -528,6 +528,10 @@ public class PlayerListener implements Listener {
|
||||
|
||||
switch (event.getAction()) {
|
||||
case RIGHT_CLICK_BLOCK:
|
||||
if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = event.getClickedBlock();
|
||||
BlockState blockState = block.getState();
|
||||
|
||||
@ -569,6 +573,9 @@ public class PlayerListener implements Listener {
|
||||
break;
|
||||
|
||||
case RIGHT_CLICK_AIR:
|
||||
if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ACTIVATION CHECKS */
|
||||
if (Config.getInstance().getAbilitiesEnabled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user