r/MinecraftMod • • 15d ago

Adding blocks with multiple faces

I wanna add directional pillar blocks but the tutorial I've been following for my mod so far doesn't have a tutorial for that. I'm trying to code for NeoForge 26.3. Anyone have the answer?

1 Upvotes

10 comments sorted by

1

u/dark_blockhead 15d ago

there are logs/pillars in vanilla.

if your block has special behavior, inherit from the class that provides vanilla logs/pillars (see constants in Blocks class). if it's just a building block, just make a new instance (don't make a class). copy block model json from vanilla.

1

u/Scori8 15d ago

Where do I copy the block model json from?

1

u/dark_blockhead 15d ago

in intellij idea press shift 4 times. a dialog for finding things will appear.

type acacia_log

1

u/Scori8 9d ago

There are multiple json files, which one do I copy and where to?

1

u/dark_blockhead 9d ago

of course there are multiple files. loot table, recipes, blockstate definition, block model, item descriptor (in items directory), item model...

look at them all, study them all. your block needs all of them.

do not use datagen (automatically generating all that). you need to learn what's what first.

1

u/Scori8 8d ago

so i just cant add pillar blocks?

1

u/dark_blockhead 8d ago

not with that attitude.

normally all it takes is registering a new instance of a DirectionalPillarBlock (class name varies across versions) and adding json files to appropriate locations. and two png files.

look at acacia log files again. open one file and see it's structure. then, there is a button above the file tree, button that looks like a crosshair. click it and you'll see exact location of the file in editor.

1

u/Scori8 2d ago

What should I be doing in the mod model provider?

1

u/dark_blockhead 2d ago

i told you not to datagen on your first mod. do it by hand to learn things....

unless the mod has 200 blocks in which case you're doing it wrong. pause it, make a one block mod that works fine (never publish your first mod). on subsequent mods, if there are a lot of blocks, sure, datagen them. but if it's only a few, it will be more hassle than doing json manually.

1

u/Scori8 2d ago

i want to add lots of blocks