Experimental

An early preview: docs, the API and the dashboard may change or break.

Report a problem
Module

@std/plot

Plot frames: positions local to an origin facing north, east, south or west, as minigame-core's PlotFrame.

local plot = require("@std/plot")

Functions

plot.frame(origin: vector, facing: types.Face) -> plot.Frame
#

A frame at origin facing facing, which must be north, east, south or west.

local plot = require("@std/plot")
local world = require("@ember/world")

-- Each player's plot is laid out the same way whichever way it faces. A frame turns positions
-- "3 right, 1 up, 5 ahead" into world positions for its marker's direction.
-- Each "plot" marker is placed facing north, east, south or west.
for _, marker in world.markers.get("plot") do
	local frame = plot.frame(vector.floor(marker.position), marker.facing or "north")

	-- A sign post 5 blocks ahead of the plot's corner, whichever way the plot faces.
	world.setBlock(frame:at(0, 0, 5), "minecraft:oak_fence")

	-- The 16 x 16 build area as a region.
	world.regions.create("build_area", frame:box(0, 0, 0, 16, 32, 16))
end

Types