Node Utilities


Functions for manipulating nodes in the world as well as node definitions are in this category.

etc.rotate_nodebox

Usage: etc.rotate_nodebox(box, axis, amount)
 Rotate a single Box (i.e. {x1, y1, z1, x2, y2, z2}) around a named axis (either 'x', 'y', or 'z') in 90° increments. If the positive end of the axis is facing toward the viewer, then positive numbers indicate clockwise rotation, and negative numbers anticlockwise. For example, a point at the +X +Z corner will move into the +X -Z corner if rotated +1 increment around the Y axis, and will move into the -X +Z corner if rotated -1 increment.

etc.rotate_nodeboxes

Usage: etc.rotate_nodeboxes(boxes, axis, amount)
 Behaves identically to etc.rotate_nodebox except that boxes may either be a single Box as described above, or an array of boxes.

etc.flip_nodebox

Usage: etc.flip_nodebox(box, axis)
 Flip a single Box (see etc.rotate_nodebox) along a named axis. Boxes that are already positioned in the center along the chosen axis will not change, and boxes that are offset in either direction along it will be offset in the opposite direction by the same amount.

etc.flip_nodeboxes

Usage: etc.flip_nodeboxes(boxes, axis)
 Behaves identically to etc.flip_nodebox except that boxes may either be a single Box as described above, or an array of boxes.

etc.copy_or_calculate_rotation

Usage: etc.copy_or_calculate_rotation(itemstack, placer, pointed_thing)
 A replacement for minetest.rotate_node that replicates the rotation of the node being pointed at by the player if their names match, unless the player is holding sneak. Intended to be used directly as the on_place callback of node definition.