forked from Hirohiko360/LiquidBounceScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoPotion.js
More file actions
47 lines (37 loc) · 1.06 KB
/
AutoPotion.js
File metadata and controls
47 lines (37 loc) · 1.06 KB
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
var scriptName = "AutoPotion";
var scriptAuthor = "By hsbplo";
var scriptVersion = 1.0;
var ItemPotion = Java.type('net.minecraft.item.ItemPotion');
function ExampleModule() {
this.getName = function() {
return "AutoPotion";
}
this.getDescription = function() {
return ".";
}
this.getCategory = function() {
return "Player";
}
this.onEnable = function() {
}
this.onDisable = function() {
}
this.onUpdate = function() {
if (mc.thePlayer.getHeldItem().getItem() instanceof ItemPotion) {
if(mc.thePlayer.getHealth() <= 12) {
mc.gameSettings.keyBindUseItem.pressed = true;
}else{
mc.gameSettings.keyBindUseItem.pressed = false;
}
}
}
}
var exampleModule = new ExampleModule();
var exampleModuleClient;
function onLoad() {}
function onEnable() {
exampleModuleClient = moduleManager.registerModule(exampleModule);
}
function onDisable() {
moduleManager.unregisterModule(exampleModuleClient);
}