Help to display potion textures in a custom brewing stand

Started by Spleet2.0 on

Topic category: Help with modding (Java Edition)

Last seen on 21:38, 22. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help to display potion textures in a custom brewing stand

Hi,

 

 I'm trying to create a custom brewing stand for a mod. However I would like to display the texture of the potions on the block. I do not know how to do

 

Last seen on 18:36, 16. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There are a couple ways you…
Sat, 01/27/2024 - 12:50

There are a couple ways you could do this, but they're probably going to all be somewhat annoying.

The method that I'd consider is using an entity, spawned on the block, to display the potion texture. (Such as how beacons display a beam, and enchanting tables display a book, though those examples are more hard coded.) You'd just need a no-AI entity, with a hitbox that has a width of zero/disabled collisions, that you spawn or despawn depending on the potion type. (If you have geckolib, you can also just change the texture of the entity, and use animations too.)

There are probably better ways to do this, but most of them involve some amount of custom code, or are somewhat unhelpful. (Such as making a different block for each possible potion display, which becomes increasingly impractical the more potions you have.) If you're using optifine, you might be able to make different texture overlays using block NBT data, but that's a different can of worms...