Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How do I make a custom Log?


Recommended Posts

Hi I'm trying to make a custom log but I'm having some troubles with the blockstates axis:

The ERROR:

[16:36:42] [Worker-Main-13/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'nirvana:blockstates/bloody_log.json' in resourcepack: 'Mod Resources' for variant: 'axis=z': Unknown blockstate property: 'axis'
[16:36:42] [Worker-Main-13/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'nirvana:blockstates/bloody_log.json' in resourcepack: 'Mod Resources' for variant: 'axis=x': Unknown blockstate property: 'axis'
[16:36:42] [Worker-Main-13/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'nirvana:blockstates/bloody_log.json' in resourcepack: 'Mod Resources' for variant: 'axis=y': Unknown blockstate property: 'axis'

 

And the blockstates.json

{
  "variants": {
    "axis=x": {
      "model": "nirvana:block/bloody_log",
      "x": 90,
      "y": 90
    },
    "axis=y": {
      "model": "nirvana:block/bloody_log_horizontal"
    },
    "axis=z": {
      "model": "nirvana:block/bloody_log",
      "x": 90
    }
  }
}

Version:1.16.5

Mappings:1.16.5-36.1.4_mapped_official_1.16.5

IDE:IntelliJ IDEA Community

Link to post
Share on other sites
package fr.lithium.nirvana.init;

import fr.lithium.nirvana.NIRVANA;
import fr.lithium.nirvana.utils.ModItemGroups;
import net.minecraft.block.AbstractBlock;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import org.jline.utils.Log;


import java.util.function.Supplier;

public class ModBlocks {
    public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, NIRVANA.MODID);


    public static final RegistryObject<Block> BLOODY_LOG = CreateBlock("bloody_log", () -> new Block(AbstractBlock.Properties.of(Material.WOOD).strength(2f,2f).harvestTool(ToolType.AXE).sound(SoundType.WOOD)), new Item.Properties().tab(ModItemGroups.NIRVANA_TAB));

    public static RegistryObject<Block> CreateBlock(String name, Supplier<? extends Block> BlockSupplier, Item.Properties properties) {
        RegistryObject<Block> block = BLOCKS.register(name, BlockSupplier);
        ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), properties));
        return block;
    }
}

Someone told me to use LogBlock but I don't know where and it seems like I don't have it 

Link to post
Share on other sites
Posted (edited)
3 hours ago, Yourou1000 said:

new Block(

See this part?

That's the generic "random block" called Block that all blocks inherit from.

LogBlock is a subclass of Block.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

So I'm suppose to write:  new LogBlock(AbstractBlock.Properties.of.......) or new Block.LogBlock(Absta...)?

I ask because both aren't working  like the class doesn't exist

 

 

Link to post
Share on other sites
2 minutes ago, Yourou1000 said:

So I'm suppose to write:  new LogBlock(AbstractBlock.Properties.of.......) or new Block.LogBlock(Absta...)?

I ask because both aren't working  like the class doesn't exist

there is no LogBlock minecraft uses the RotatedPillarBlock
look in the Blocks class how minecraft creates log blocks

  • Thanks 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.