CommandHelper icon indicating copy to clipboard operation
CommandHelper copied to clipboard

[Feature request] Structure handling functions.

Open JasonTable opened this issue 3 years ago • 2 comments

Some way to load and maybe save NBT structures to the same place that structure blocks save and load them from. Or load the NBT files from any file location that its allowed to access.

Maybe a function like structure_load(structureName, locationArray, [rotation], [mirror]) to load a saved structure into the world.

So if I use a command block to save a structure named "minecraft:test", i could load it with CommandHelper using structure_load("minecraft:test", ploc("Steve")) to place it at Steve's location for example

JasonTable avatar Jun 13 '21 21:06 JasonTable

It's worth mentioning that most servers use schematics instead, and there's already support for that through the SKCompat extension and WorldEdit.

In regards to structures, there's no way to directly load/place one. However, Structure Blocks do have an API that can be used indirectly for this. We could add a function to set structure block data.

https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Structure.html

It'd look something more like this:

set_block(@location, 'STRUCTURE_BLOCK');
set_structure_data(@location, array(structure: 'minecraft:test', mode: 'LOAD', position: @position);
set_block(location_shift(@location, 'up'), 'REDSTONE_BLOCK');
set_block(@location, 'AIR');
set_block(location_shift(@location, 'up'), 'AIR');

PseudoKnight avatar Jun 14 '21 00:06 PseudoKnight

Thanks for telling me about the SKCompat extension. I am gonna try it out.

A set_structure_data function would be a good alternative. Right now I have a custom proc that makes CommandHelper run a vanilla minecraft command as console to set the structure block with its data and set the redstone block.

JasonTable avatar Jan 12 '22 07:01 JasonTable