Hardware Reference
In-Depth Information
mc.setBlocks(1,51,1,5,55,5,block.AIR.id)
mc.setBlock(3,55,3,block.GLOWSTONE_BLOCK.id)
#beam up player
mc.player.setTilePos(3,51,5)
time.sleep(10)
mc.postToChat("<aliens>Not very interesting at all -
send it back")
time.sleep(2)
#send the player back to the original position
mc.player.setTilePos(playerPos.x, playerPos.y,
playerPos.z)
#clear the room
mc.setBlocks(0,50,0,6,56,6,block.AIR.id)
mode = "missionaccomplished"
else:
#the player got away
mc.postToChat(ALIEN_TAUNTS[random.
randint(0,len(ALIEN_TAUNTS)-1)])
alienTarget = playerPos.clone()
alienTarget.y = alienTarget.y + HOVER_HEIGHT
When the player is beamed aboard the spaceship, a room is built 50 blocks over
the spawn position and the player's position is set to be inside the room. (Just
like Doctor Who's Tardis, the inside is bigger than the outside!) Messages are
then posted to the chat, before the player's position is set to be back where he
started and the room is cleared.
The room into which the player is beamed is created in the sky above the spawn
location, partly for convenience but also because it's likely to be well away from
anything else. You could create it anywhere you like, however, because as soon
as the player leaves the room it is cleared, returning the Minecraft world to the
way it was before.
12. If the position of the alien spaceship is not equal to the target (set in the rules
above), move the alien spaceship to the target by typing this code into the end of
the program, indented under the While loop:
if alienPos != alienTarget:
 
Search WWH ::




Custom Search