Posted June 26, 20205 yr Hey all. I'm on the latest version of Forge and can't figure out how to register my commands. The command is at dev.chroma.devd.command.impl as EffectCommand.java I think I'm almost there, but I don't know what should be in place of the "what goes here?" line. Here's my Main.java: package dev.chroma.devd; import java.lang.System.Logger; import java.util.logging.LogManager; import com.mojang.brigadier.Command; import dev.chroma.devd.command.impl.EffectCommand; 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.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.server.FMLServerStartingEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod("devd") public class Main { public static Main instance; public static final String modid = "devd"; public Main() { instance = this; MinecraftForge.EVENT_BUS.register(this); } @Mod.EventBusSubscriber(bus= Mod.EventBusSubscriber.Bus.MOD) public static class events { @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { event.getRegistry().registerAll( BlockList.blank_slate_stone = new Block(Block.Properties.create(Material.ROCK).sound(SoundType.STONE)).setRegistryName(new ResourceLocation(modid, "blank_slate_stone")) ); } @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { event.getRegistry().registerAll( ItemList.blank_slate_stone = new BlockItem(BlockList.blank_slate_stone, new Item.Properties()).setRegistryName(blank_slate_stone.getRegistryName()) ); } @SubscribeEvent public static void registerCommands(FMLServerStartingEvent event) { What goes here? } } } Edited June 26, 20205 yr by ChromaKey81 solved
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.