Skip to content

Commit

Permalink
Fix PotionCmd still not behaving correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Mar 27, 2024
1 parent ff95916 commit c4e22b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/net/wurstclient/commands/PotionCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ public void call(String[] args) throws CmdException

// get effects to start with
ArrayList<StatusEffectInstance> effects;
Potion potion;
switch(args[0].toLowerCase())
{
case "add":
effects = new ArrayList<>(PotionUtil.getCustomPotionEffects(stack));
potion = PotionUtil.getPotion(stack);
break;

case "set":
effects = new ArrayList<>();
potion = Potions.EMPTY;
break;

default:
Expand All @@ -85,6 +88,7 @@ public void call(String[] args) throws CmdException
effects.add(new StatusEffectInstance(effect, duration, amplifier));
}

PotionUtil.setPotion(stack, potion);
setCustomPotionEffects(stack, effects);
ChatUtils.message("Potion modified.");
}
Expand Down

0 comments on commit c4e22b9

Please sign in to comment.