Fill - Microsoft MakeCode For Minecraft

Skip to main content Microsoft Microsoft MakeCode About FAQ Projects GitHub Examples Super Powers Mega Jump Flower trail Super Digger Yellow brick road Game Over Agent Agent Dig Agent Tower Agent Checkers Agent Wanderer Agent Pyramid Hilbert Fractals Mobs Chicken Rain Zombie Pig Cats vs Dogs Rabbit Invasion Bouncing Pigs Bat Cave Terraforming 1000 TNT Wipe Out Lava Tower Earthquake Pitfall Grid world Lorenz Attractor Mini Games Spleef Leap of Faith Gold Stairs TNT Spleef Gladiator Ice Age Builder Builder Wall 3D Axis Compass Build a House TNT Cannon Courses CS Intro About Lessons Blocks Minecraft Authors Events Overview Unplugged 1 Unplugged 2 Activity 1 Activity 2 Activity 3 Activity 4 Project Coordinates Overview Unplugged 1 Unplugged 2 Activity 1 Activity 2 Activity 3 Project Variables Overview Unplugged Activity 1 Activity 2 Activity 3 Activity 4 Project Iteration Overview Unplugged 1 Unplugged 2 Activity 1 Activity 2 Activity 3 Activity 4 Project Conditionals Overview Unplugged Activity 1 Activity 2 Activity 3 Activity 4 Project Functions Overview Unplugged Activity 1 Activity 2 Activity 3 Project Arrays Overview Unplugged 1 Unplugged 2 Activity 1 Activity 2 Activity 3 Project Artificial Intelligence Overview Unplugged Activity 1 Activity 2 Activity 3 Project Final Project Review Guide Project Reference Player Blocks Mobs Agent Builder Gameplay Positions Shapes Blocks On Start Loops repeat for while for of Logic if Boolean Variables assign change var var Math JavaScript blocks Custom blocks Python Calling Sequencing Variables Operators Statements Functions Classes JavaScript Calling Sequencing Variables Operators Statements Functions Types Classes Interfaces Generics Types Number String Boolean Array Function Get setup Blocks Gallery Miscellaneous About Support Translate Sharing projects Offline support Save Reset Beta version Home page content Developers Command Line Interface Visual Studio Code support Blocks Embed Tutorials Chicken rain Agent Moves Agent Build Agent Wall Mega Jump Walk On Water Flower Trail Positions Super Digger Billboard Compass Rose Fast Forward Spleef Leap of faith Gold Stairs Lava Tower Rainbow Beacon Colorful Rainbow Sand Storm Aquarium Leaping Salmon Python Tutorials Chicken rain Agent Moves Agent Build Mega Jump Flower Trail Super Digger Billboard Compass Rose Fast Forward Spleef Leap of faith Gold Stairs Lava Tower Sand Storm Aquarium Leaping Salmon Using Extensions Castle Builder Roller Coaster Pixel Art Builder Lessons Area AI - Part 1 AI - Part 2 Ratio Volcanoes - Part 1 Volcanoes - Part 2 Storyline Story ending Cubic units Gold mine DocsReferenceBlocks fill

Fill a volume of blocks in between two positions.

blocks.fill( GRASS, pos(0, 0, 0), pos(0, 0, 0), FillOperation.Replace );

Parameters

  • block: the block used to fill the volume
  • from: the first corner of the cubic region
  • to: the opposite corner of the cubic region
  • operator: what happens to the existing blocks in the region. Choose one of these options:
    • replace: all blocks inside the fill region are replaced with the specified block, including air
    • hollow: only blocks on the outer edge of the fill region are replaced with the specified block; blocks inside the region are replaced with air
    • outline: only blocks on the outer edge of the fill region are replaced with the specified block; blocks inside the region are not be changed
    • keep: only air blocks inside the fill region are replaced with the specified block; existing blocks are not be changed
    • destroy: same as replace, but existing blocks are dropped as items as if they had been mined by the player

The way fill works is described in this Minecraft wiki section.

Example

Create a lot of TNT blocks!!

blocks.fill( TNT, pos(1, 1, 1), pos(10, 10, 10), FillOperation.Replace );

If you want to see it in action, the fill block is used in the 1000 TNT example.

Edit this page on GitHub Edit template of this page on GitHub Edit template of this page on GitHub

Select Language

How do I add a new language? Translate this page

Tag » How To Use /fill In Minecraft