-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSoulRegen.js
114 lines (107 loc) · 3.1 KB
/
SoulRegen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
var scriptName = "Soul Regen";
var scriptVersion = 1.0;
var scriptAuthor = "Soulplexis";
var Nolagz = new Nolagz();
var NolagzClient;
var C07PacketPlayerDigging = Java.type('net.minecraft.network.play.client.C07PacketPlayerDigging');
var C08PacketPlayerBlockPlacement = Java.type("net.minecraft.network.play.client.C08PacketPlayerBlockPlacement");
var DiamondSword = Java.type("net.minecraft.network.play.client.C00PacketKeepAlive");
var PlayerPacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
var Pingr = Java.type("net.minecraft.network.status.client.C01PacketPing");
var Items = Java.type("net.minecraft.network.play.client.C09PacketHeldItemChange");
var Potion = Java.type("net.minecraft.potion.Potion");
function Nolagz() {
var Mode = value.createList("Mode", ["Packet", "Old", "Regen"], "Packet");
var OnGround = value.createBoolean("GroundOnly", false);
// var Regen = value.createBoolean("RegenOnly", false);
var Speed = value.createInteger("Speed", 5, 1, 100);
var Delay = value.createInteger("Delay", 3, 0, 100);
var Health = value.createInteger("Health", 18, 1, 20);
var Debug = value.createBoolean("Debug", false);
this.getName = function () {
return "SoulRegen";
};
this.getDescription = function () {
return "Regenerates health quickly.";
};
var swics = false;
this.getCategory = function () {
return "Player";
};
var helditem;
var switcher = false;
var dely = 0;
this.onUpdate = function () {
dely++;
if(mc.thePlayer.getHealth() <= Health.get()) {
if(dely >= Delay.get()) {
if(((OnGround.get() && mc.thePlayer.onGround) || OnGround.get() == false)) {
switch(Mode.get()) {
case "Packet":
for(var x = 0; x < Speed.get(); x++) {
mc.thePlayer.sendQueue.addToSendQueue(new PlayerPacket(true));
}
if(Debug.get()) {
swics = !swics
if(swics) {
chat.print("§c[Debug] §7Regenning ");
} else {
chat.print("§c[Debug] §fRegenning ");
}
}
break;
case "Old":
for(var x = 0; x < Speed.get(); x++) {
mc.thePlayer.sendQueue.addToSendQueue(new PlayerPacket(mc.thePlayer.onGround));
}
if(Debug.get()) {
swics = !swics
if(swics) {
chat.print("§c[Debug] §7Regenning " + mc.thePlayer.onGround);
} else {
chat.print("§c[Debug] §fRegenning " + mc.thePlayer.onGround);
}
}
break;
case "Regen":
if(mc.thePlayer.isPotionActive(Potion.regeneration)){
for(var x = 0; x < Speed.get(); x++) {
mc.thePlayer.sendQueue.addToSendQueue(new PlayerPacket(true));
}
if(Debug.get()) {
swics = !swics
if(swics) {
chat.print("§c[Debug] §7Regenning ");
} else {
chat.print("§c[Debug] §fRegenning ");
}
}
}
break;
}
dely = 0;
}
}
}
}
this.onDisable = function() {
dely = 0;
}
this.onEnable = function() {
}
this.addValues = function(ass) {
ass.add(Mode);
ass.add(Speed);
ass.add(Delay);
ass.add(Health);
ass.add(OnGround);
// ass.add(Regen);
ass.add(Debug);
}
}
function onEnable() {
NolagzClient = moduleManager.registerModule(Nolagz);
};
function onDisable() {
moduleManager.unregisterModule(NolagzClient);
};