{"id":149610,"date":"2026-06-09T03:03:14","date_gmt":"2026-06-09T00:03:14","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/"},"modified":"2026-06-09T03:03:14","modified_gmt":"2026-06-09T00:03:14","slug":"structureplacerapi","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/","title":{"rendered":"StructurePlacerAPI"},"content":{"rendered":"<p># Structure Placer API<br \/>\nThis simple API provides a simple way to spawn a structure in your world one-time, instead of putting it in the world generation. It could be useful for an item that creates a portal, or some other kind of structure. Or to create LuckyBlocks, who knows!<br \/>\n## Setup<br \/>\nInclude this library into your `build.gradle` as a dependency<br \/>\n&#8220;`gradle<br \/>\nrepositories {<br \/>\n    maven {<br \/>\n        name = &#8220;Modrinth&#8221;<br \/>\n        url = &#8220;https:\/\/api.modrinth.com\/maven&#8221;<br \/>\n        content {<br \/>\n            includeGroup &#8220;maven.modrinth&#8221;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>dependencies {<br \/>\n    modImplementation &#8220;maven.modrinth:structureplacerapi:<version>&#8221;<br \/>\n}<br \/>\n&#8220;`<br \/>\nIf you want you can `include` the API in your jar file by adding only the `include` string:<br \/>\n&#8220;`gradle<br \/>\nrepositories {<br \/>\n    maven {<br \/>\n        name = &#8220;Modrinth&#8221;<br \/>\n        url = &#8220;https:\/\/api.modrinth.com\/maven&#8221;<br \/>\n        content {<br \/>\n            includeGroup &#8220;maven.modrinth&#8221;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>dependencies {<br \/>\n    modImplementation &#8220;maven.modrinth:structureplacerapi:<version>&#8221;<br \/>\n    include &#8220;maven.modrinth:structureplacerapi:<version>&#8221;<br \/>\n}<br \/>\n&#8220;`<br \/>\nIt&#8217;s less than 25 kb!<\/p>\n<p>![nodecraft](https:\/\/nodecraft.com\/r\/emalightdev)<\/p>\n<p>## How to use it<br \/>\n### How to create the structure?<br \/>\nYou have to create an NBT structure using minecraft&#8217;s StructureBlocks, as demonstrated in this video: https:\/\/www.youtube.com\/watch?v=umhuRXinD3o<\/p>\n<p>### Where to put the file I got?<br \/>\nYou will need to place the *structure.nbt* file insde your mod&#8217;s data folder, like this: `data\/yourmodid\/structures`<\/p>\n<p>### Creating a new placer object<br \/>\nIn order to place the structure, you will need to create a placer object first, this is done simply by creating a new `StructurePlacerAPI` object. It has quite a few parameters to play with:<br \/>\n&#8220;`java<br \/>\nStructurePlacerAPI(ServerWorld world, Identifier templateName, BlockPos blockPos, BlockMirror mirror, BlockRotation rotation, boolean ignoreEntities, float integrity, BlockPos offset)<br \/>\n&#8220;`<br \/>\n### The parameters<br \/>\n&#8211; The first parameter **`world`** is the wolrd in which we are going to place a structure. You could get it from an entity, or whatever.<br \/>\n&#8211; The second parameter **`templateName`** is an Identifier made up by the MOD_ID of your mod and the structure&#8217;s name<br \/>\n&#8211; The third parameter **`blockPos`** is the block position where your structure is going to spawn. You can get it from an entity coordinates for example<br \/>\n&#8211; The fourth, **`mirror`** is the first of the optional parameters. With this you can mirror your structure using the `BlockMirror` class. No need to create another object just type BlockMirror.#stuff<br \/>\n&#8211; The fifth, **`rotation`** is like the previuous one, and you will be able to rotate your structure using the `BlockRotation` class. No need to create another object just type BlockMirror.#stuff<br \/>\n&#8211; The **`ignoreEntities`** parameter if set to true won&#8217;t spawn entities included inside the structure file. If set to false, it will instead spawn them<br \/>\n&#8211; The **`integrity`** parameter is pretty intresting, since it is a float value between 0f and 1f which will deteremine how much the structure will be run-down. If set to a value below 1f some of the blocks will be removed upon generation<br \/>\n&#8211; Finally, the **`offset`** parameter is another BlockPos that could be useful to reposition the structure under an entity&#8217;s feet or something.<\/p>\n<p>### Placing the structure<br \/>\nYou have just created a `StructurePlacerAPI placer = new StructurePlacerAPI(things up there)`, and to spawn it you will have to do this:<br \/>\n&#8220;`java<br \/>\nplacer.loadStructure();<br \/>\n&#8220;`<br \/>\nYeah ok it&#8217;s not that difficult. You just have to run that tho, not the `.place` method directly, since the load will also check for the existance of said structure before spawning it.<\/p>\n<p>#### Restoring the old terrein after some time<br \/>\nStarting from version `1.1.0` you can also use:<br \/>\n&#8220;`java<br \/>\nplacer.loadAndRestoreStructure(int restore_ticks);<br \/>\n&#8220;`<br \/>\nto supply an amount of ticks ( 1 seconds = 20 ticks ) after which the old terrain will be restored.<br \/>\n**NOTICE**: It could lead to performance issues, especially if the structure is really big! (It needs to save every block inside the structure!)<\/p>\n<p>You can also add an animation for the blocks reappearing by using:<br \/>\n&#8220;`java<br \/>\nplacer.loadAndRestoreStructureAnimated(int restore_ticks, int blocks_per_tick, boolean random);<br \/>\n&#8220;`<br \/>\n&#8211; `blocks_per_ticks` is the amaount of blocks that will be replaced each tick, so if your structure is made by 200 blocks, and the blocks_per_ticks is set to 1, it will take 1 second to place 20 blocks, and 20 seconds to finish the terrain restoration.<br \/>\n&#8211; `random` refers to order in which the blocks will be replaced. Setting to true, each time the regenerated block will be a random one, otherwise it will go from one angle of the structure to the other one. In my opinion, random = true is cooler.<\/p>\n<p>### Selecting which blocks should be replaced (from 2.0.0 onwards)<br \/>\nYou can now specify if the structure that gets placed can replace bedrock and barriers or blocks with a certain tag, or if it can ONLY replace blocks with a certain tag.<br \/>\nAfter you have created you StructurePlacerAPI placer object, ou can use these methods:<br \/>\n&#8220;`java<br \/>\n\/** Sets weather or not this structure should replace the bedrock *\/<br \/>\nplacer.setReplaceBedrock(boolean replaceBedrock)<\/p>\n<p>\/** Weather or not this structure should replace the barrier block *\/<br \/>\nplacer.setReplaceBarrier(boolean replaceBarrier)<\/p>\n<p>\/** Sets weather or not this structure should only replace blocks with the provided tag, for example only replace air blocks *\/<br \/>\nplacer.setOnlyReplaceTaggedBlocks(boolean onlyReplaceTaggedBlocks, TagKey<Block> tag)<\/p>\n<p>\/** Allows to specify blocks which won&#8217;t be replaced if they have the provided tag*\/<br \/>\nplacer.setPreventReplacementOfTaggedBlocks(boolean preventReplacementOfTaggedBlocks, TagKey<Block> tag)<br \/>\n&#8220;`<\/p>\n<p>### Performing an action when a certain block is placed with the structure, or replaced by it (2.0.0+)<br \/>\nNow you have the option to execute a function when a block inside a structure gets placed in the world or when a block<br \/>\nis replaced while placing the structure. <\/p>\n<p>For example, if you want a random fox to spawn when placing a structure containing berry bushes you can use:<br \/>\n&#8220;`java<br \/>\nplacer.actionOnBlocksPlacedByStructure(ActionOnBlockFind action, TagKey<Block> targets);<\/p>\n<p>\/\/Example:<br \/>\nplacer.actionOnBlocksPlacedByStructure((info, world) -> {world.spawnEntity(EntityType.FoxEntity, &#8230;)}, BlockTags.BUSHES);<br \/>\n&#8220;`<br \/>\nThe action is a lambda function that provides you with the `StructureBlockInfo` and `ServerWorldAccess` (or `ServerLevelAccess` or whatever it is with mojmaps). You have to specify a tag for the kind of block you want to replace. If it&#8217;s only a single block type create a Tag for that block.<\/p>\n<p>The other thing you can do is execute something when a block that is *already in the world gets replaced* by the structure.<br \/>\nLike spawning snow particles when an ice block is replaced:<br \/>\n&#8220;`java<br \/>\nplacer.actionOnBlocksReplacedByStructure(ActionOnBlockFind action, TagKey<Block> targets);<\/p>\n<p>\/\/Example:<br \/>\nplacer.actionOnBlocksReplacedByStructure((info, world) -> {world.spawnParticles(ParticleType.SNOW, &#8230;)}, BlockTags.ICE);<br \/>\n&#8220;`<\/p>\n<p>### Example<br \/>\nAn example of this could be the one you find insde the LightWithin mod(whihc btw, you should check out):<br \/>\n&#8220;`java<br \/>\nStructurePlacer placer = new StructurePlacer((ServerWorld) caster.getWorld(), new Identifier(MOD_ID, &#8220;frost_light&#8221;), caster.getBlockPos(), BlockMirror.NONE, BlockRotation.CLOCKWISE_90, true, 1.0f, new BlockPos(-4, -3, -3));<br \/>\nplacer.loadStructure();<br \/>\n&#8220;`<br \/>\nTo have a permanent structure<\/p>\n<p>&#8220;`java<br \/>\nStructurePlacer placer = new StructurePlacer((ServerWorld) caster.getWorld(), new Identifier(MOD_ID, &#8220;frost_light&#8221;), caster.getBlockPos(), BlockMirror.NONE, BlockRotation.CLOCKWISE_90, true, 1.0f, new BlockPos(-4, -3, -3));<br \/>\nplacer.loadAndRestoreStructureAnimated(200, 2, true);<br \/>\n&#8220;`<br \/>\nTo make the old terrain regenerate by replacing two blocks per tick, in a random order. <\/p>\n<p>### Warning!<br \/>\nIMPORTANT! MAKE SURE YOU ARE ON THE SERVER THREAD!<\/p>\n<p>&#8220;`java<br \/>\nif(!world.isClient){<br \/>\n\/\/run stuff<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>## Support me<br \/>\nIf you would like to offer me a coffee, here you go.<\/p>\n<p>![ko-fi](https:\/\/ko-fi.com\/S6S88307C)<br \/>\nAlternativly, you can support me by supporting you using a 25% off on a server for you and your friend using this code down here<\/p>\n<p>## License<br \/>\nThis API is available under the CC0 license. Feel free to learn from it and incorporate it in<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An API made for fabric mod developers to spawn NBT structures <\/p>\n","protected":false},"featured_media":82640,"template":"","meta":{"_minecraft_slug":"structureplacerapi","_minecraft_project_id":"sSdng0L4","_minecraft_author":"Emafire003","_minecraft_license":"CC0-1.0","_minecraft_downloads":5467,"_minecraft_follows":11,"_minecraft_client_side":"unsupported","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"structureplacerapi.zip","_minecraft_size_bytes":11560461,"_minecraft_version_count":89,"_minecraft_updated_at":"2026-05-17T01:27:30.975704Z","_minecraft_date_created":"2022-07-14T14:06:28.055979Z","_minecraft_date_modified":"2026-04-12T17:29:48.719936Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/structureplacerapi","_minecraft_icon_attachment_id":82640,"_minecraft_imported_at":"2026-06-09T00:03:14+00:00","_minecraft_import_hash":"083c0858777d43b96f402f3c3cc0fd87","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[97,104,873,158,98,92],"mod_loader":[99,106,160,100],"minecraft_version":[54,55,56,59,36,60,93,94,101,102,62,37,40,41,73,74,38,78,79,80,81,82,83,167,163],"class_list":["post-149610","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-fabric","mod_category-forge","mod_category-library","mod_category-neoforge","mod_category-quilt","mod_category-utility","mod_loader-fabric","mod_loader-forge","mod_loader-neoforge","mod_loader-quilt","minecraft_version-1-19","minecraft_version-1-19-1","minecraft_version-1-19-2","minecraft_version-1-20","minecraft_version-1-20-1","minecraft_version-1-20-2","minecraft_version-1-20-3","minecraft_version-1-20-4","minecraft_version-1-20-5","minecraft_version-1-20-6","minecraft_version-1-21","minecraft_version-1-21-1","minecraft_version-1-21-10","minecraft_version-1-21-11","minecraft_version-1-21-2","minecraft_version-1-21-3","minecraft_version-1-21-4","minecraft_version-1-21-5","minecraft_version-1-21-6","minecraft_version-1-21-7","minecraft_version-1-21-8","minecraft_version-1-21-9","minecraft_version-26-1","minecraft_version-26-1-1","minecraft_version-26-1-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>StructurePlacerAPI - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"StructurePlacerAPI - Minecraft\" \/>\n<meta property=\"og:description\" content=\"An API made for fabric mod developers to spawn NBT structures\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/\",\"name\":\"StructurePlacerAPI - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/huge-structure-blocks-icon-icon.png\",\"datePublished\":\"2026-06-09T00:03:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/huge-structure-blocks-icon-icon.png\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/huge-structure-blocks-icon-icon.png\",\"width\":300,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/structureplacerapi\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"StructurePlacerAPI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"StructurePlacerAPI - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/","og_locale":"en_US","og_type":"article","og_title":"StructurePlacerAPI - Minecraft","og_description":"An API made for fabric mod developers to spawn NBT structures","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/","name":"StructurePlacerAPI - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/huge-structure-blocks-icon-icon.png","datePublished":"2026-06-09T00:03:14+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/huge-structure-blocks-icon-icon.png","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/huge-structure-blocks-icon-icon.png","width":300,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/structureplacerapi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"StructurePlacerAPI"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/149610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/82640"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=149610"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=149610"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=149610"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=149610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}