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 revision
Previous revision
tutorial:structures [2020/11/02 14:17] – Use Biome Modification API in Fabric API siglongtutorial:structures [2022/11/05 12:06] (current) jab125
Line 1: Line 1:
 +:!: //**For versions 1.18 and beyond, the Fabric Structure API no longer exists and structures can be done entirely in datapacks. [[https://misode.github.io/guides/adding-custom-structures/|Please read this gist for more information.]] ** //
 +
 ====== Adding Structure Features [1.16.3] ====== ====== Adding Structure Features [1.16.3] ======
 We’re going to look at registering and placing structures in your world. We’re going to look at registering and placing structures in your world.
  
-To view examples of vanilla structures in action, ''IglooFeature'' and ''IglooGenerator'' are a good place to start. +To view examples of vanilla structures in action, ''IglooFeature'' and ''IglooGenerator'' are a good place to start. However, the growing standard for making new structures is using Jigsaw Structures which can be easier to work with and lets you deal with less structure code. [[https://fabricmc.net/wiki/tutorial:jigsaw|Read more on Jigsaw Structures here and how to make them.]]
  
 You are going to need a feature and generator for the most basic structure. You are going to need a feature and generator for the most basic structure.
Line 126: Line 128:
 </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.1604326678.txt.gz · Last modified: 2020/11/02 14:17 by siglong