-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblockHunter.py
More file actions
31 lines (27 loc) · 749 Bytes
/
blockHunter.py
File metadata and controls
31 lines (27 loc) · 749 Bytes
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
from mcpi.minecraft import Minecraft
import math
import time
import random
mc = Minecraft.create()
destX = random.randint(-127, 127)
destZ = random.randint(-127, 127)
destY = mc.getHeight(destX, destZ)
block = 57
mc.setBlock(destX, destY, destZ, block)
mc.postToChat("Block set")
while True:
pos = mc.player.getPos()
distance = math.sqrt((pos.x - destX) ** 2 + (pos.z - destZ) ** 2)
if distance > 100:
mc.postToChat("Freezing")
elif distance > 50:
mc.postToChat("Cold")
elif distance > 25:
mc.postToChat("Warm")
elif distance > 12:
mc.postToChat("Boiling")
elif distance > 6:
mc.postToChat("On fire!")
elif distance == 0:
mc.postToChat("Found it")
break