set block||doc135395

September 20, 2022


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


Sets the block at the specified coordinates in the map to the specified block.


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


Variable name type Description
pos Vector3 coordinate
fullName string block configuration name

Value Returned

type Description
boolean set result

Code Samples

on the server sideglobal script, change the block at coordinates (0, 1, 0) to a grass block

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