Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.