var script = registerScript({
name: 'RegenTest',
version: '1.0',
authors: ['Itz']
});
script.registerModule({
name: 'RegenTest',
category: 'Combat',
description: 'RegenTest'
}
var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
var Potion = Java.type('net.minecraft.potion.Potion');
var client = new client()
var clientClient
function client() {
this.getName = function() {
}
var packets = value.createFloat("Packets", 32, 10, 100)
var potionPackets = value.createFloat("PacketsOnlyPackets", 32, 10, 100)
var Health = value.createFloat("Health", 20, 1, 20)
var potion = value.createFloat("PotionOnly", true)
this.addValues = function(Test) {
Test.add(Health)
Test.add(potion)
Test.add(potionPackets)
Test.add(packets)
}
this.onUpdate = function() {
if (potion.get()) {
if (mc.thePlayer.getActivePotionEffect(Potion.regeneration) != null && mc.thePlayer.getActivePotionEffect(Potion.regeneration).getDuration() > 0 && mc.thePlayer.getHealth() <= eblan.get() && mc.thePlayer.onGround) {
for (var i = 0; i < potionPackets.get(); ++i) {
mc.thePlayer.getActivePotionEffect(Potion.regeneration).deincrementDuration();
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
}
}
}
else if (mc.thePlayer.getHealth() <= eblan.get() && mc.thePlayer.onGround) {
for (var i = 0; i < packets.get(); ++i) {
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
}
}
}
}
function onLoad() {}
function onEnable() {
clientClient = moduleManager.registerModule(client)
}
function onDisable() {
moduleManager.unregisterModule(clientClient)
}