-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jetpack.js
43 lines (36 loc) · 1.16 KB
/
Jetpack.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
//Jetpack Mod
//by wilco375
//Don't share or redistribute this mod using the Github link, instead, use this link: http://adf.ly/rYFWu
var lastPY
var watertickcount = 0
ModPE.langEdit("item.chestplateChain.name","Jetpack");
Item.addCraftRecipe(303,1,0, [265,3,0,331,1,0,265,1,0,331,2,0,265,1,0,331,1,0])
//ModPE.overrideTexture("images/items-opaque.png", "http://i.imgur.com/1heEotN.png")
//ModPE.overrideTexture("images/armor/chain_1.png", "http://i.imgur.com/7DLrI7j.png")
function modTick(){
currentPY = getPlayerY()
PY1 = getPlayerY() -1
PY2 = getPlayerY() -2
PZ1 = getPlayerZ()
PX1 = getPlayerX()
Block1 = getTile(PX1, PY1, PZ1)
Block2 = getTile(PX1, PY2, PZ1)
chestp = Player.getArmorSlot(1)
if(chestp == 303 && Player.canFly() == false) Player.setCanFly(1)
if(chestp != 303 && Player.canFly() == true){
Player.setCanFly(0)
Player.setFlying(0)
}
if(chestp == 303 && Block1 == 0 && Block2 != 0 && Player.isFlying() == true && lastPY > currentPY){
setTile(PX1,PY1,PZ1,9,0)
watertickcount = 1
waterx = PX1
watery = PY1
waterz = PZ1
}
if(watertickcount == 2){
setTile(waterx,watery,waterz,0,0)
watertickcount = 0}
if(watertickcount != 0) watertickcount++
lastPY = getPlayerY()
}