Re-Using Custom Block.Java files?

Started by Game_Log on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Re-Using Custom Block.Java files?
Sun, 07/20/2025 - 21:55 (edited)

Hi there, I am working on a mod that has these plushies that come in a variety of appearances. My initial idea was to have one PlushieBlock.java file to determine the block's properties, as apart from texture visuals, these blocks will be the exact same. However, it seems that when I make a new block in MCreator, it creates a new "___Block.java" file for that individual block. Is there some way to fix this, or is it fine to have a unique java class for every custom block?

Edited by Game_Log on Sun, 07/20/2025 - 21:55
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Blockstates will be your…
Mon, 07/21/2025 - 17:31

Blockstates will be your friend for this. They allow you to change the Model and Texture while keeping the actual block the same. You will just need to add a method to change the blockstate of the PlushieBlock such as a sneak right clicking procedure (on the block add a right click trigger and have it check if the player is sneaking for this).