auto toteme

This commit is contained in:
kawaiizenbo 2024-09-07 14:52:38 -07:00
parent 00e91b98aa
commit a3e7e885ac
5 changed files with 41 additions and 4 deletions

View file

@ -23,7 +23,8 @@ public class ModuleManager
new Rotation(),
new AutoJump(),
new Reach(),
new AntiPowderSnow()
new AntiPowderSnow(),
new AutoTotem()
/*new Timer()*/
);
}

View file

@ -0,0 +1,36 @@
package me.kawaiizenbo.moonlight.module.modules;
import me.kawaiizenbo.moonlight.module.Category;
import me.kawaiizenbo.moonlight.module.Module;
import me.kawaiizenbo.moonlight.module.settings.BooleanSetting;
import net.minecraft.item.Items;
import net.minecraft.screen.slot.SlotActionType;
public class AutoTotem extends Module
{
public BooleanSetting overrideItems = new BooleanSetting("Override other items", false);
public AutoTotem()
{
super("Auto Totem", "Automatically puts totems in offhand.", Category.COMBAT);
settings.add(overrideItems);
}
@Override
public void tick()
{
if (mc.player.getInventory().offHand.get(0).getItem() != Items.TOTEM_OF_UNDYING)
{
if((!mc.player.getInventory().offHand.isEmpty()) && !overrideItems.value) return;
for (int i = 0; i <= 35; i++)
{
if (mc.player.getInventory().getStack(i).getItem() == Items.TOTEM_OF_UNDYING)
{
mc.interactionManager.clickSlot(0, i, 8, SlotActionType.SWAP, mc.player);
mc.interactionManager.clickSlot(0, 45, 8, SlotActionType.SWAP, mc.player);
mc.interactionManager.clickSlot(0, i, 8, SlotActionType.SWAP, mc.player);
}
}
}
}
}