clone
Clone, make a copy of a cubic region from one location into a another location.
blocks.clone(
pos(0, 0, 0),
pos(0, 0, 0),
pos(0, 0, 0),
CloneMask.Replace,
CloneMode.Normal
);
Parameters
- begin: the first corner of the cubic region
- end: the opposite corner of the cubic region
- destination: the first corner of the destination region
- mask: how to handle air blocks:
replace
: clone everything into the new region, including air blocksmasked
: air blocks from the cloned region are ignored; their corresponding blocks in the destination region are not changed
- mode: how to handle the cloned region:
normal
: the cloned region is not changed; if the destination region overlaps it, then the clone operation does nothingforce
: the cloned region is overwritten by the destination region if the two regions overlapmove
: the cloned region is replaced with air after the cloning
The clone command in the Minecraft wiki describes how cloning works.
Example
Create a ceiling above the current player’s head. This copies the floor below the player’s feet to the ceiling.
player.onTravelled(TravelMethod.Walk, () => {
blocks.clone(
pos(-2, -1, -2),
pos(2, -1, 2),
pos(-2, 3, 0),
CloneMask.Replace,
CloneMode.Normal
);
});