-
Notifications
You must be signed in to change notification settings - Fork 2
/
Damage11.js
133 lines (125 loc) · 8.91 KB
/
Damage11.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
var scriptName = "PseudoSelfDamage";
var scriptVersion = 1.0;
var scriptAuthor = "yorik100";
var pseudoSelfDamager = new PseudoSelfDamager();
var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition');
var client;
function PseudoSelfDamager() {
var Mode = value.createList("Mode", ["Basic", "YPort", "YPort2", "VClip", "PacketJump", "OldNCP"], "Basic");
var OnlyOnGround = value.createBoolean("OnlyOnGround", true);
this.addValues = function (values) {
values.add(Mode);
values.add(OnlyOnGround);
}
this.getName = function () {
return "SelfDamager";
};
this.getDescription = function () {
return "SelfDamager";
};
this.getCategory = function () {
return "Fun";
};
this.onEnable = function () {
if (!mc.thePlayer.isOnLadder() && !mc.thePlayer.isInWeb && !mc.thePlayer.isInWater() && !mc.thePlayer.isInLava() && mc.thePlayer.ridingEntity == null && (mc.thePlayer.onGround || !OnlyOnGround.get())){
switch (Mode.get()) {
case "Basic":
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 0.278, 0).expand(0, 0, 0)).isEmpty()) {
for (var i = 0; i <= 10; ++i) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.278, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
if (i == 10)
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
}
} else {
chat.print("§cNot enough space (0.278 blocks min distance between you and the block above you)")
}
break;
case "YPort":
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 0.42, 0).expand(0, 0, 0)).isEmpty()) {
for (var i = 0; i <= 7; ++i) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.41999998688698, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
if (i == 7)
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
}
} else {
chat.print("§cNot enough space (0.42 blocks min distance between you and the block above you)")
}
break;
case "YPort2":
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 1.00133597911214, 0).expand(0, 0, 0)).isEmpty()) {
for (var i = 0; i <= 2; ++i) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.41999998688698, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.7531999805212, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.00133597911214, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
if (i == 2)
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
}
} else {
chat.print("§cNot enough space (1 block min distance between you and the block above you)")
}
break;
case "VClip":
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 3.45, 0).expand(0, 0, 0)).isEmpty()) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 3.45, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
} else {
chat.print("§cNot enough space (you need to have a 2 blocks tall empty box 3.45 blocks above you)")
}
break;
case "PacketJump":
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 1.2, 0).expand(0, 0, 0)).isEmpty()) {
for (var i = 0; i <= 2; ++i) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.41999998688698, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.7531999805212, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.00133597911214, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.16610926093821, mc.thePlayer.posZ, false));
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 1.24918707874468, 0).expand(0, 0, 0)).isEmpty()) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.24918707874468, mc.thePlayer.posZ, false));
} else {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.2, mc.thePlayer.posZ, false));
}
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.1707870772188, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1.0155550727022, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.78502770378924, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.4807108763317, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.10408037809304, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, i == 2));
}
} else {
chat.print("§cNot enough space (1.2 blocks min distance between you and the block above you)")
}
break;
case "OldNCP":
if (mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0, 0.0625, 0).expand(0, 0, 0)).isEmpty()) {
for (var i = 0; i <= 48; ++i) {
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0625, mc.thePlayer.posZ, false));
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
if (i == 48)
mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
}
} else {
chat.print("§cNot enough space (0.0625 blocks min distance between you and the block above you)")
}
break;
}
}else{
chat.print("§4You can't self damage in this area")
}
}
this.onUpdate = function () {
var autoDisableModule = moduleManager.getModule("SelfDamager");
autoDisableModule.setState(false);
}
this.onDisable = function () {}
}
function onLoad() {}
function onEnable() {
client = moduleManager.registerModule(pseudoSelfDamager);
}
function onDisable() {
moduleManager.unregisterModule(client);
}