Jump to content

zenek1290

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by zenek1290

  1. Ok, this is what I came up to.

    ExampleMod.java

    ModStructureTypes.java

    ModStructurePieces.java

    CubePiece.java

    CubeStructure.java

    Good is that I finally was able to register my structure.

    Structure is still not generating in overworld.

    And I still got this Info in console,

     

    [16:54:30] [Client thread/DEBUG] [ne.mi.re.ObjectHolderRef/]: Unable to lookup examplemod:cube_structure for public static net.minecraft.world.gen.feature.structure.Structure com.example.examplemod.world.gen.ModStructureTypes.CUBE_STRUCTURE. This means the object wasn't registered. It's likely just mod options.


     

  2. │       ├── assets

    │       │   └── dungeons

    │       │       ├── models

    │       │       │   └── item

    │       │       │       └── example_item.json

    │       │       └── textures

    │       │           └── item

    │       │               └── example_item.png

  3.  

     

    Hi Guys, I recently started making minecraft mods and came up to my first problem that I cannot resolve...

     

    Problem is with loading texture of an item to the game.

     

    Here is my code and file tree.

     

    File Tree

    .
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── zenek1290
    │   │           ├── Dungeons.java
    │   │           └── ModEventSubscriber.java
    │   └── resources
    │       ├── META-INF
    │       │   └── mods.toml
    │       ├── assets
    │       │   └── dungeons
    │       │       └── models
    │       │           └── item
    │       │               └── example_item.json
    │       ├── assets.dungeons.textures.items
    │       │   └── example_item.png
    │       └── pack.mcmeta
    └── test
        ├── java
        └── resources

     

    ModEventSubscriber.java

    
    package com.zenek1290;
    
    import net.minecraft.item.Item;
    import net.minecraft.util.ResourceLocation;
    import net.minecraftforge.event.RegistryEvent;
    import net.minecraftforge.eventbus.api.SubscribeEvent;
    import net.minecraftforge.fml.common.Mod;
    import net.minecraftforge.registries.IForgeRegistryEntry;
    
    @Mod.EventBusSubscriber(modid = Dungeons.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
    public final class ModEventSubscriber {
    
        @SubscribeEvent
        public static void onRegisterItem(RegistryEvent.Register<Item> event) {
    
            event.getRegistry().registerAll(
                    setup(new Item(new Item.Properties()), "example_item")
            );
    
        }
    
        public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final String name) {
            return setup(entry, new ResourceLocation(Dungeons.MODID, name));
        }
    
        public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final ResourceLocation registryName) {
            entry.setRegistryName(registryName);
            return entry;
        }
    
    }

     

    example_item.json

    {
      "parent": "item/generated",
      "textures": {
        "layer0": "dungeons:items/example_item"
      }
    }

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.