clear the specified block||doc135397

September 20, 2022


 Map:clearBlocksInArea(min, max, fullNames)
  • The class to which the function belongs:Map


Clears all blocks except the blocks that need to be ignored in an area consisting of the smallest coordinate and the largest coordinate.


  • fullNames is an ordered table of configuration names for blocks that need to be ignored.
  • The fullNames parameter also needs to be passed an empty list {} if you don't need to ignore blocks.
  • The values for each axis of the min and max coordinates must be integers, otherwise unintended consequences will occur.


Variable name type Description
min Vector3 Minimum coordinates
max Vector3 maximum coordinate
fullNames table Need to ignore block configuration name table

Code Samples

on the server sideglobal script, clear all blocks except grass in the area

local map = World.CurWorld:getMap("map001")
map:clearBlocksInArea({x = 0, y = 0, z = 0}, {x = 2, y = 2, z = 2}, {"myplugin/grass"})