Chicken Purge Script
Customize your variables, then fill in the blanks!
Your Custom Settings
Size of the chicken pen
Type of fence for pen
Number of chickens to spawn
Python Script (Code Builder)
This script builds a fenced pen and spawns chickens inside. Press C in Minecraft Education to open the Code Builder!
pen_size = 12
chicken_count = 20
y_level = -60
def ():
for i in (pen_size + 1):
blocks.place(OAK_FENCE, world(i, y_level, 0))
blocks.place(OAK_FENCE, world(i, y_level, pen_size))
blocks.place(OAK_FENCE, world(0, y_level, i))
blocks.place(OAK_FENCE, world(pen_size, y_level, i))
def spawn_chickens():
for i in range(chicken_count):
rand_x = (1, pen_size - 1)
rand_z = randint(1, pen_size - 1)
mobs.(CHICKEN, world(rand_x, y_level + 1, rand_z))
player.on_chat("pen", build_pen)
player.("chickens", spawn_chickens)
