Jump to content

technokraken

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by technokraken

  1. i have seen a few tutorials on how to script minecraft forge so i dont really know all that basic java stuff, and what there do
  2. here is my script if u wanna see it, u can just send a working one back if u have time, it would be really nice if u could because im pretty new at java scripting Script package com.technokraken.ct.citrine; import com.technokraken.ct.citrine.block.ModBlocks; import com.technokraken.ct.citrine.item.ModItems; import com.technokraken.ct.citrine.item.ToolMaterialInit; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.*; import net.minecraft.world.level.block.Blocks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.TierSortingRegistry; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.List; // The value here should match an entry in the META-INF/mods.toml file @Mod(Citrine.MOD_ID) public class Citrine { public static final String MOD_ID = "ct"; // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public Citrine() { IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModItems.register(eventBus); ModBlocks.register(eventBus); eventBus.addListener(this::setup); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { TierSortingRegistry.registerTier(BLIZZARDED, Citrine.MOD_ID, 3, 4); // some preinit code LOGGER.info("HELLO FROM PREINIT"); LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName()); } }
  3. should i just copy the example u sent and put it in my script?
  4. i have typed TierSortingRegistry.registerTier(BLIZZARDED, Citrine.MOD_ID, List, List);
  5. what am i supposed to put instead of (a Tier, List, List) i am in the javadoc and i dont really understand what to put in there
  6. so should i type TierSortingRegistry.registerTier(); under FMLCommonSetupEvent?
  7. i only made one material and its for a sword and i dont know to make multiple materials in the same script if u could show me how that would be great
  8. it just the mechanics dosent work, all the tools are swords instead of sword,pickaxe,axe,shovel,hoe
  9. i have added a sword but i dont really know how to add pickaxe,axe,shovel and a hoe, if someone could take a look at my script and help me that would help a lot. Here Is My Github Repository: https://github.com/TechnoKraken/Citrine-1.17.1
  10. i found out the solution my blockstates folder was in assets instead of my modid
  11. here is a link to my github repository if u want to check my code out and see if there is any solutions. https://github.com/TechnoKraken/Citrine-1.17.1
  12. package com.technokraken.ct.citrine.block; import com.technokraken.ct.citrine.Citrine; import com.technokraken.ct.citrine.item.ModCreativeModeTab; import com.technokraken.ct.citrine.item.ModItems; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.Material; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import java.util.function.Supplier; public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Citrine.MOD_ID); public static final RegistryObject<Block> CITRINE_BLOCK = registerBlock("citrine_block", () -> new Block(BlockBehaviour.Properties.of(Material.METAL).strength(15f).requiresCorrectToolForDrops()), ModCreativeModeTab.CITRINE_TAB); public static final RegistryObject<Block> CITRINE_ORE = registerBlock("citrine_ore", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).strength(12f).requiresCorrectToolForDrops()), ModCreativeModeTab.CITRINE_TAB); private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block, CreativeModeTab tab) { RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name, toReturn, tab); return toReturn; } private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block, CreativeModeTab tab) { ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(tab))); } private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block) { RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name, toReturn); return toReturn; } private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) { ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(ModCreativeModeTab.CITRINE_TAB))); } public static void register(IEventBus eventBus) { BLOCKS.register(eventBus); } } i have tried many things but i cant find the error it would be nice if someone could try to find it for me.
×
×
  • Create New...

Important Information

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