User Tools

Site Tools


tutorial:concepts

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
tutorial:concepts [2022/05/23 19:29]
mehrcraft
tutorial:concepts [2022/05/24 11:06] (current)
juuz fix incorrect info, use <yarn> tags
Line 4: Line 4:
  
 ^ Concept ​     ^ Description ​      ^ ^ Concept ​     ^ Description ​      ^
 +| Item | Something you can hold in your hand, drop to the ground, place in inventory or store it in a container. It may be a tool or a block held in the hand before placing it. |
 +| Block | The key component for anything you build in Minecraft and has been placed in the world. A lot of blocks are cubes, but most things you place in the world are implemented as blocks, like a furnace. Some blocks don't even look much like a cube, like buttons, fences and doors, and yet they are still treated as blocks. It is important to note that a Block should be thought in code as the definition for a type of block, not the actual single block you see in game. |
 +| Block state | Block states (often seen in code under the name "​state"​) a specific instance of a block together with its properties (e.g. orientation,​ waterlogging or growth stage). This is what you normally think as a block while playing. Each block state can have its own 3D model. |
 +| Block item | The item form of a block, so that you can hold them in your hand, stack them and store them. |
 +| Entity | Dynamic objects in the world that typically move.  For example, ''<​yarn class_1542>''​ for items, and of course ''<​yarn class_1309>''​. Some other things are occasionally also implemented as entities, like projectiles,​ item frames and paintings. ​ |
 +| Living entity | A subcategory of entities that are alive and moving in the world, like players and mobs (cows, zombies, bats etc.). |
 +| Block entity | Stores additional data for a block like contained items or crafting progress. They can provide extra logic for a block, for example when ticking. Not all blocks have block entities - those who do implement ''<​yarn class_2343>''​. Block entities //​aren'​t//​ the same thing as entities! |
 +| Block/item model | The model is a set of descriptive data used to represent the appearance of a block or item. For example, an iron block or furnace would contain information to describe the shape and size of each of its faces, as well as information about where to find the texture (image) that is used to give a particular surface its unique look. Models are usually described in JSON files but can also be generated via Java code. |
 +| Entity model | Entities also have their own 3D models, which are usually defined entirely in code as instances of ''<​yarn net.minecraft.class_583>''​. |
 +| Texture | These are the graphic images used to give surfaces their unique look. They are usually implemented as 16x16 pixel .PNG files for blocks and items, or as larger images for entities and GUI elements. |
 +| Renderer | While most mods make use of ''​blockstates''​ and model JSON files plus .PNG textures to provide the full representation of blocks and items and rely on the default rendering mechanism to show them in the world as you'd expect, there are situations when you will need more complex behaviors. In those cases you will need to create a custom renderer to achieve the desired result. Entities always use renderers. |
 +| NBT | NBT is a data storage file format used by Minecraft. NBT save/load methods are what you use in your entity or block entity class to make sure that your data gets stored and loaded from the world'​s save.  Sounds complicated but it is a simple matter of overriding a couple methods and putting a couple lines of code there. This is described well in the section "​Adding a BlockEntity"​. |
 +| Sides | Minecraft is designed in two separate pieces, a client and server piece. When you play on a server, the division is clear, but the server piece still exists when you play on your own computer. You will often see a given overridden method being called by both the client and server, and to distinguish to which side you are responding to you will need to test for it. The easiest and most common way is to check with the boolean method ''​world.<​yarn method_8608>​()''​. See [[tutorial:​side|Side]] for a more detailed explanation. |
 +| Data sync | Although you can store block data on its block entity, such data does not travel automatically between the server and client. You need to enable it yourself with a couple lines of code, again following the description in "​Adding a BlockEntity"​. |
  
-| Item | Something you can hold in your hand, drop to the ground, place in inventory or store it in a container. ​ It may be a tool or a block held in the hand before placing it. | +This is an early version of the Essential Minecraft Concepts page. There are certainly many concepts that still need to be added. Beginners, if you come across a concept that was not described and that stumped you during your learning, please add it to this page. Experts, please correct any errors you find, keeping the descriptions simple enough so that people that know nothing about Minecraft or Fabric modding will still be able to understand them.
-| Block | The key component for anything you build in minecraft and has been placed in the world. ​ A lot of blocks are cubes, but most things you place in the world are implemented as blocks, like a furnace. ​ Some blocks don't even look much like a cube, like buttons, fences and doors, and yet they are still treated as blocks. ​ It is important to note that a Block should be thought in code as the definition for a type of block, not the actual single block you see in game. | +
-| Blockstate | Blockstates (often seen in code under the name '​state'​) a specific instance of a block placed in a specific position in the world. ​ This is what you normally think as a block while playing. | +
-| Block Item | The item form of a block, so that you can hold them in your hand, stack them and store them. | +
-| Living Entity | Something alive and moving in the world, like players and mobs. | +
-| Entity | An internal structure to hold state data.  For example, BlockEntity for blocks or ItemEntity for items, and of course LivingEntities. ​ Some other things are occasionally also implemented as entities, like projectiles,​ frames and paintings. ​ For example, the information about a torch placed at a given position in the world being on or off is stored in the torch'​s entity. | +
-| Model | The model is a set of descriptive data used to represent the structure of a block, item, living entity, etc.   For example, an iron block or furnace would contain information to describe the shape and size of each of its faces, as well as information about where to find the texture(image) that is used to give a particular surface its unique look.  Models are usually described in JSON files but can also be setup via Java code. | +
-| Texture | These are the graphic images used to give surfaces their unique look.  They are usually implemented as 16x16 pixel .PNG files. | +
-| Renderer |  While most mods make use blockstates and model JSON files plus .PNG textures to provide the full representation of blocks, items and entities and rely on the default rendering mechanism to show them in the world as you'd expect, there are situations when you will need more complex behaviors. ​ In those cases you will need to create a custom renderer to achieve the desired result. | +
-| NBT | NBT methods are what you use in your Entity class to make sure that your block'​s data gets stored and loaded from the world'​s save.  Sounds complicated but it is a simple matter of overriding a couple methods and putting a couple lines of code there. ​ This is described well in the section "​Adding a BlockEntity"​. | +
-| Threads | Minecraft is designed in two separate pieces, a client and server piece. ​ When you play on a server the division is clear, but the server piece still exists when you play on your own computer. ​ These pieces are implemented as threads and you need be very aware of them while coding. ​ You will often see a given overridden method being called by both the client and server threads, and to distinguish to which thread you are responding to you will need to test for it. The easiest and most common way is to check with the boolean method world.isClient(). | +
-| Data Sync | Although you can store block data on its entity, such entity data does not travel automatically between the server and client threads. ​ You need to enable it yourself with a couple lines of code, again following the description in "​Adding a BlockEntity"​. | +
- +
-This is an early version of the Essential Minecraft Concepts page.  There are certainly many concepts that still need to be added. ​ Beginners, if you come across a concept that was not described and that stumped you during your learning, please add it to this page.  Experts, please correct any errors you find, keeping the descriptions simple enough so that people that know nothing about Minecraft or Fabric modding will still be able to understand them.+
tutorial/concepts.txt · Last modified: 2022/05/24 11:06 by juuz