Jump to content

Recommended Posts

Posted (edited)

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(busMod.EventBusSubscriber.Bus.MOD)
    public static class events {
        @SubscribeEvent
        public static void registerBlocks(final RegistryEvent.Register<Blockevent) {
          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<Itemevent) {
          event.getRegistry().registerAll(
            ItemList.blank_slate_stone = new BlockItem(BlockList.blank_slate_stonenew Item.Properties()).setRegistryName(blank_slate_stone.getRegistryName())
          );
        }
        @SubscribeEvent
        public static void registerCommands(FMLServerStartingEvent event) {
          What goes here?
        }
    }
}
Edited 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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