Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Structure handling functions. #1284

Open
JasonTable opened this issue Jun 13, 2021 · 2 comments
Open

[Feature request] Structure handling functions. #1284

JasonTable opened this issue Jun 13, 2021 · 2 comments
Labels
feature request New functionality that doesn't exist yet

Comments

@JasonTable
Copy link

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

@PseudoKnight
Copy link
Contributor

PseudoKnight commented Jun 14, 2021

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');

@LadyCailin LadyCailin added the feature request New functionality that doesn't exist yet label Jun 14, 2021
@JasonTable
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New functionality that doesn't exist yet
Projects
None yet
Development

No branches or pull requests

3 participants