tutorial:blockentityrenderers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tutorial:blockentityrenderers [2024/08/26 09:10] – update code solidblock | tutorial:blockentityrenderers [2024/08/27 04:42] (current) – solidblock | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Rendering blocks and items dynamically using block entity renderers ====== | ====== Rendering blocks and items dynamically using block entity renderers ====== | ||
- | //This is the 1.15 & 1.16 version of this tutorial. For the 1.14 version, see [[tutorial: | + | //This is the 1.15+ version of this tutorial. For the 1.14 version, see [[tutorial: |
Make sure you [[tutorial: | Make sure you [[tutorial: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Blocks by themselves aren't that interesting, | + | Blocks by themselves aren't that interesting, |
===== Example ===== | ===== Example ===== | ||
In this tutorial we'll build off the block entity we created by adding a '' | In this tutorial we'll build off the block entity we created by adding a '' | ||
Line 25: | Line 25: | ||
We're going to need to register our '' | We're going to need to register our '' | ||
- | Create a new class next to your main class that implements '' | + | In the entrypoint |
<code java> | <code java> | ||
@Environment(EnvType.CLIENT) | @Environment(EnvType.CLIENT) | ||
Line 66: | Line 66: | ||
} | } | ||
</ | </ | ||
- | We then perform the movement of the jukebox (matrices.translate) and rotation (matrices.multiply). There are two parts to the translation: | + | We then perform the movement of the jukebox ('' |
* Getting the current world time, which changes over time. | * Getting the current world time, which changes over time. | ||
* Adding the partial ticks. (The partial ticks is a fractional value representing the amount of time that’s passed between the last full tick and now. We use this because otherwise the animation would be jittery because there are fewer ticks per second than frames per second.) | * Adding the partial ticks. (The partial ticks is a fractional value representing the amount of time that’s passed between the last full tick and now. We use this because otherwise the animation would be jittery because there are fewer ticks per second than frames per second.) |
tutorial/blockentityrenderers.1724663456.txt.gz · Last modified: 2024/08/26 09:10 by solidblock