from mcpi.minecraft import Minecraft
import time
import random
mc = Minecraft.create()
score = 0
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
blockType = 80
mc.setBlocks(x-3, y, z-3, x+3, y, z+3, blockType)
while(True):
for i in range(5):
sec = 5-i
print("The tile will be disappeared after"+ str(sec)+ "seconds!")
time.sleep(1)
for j in range(30):
blockX = random.randint(x-3, x+3)
blockZ = random.randint(z-3, z+3)
mc.setBlock(blockX, y, blockZ, 0)
time.sleep(1)
pos = mc.player.getTilePos()
if (blockType == mc.getBlock(pos.x, pos.y - 1, pos.z)):
score += 1
else:
break
mc.setBlocks( x-3, y, z-3, x+3, y, z+3, blockType )
message = "The total score is " + str(score)
print(message)
The time that is set for 5 seconds.
The game starts around the radius of the player.
The block type that is used for this game is snow blocks.
These make it so that you must find a safe place so that you wouldn’t sink in the snow. 30 coordinates are turned into air blocks.
If you hold out on the snow you earn a point.