Create blocks||doc135405

September 20, 2022

Format

 Map:createBlock(pos, fullName) 
  • The class to which the function belongs:Map

Description

Generate a block at the specified coordinates according to the block configuration name and triggerBLOCK_SPAWNBlock generation event.


Precautions

  • The values of each axis of the pos coordinate must be integers, otherwise there will be unintended consequences.

Parameters

Variable name type Description
pos Vector3 specified location
fullName string block name


Code Samples

Generate a stone block at (1, 1, 1) coordinates

local map = World.CurWorld:getMap("map001")
map:createBlock({ x = 1, y = 1, z = 1 }, "myplugin/stone")