Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Creators
Details
Changelog
Major update, with the option to exclude some blocks from getting replaced by the structure (like bedrock or barriers or any block with a certain tag), and an option to execute an action when a block with a certain tag is placed with the structure or replaced by it (for example spawning a random mob when a glass block is placed).
Selecting which blocks should be replaced (from 2.0.0 onwards)
You 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. After you have created you StructurePlacerAPI placer object, ou can use these methods:
/** Sets weather or not this structure should replace the bedrock */
placer.setReplaceBedrock(boolean replaceBedrock)
/** Weather or not this structure should replace the barrier block */
placer.setReplaceBarrier(boolean replaceBarrier)
/** Sets weather or not this structure should only replace blocks with the provided tag, for example only replace air blocks */
placer.setOnlyReplaceTaggedBlocks(boolean onlyReplaceTaggedBlocks, TagKey<Block> tag)
/** Allows to specify blocks which won't be replaced if they have the provided tag*/
placer.setPreventReplacementOfTaggedBlocks(boolean preventReplacementOfTaggedBlocks, TagKey<Block> tag)
Performing an action when a certain block is placed with the structure, or replaced by it (2.0.0+)
Now you have the option to execute a function when a block inside a structure gets placed in the world or when a block is replaced while placing the structure.
For example, if you want a random fox to spawn when placing a structure containing berry bushes you can use:
placer.actionOnBlocksPlacedByStructure(ActionOnBlockFind action, TagKey<Block> targets);
//Example:
placer.actionOnBlocksPlacedByStructure((info, world) -> {world.spawnEntity(EntityType.FoxEntity, ...)}, BlockTags.BUSHES);
The 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's only a single block type create a Tag for that block.
The other thing you can do is execute something when a block that is already in the world gets replaced by the structure. Like spawning snow particles when an ice block is replaced:
placer.actionOnBlocksReplacedByStructure(ActionOnBlockFind action, TagKey<Block> targets);
//Example:
placer.actionOnBlocksReplacedByStructure((info, world) -> {world.spawnParticles(ParticleType.SNOW, ...)}, BlockTags.ICE);
Dependencies
Files
Metadata
Release channel
ReleaseVersion number
2.0.0+1.21.1Loaders
Game versions
1.21–1.21.5Environment
Downloads
13Publication date
February 5, 2026 at 12:23 PMPublisher
Emafire003
Owner

