Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- position=player.position()
- x=position.get_value(Axis.X)
- y=position.get_value(Axis.Y)
- z=position.get_value(Axis.Z)
- def spiderSpawn():
- gameplay.set_game_mode(SURVIVAL, mobs.target(NEAREST_PLAYER))
- #clearning the inventory
- player.execute("/clear")
- mobs.give(mobs.target(NEAREST_PLAYER), DIAMOND_AXE, 1)
- mobs.give(mobs.target(NEAREST_PLAYER), BOW, 1)
- mobs.give(mobs.target(NEAREST_PLAYER), ARROW, 64)
- mobs.give(mobs.target(NEAREST_PLAYER), TORCH, 3)
- #use a loop to spawn spider webs
- for i in range(50):
- blocks.place(COBWEB, randpos(world(x-4,y+1,z), world(x+9,y+7,z+45)))
- for i in range(5):
- mobs.spawn(SPIDER, randpos(world(x-4,y+1,z+10), world(x+9,y+7,z+45)))
- def cave():
- blocks.fill(BEDROCK, world(x-5,y-1,z-1),world(x+10,y+10,z+50),FillOperation.HOLLOW)
- blocks.place(GLOWSTONE, world(x,y,z+49))
- spiderSpawn()
- player.on_chat("spiders", cave)
- #an event for destroying a block
- def blockDestroy():
- gameplay.set_game_mode(CREATIVE, mobs.target(NEAREST_PLAYER))
- player.teleport(pos(50, 1, 50))
- blocks.on_block_broken(GLOWSTONE, blockDestroy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement