does anyone know why this isn't working #1848
-
public class MyBlock extends Block {
} by the way the file path is |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
also is there any easy way to have an nbt tag/ blockstate be able to be applied to any block in the game or mods? |
Beta Was this translation helpful? Give feedback.
-
I might be stupid |
Beta Was this translation helpful? Give feedback.
-
Define "not working".
Not really. For block states you could use a mixin to intercept the generic net.minecraft.block.(Abstract)Block methods, but changing the states for a block could interact badly with what the block is doing, e.g. its blockstates.json or dynamic rendering If a block is a BlockEntity it can have NBT. Summary; |
Beta Was this translation helpful? Give feedback.
-
Do you mean you want to change the rendering based on the state? This is done in the blockstates json file by choosing different models for different states, e.g. simple way
From what you are doing, you probably want to look at look at minecraft's |
Beta Was this translation helpful? Give feedback.
-
All possible blockstates are computed during startup and cached. Adding a boolean property to all blocks would double the number of blockstates, and thus double the RAM used to store the blockstate cache. |
Beta Was this translation helpful? Give feedback.
-
This is an example mod that plays around with states for other blocks: Here, you can get a glimpse of how much work is involved (and this is just for the vanilla non-solid blocks): |
Beta Was this translation helpful? Give feedback.
does anyone know why this isn't working
Define "not working".
You can see the block states for a block if you press F3 (the debug overlay) and look at the block.
also is there any easy way to have an nbt tag/ blockstate be able to be applied to any block in the game or mods?
Not really.
For block states you could use a mixin to intercept the generic net.minecraft.block.(Abstract)Block methods, but changing the states for a block could interact badly with what the block is doing, e.g. its blockstates.json or dynamic rendering
The block also wouldn't know how to preserve your state when it changes its known states.
If a block is a BlockEntity it can have NBT.
However, this is only used for …