extends <ahref="../persistence/PersistentDataHolder.html"title="interface in org.bukkit.persistence">PersistentDataHolder</a></span></div>
<divclass="block">Represents a structure.
<p>
A structure is a mutable template of captured blocks and entities that can be
copied back into the world. The <ahref="StructureManager.html"title="interface in org.bukkit.structure"><code>StructureManager</code></a>, retrieved via
<ahref="../Server.html#getStructureManager()"><code>Server.getStructureManager()</code></a>, allows you to create new
structures, load existing structures, and save structures.
<p>
In order for a structure to be usable by structure blocks, it needs to be
null <ahref="StructureManager.html#registerStructure(org.bukkit.NamespacedKey,org.bukkit.structure.Structure)"><code>registered</code></a> with the <ahref="StructureManager.html"title="interface in org.bukkit.structure"><code>StructureManager</code></a>, or located in the primary
world folder, a DataPack, or the server's own default resources, so that the
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#fill(org.bukkit.Location,org.bukkit.Location,boolean)"class="member-name-link">fill</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> corner1,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> corner2,
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#fill(org.bukkit.Location,org.bukkit.util.BlockVector,boolean)"class="member-name-link">fill</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> origin,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../util/BlockVector.html"title="class in org.bukkit.util">BlockVector</a> size,
<divclass="block">Fills the Structure from an area in a world, starting at the specified
origin and extending in each axis according to the specified size vector.</div>
</div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html"title="class or interface in java.util"class="external-link">List</a><<ahref="../entity/Entity.html"title="interface in org.bukkit.entity">Entity</a>></code></div>
<divclass="block">Gets the number of palettes in this structure.</div>
</div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html"title="class or interface in java.util"class="external-link">List</a><<ahref="Palette.html"title="interface in org.bukkit.structure">Palette</a>></code></div>
<divclass="block">Gets a list of available block palettes.</div>
</div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../util/BlockVector.html"title="class in org.bukkit.util">BlockVector</a></code></div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#place(org.bukkit.Location,boolean,org.bukkit.block.structure.StructureRotation,org.bukkit.block.structure.Mirror,int,float,java.util.Random)"class="member-name-link">place</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> location,
boolean includeEntities,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/StructureRotation.html"title="enum class in org.bukkit.block.structure">StructureRotation</a> structureRotation,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/Mirror.html"title="enum class in org.bukkit.block.structure">Mirror</a> mirror,
int palette,
float integrity,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html"title="class or interface in java.util"class="external-link">Random</a> random)</code></div>
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#place(org.bukkit.RegionAccessor,org.bukkit.util.BlockVector,boolean,org.bukkit.block.structure.StructureRotation,org.bukkit.block.structure.Mirror,int,float,java.util.Random)"class="member-name-link">place</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../RegionAccessor.html"title="interface in org.bukkit">RegionAccessor</a> regionAccessor,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../util/BlockVector.html"title="class in org.bukkit.util">BlockVector</a> location,
boolean includeEntities,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/StructureRotation.html"title="enum class in org.bukkit.block.structure">StructureRotation</a> structureRotation,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/Mirror.html"title="enum class in org.bukkit.block.structure">Mirror</a> mirror,
int palette,
float integrity,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html"title="class or interface in java.util"class="external-link">Random</a> random)</code></div>
<divclass="block">Place a structure in the world.</div>
</div>
</div>
</div>
</div>
<divclass="inherited-list">
<h3id="methods-inherited-from-class-org.bukkit.persistence.PersistentDataHolder">Methods inherited from interface org.bukkit.persistence.<ahref="../persistence/PersistentDataHolder.html"title="interface in org.bukkit.persistence">PersistentDataHolder</a></h3>
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
</span><spanclass="return-type"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../util/BlockVector.html"title="class in org.bukkit.util">BlockVector</a></span> <spanclass="element-name">getSize</span>()</div>
<divclass="block">Gets the current size of the structure.
<p>
The size of the structure may not be fixed.</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>A new vector that represents the size of the structure along each
axis.</dd>
</dl>
</section>
</li>
<li>
<sectionclass="detail"id="getPalettes()">
<h3>getPalettes</h3>
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
</span><spanclass="return-type"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html"title="class or interface in java.util"class="external-link">List</a><<ahref="Palette.html"title="interface in org.bukkit.structure">Palette</a>></span> <spanclass="element-name">getPalettes</span>()</div>
<divclass="block">Gets a list of available block palettes.</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>a list of available variants of this structure.</dd>
<divclass="block">Gets the number of palettes in this structure.</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>The number of palettes in this structure</dd>
</dl>
</section>
</li>
<li>
<sectionclass="detail"id="getEntities()">
<h3>getEntities</h3>
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
</span><spanclass="return-type"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html"title="class or interface in java.util"class="external-link">List</a><<ahref="../entity/Entity.html"title="interface in org.bukkit.entity">Entity</a>></span> <spanclass="element-name">getEntities</span>()</div>
<divclass="block">Gets a list of entities that have been included in the Structure.
The entity positions are offsets relative to the structure's position
that is provided once the structure is placed into the world.</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>a list of Entities included in the Structure.</dd>
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">place</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> location,
boolean includeEntities,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/StructureRotation.html"title="enum class in org.bukkit.block.structure">StructureRotation</a> structureRotation,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/Mirror.html"title="enum class in org.bukkit.block.structure">Mirror</a> mirror,
int palette,
float integrity,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html"title="class or interface in java.util"class="external-link">Random</a> random)</span></div>
<divclass="block">Place a structure in the world.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>location</code> - The location to place the structure at.</dd>
<dd><code>includeEntities</code> - If the entities present in the structure should be
spawned.</dd>
<dd><code>structureRotation</code> - The rotation of the structure.</dd>
<dd><code>mirror</code> - The mirror settings of the structure.</dd>
<dd><code>palette</code> - The palette index of the structure to use, starting at
<code>0</code>, or <code>-1</code> to pick a random palette.</dd>
<dd><code>integrity</code> - Determines how damaged the building should look by
randomly skipping blocks to place. This value can range from 0 to 1. With
0 removing all blocks and 1 spawning the structure in pristine condition.</dd>
<dd><code>random</code> - The randomizer used for setting the structure's
<ahref="../loot/LootTable.html"title="interface in org.bukkit.loot"><code>LootTable</code></a>s and integrity.</dd>
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">place</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../RegionAccessor.html"title="interface in org.bukkit">RegionAccessor</a> regionAccessor,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../util/BlockVector.html"title="class in org.bukkit.util">BlockVector</a> location,
boolean includeEntities,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/StructureRotation.html"title="enum class in org.bukkit.block.structure">StructureRotation</a> structureRotation,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../block/structure/Mirror.html"title="enum class in org.bukkit.block.structure">Mirror</a> mirror,
int palette,
float integrity,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html"title="class or interface in java.util"class="external-link">Random</a> random)</span></div>
<divclass="block">Place a structure in the world.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>regionAccessor</code> - The world to place the structure in.</dd>
<dd><code>location</code> - The location to place the structure at.</dd>
<dd><code>includeEntities</code> - If the entities present in the structure should be
spawned.</dd>
<dd><code>structureRotation</code> - The rotation of the structure.</dd>
<dd><code>mirror</code> - The mirror settings of the structure.</dd>
<dd><code>palette</code> - The palette index of the structure to use, starting at
<code>0</code>, or <code>-1</code> to pick a random palette.</dd>
<dd><code>integrity</code> - Determines how damaged the building should look by
randomly skipping blocks to place. This value can range from 0 to 1. With
0 removing all blocks and 1 spawning the structure in pristine condition.</dd>
<dd><code>random</code> - The randomizer used for setting the structure's
<ahref="../loot/LootTable.html"title="interface in org.bukkit.loot"><code>LootTable</code></a>s and integrity.</dd>
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">fill</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> corner1,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> corner2,
boolean includeEntities)</span></div>
<divclass="block">Fills the structure from an area in a world. The origin and size will be
calculated automatically from the two corners provided.
<p>
Be careful as this will override the current data of the structure.
<p>
Be aware that this method allows for creating structures larger than the
48x48x48 size that Minecraft's Structure blocks support. Any structures
saved this way can not be loaded by using a structure block. Using the
API however will still work.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>corner1</code> - A corner of the structure.</dd>
<dd><code>corner2</code> - The corner opposite from corner1.</dd>
<dd><code>includeEntities</code> - true if entities should be included in the saved
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">fill</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../Location.html"title="class in org.bukkit">Location</a> origin,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../util/BlockVector.html"title="class in org.bukkit.util">BlockVector</a> size,
boolean includeEntities)</span></div>
<divclass="block">Fills the Structure from an area in a world, starting at the specified
origin and extending in each axis according to the specified size vector.
<p>
Be careful as this will override the current data of the structure.
<p>
Be aware that this method allows for saving structures larger than the
48x48x48 size that Minecraft's Structure blocks support. Any structures
saved this way can not be loaded by using a structure block. Using the
API however will still work.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>origin</code> - The origin of the structure.</dd>
<dd><code>size</code> - The size of the structure, must be at least 1x1x1.</dd>
<dd><code>includeEntities</code> - true if entities should be included in the saved
structure.</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html"title="class or interface in java.lang"class="external-link">IllegalArgumentException</a></code> - Thrown if size is smaller than 1x1x1</dd>