Skip to content

Commit

Permalink
Fix EnchantCmd not working with offhand items
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Oct 31, 2023
1 parent bfe9c51 commit 068e096
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/wurstclient/commands/EnchantCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public void call(String[] args) throws CmdException

private ItemStack getHeldItem() throws CmdError
{
ItemStack stack = MC.player.getInventory().getMainHandStack();
ItemStack stack = MC.player.getMainHandStack();

if(stack.isEmpty())
stack = MC.player.getOffHandStack();

if(stack.isEmpty())
throw new CmdError("There is no item in your hand.");
Expand Down

0 comments on commit 068e096

Please sign in to comment.