User Tools

Site Tools


tutorial:structures

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:structures [2020/11/02 14:17] – Use Biome Modification API in Fabric API siglongtutorial:structures [2021/03/07 17:53] – [Creating a Generator] telepathicgrunt
Line 126: Line 126:
 </code> </code>
          
-''handleMetadata'' is where you look at data blocks within your structure and do tasks based on what you find. +''handleMetadata'' is where you look at data blocks within your structure and can do tasks based on what you find. 
-In vanilla structures, data blocks are placed above chests so they can be filled with loot in this method.+This can be good for dynamic stuff such as placing certain mobs based on what mod is on and so on. 
 + 
 +In vanilla structures, data blocks are placed above chests so they can be filled with loot in this method.  
 +HOWEVER, you do not need to use datablocks to place chests with loot. Instead, use this command to set a north facing chest with a loottable.  
 +Save this chest into your structure's nbt file and it will generate loot when opened for the first time. (Don't open the chest before saving to the nbt file!) 
 +<code>/setblock ~ ~ ~ minecraft:chest[facing=north]{LootTable:"modid:loottable"}</code>
  
 We set the ''StructurePieceType'' to ''ExampleMod.MY_PIECE''; this is the variable that holds your registered structure piece.  We set the ''StructurePieceType'' to ''ExampleMod.MY_PIECE''; this is the variable that holds your registered structure piece. 
tutorial/structures.txt · Last modified: 2022/11/05 12:06 by jab125