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.

CheatingBoy6890

Members
  • Joined

  • Last visited

  1. Ok it worked thank you
  2. Can you give an example how to register a command
  3. What did I wrong?
  4. I'm not sure but I think the command it self would work, but I can't find it in game, so I think, it's not registered
  5. I have a server running on a raspberrypi, a modded one with forge and a vanilla one with paper, sometimes when my friends want to play modded or vanilla, they have to ask me, because I have access to the console, so I thought, I code a plugin/ mod to start the other server
  6. I want to start a shell script, but when I'm at my computer I just start nautilus(file manager in Ubuntu) to see if it woks
  7. My Main Class package com.example.examplemod; import com.example.examplemod.commands.CommandTest; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.commands.CommandSourceStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.InterModComms; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.stream.Collectors; // The value here should match an entry in the META-INF/mods.toml file @Mod("examplemod") public class ExampleMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public ExampleMod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code LOGGER.info("HELLO FROM PREINIT"); } private void enqueueIMC(final InterModEnqueueEvent event) { // some example code to dispatch IMC to another mod InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";}); } private void processIMC(final InterModProcessEvent event) { // some example code to receive and process InterModComms from other mods LOGGER.info("Got IMC {}", event.getIMCStream(). map(m->m.messageSupplier().get()). collect(Collectors.toList())); } @SubscribeEvent public static void RegisterCommads(RegisterCommandsEvent event) { CommandTest.register(event.getDispatcher()); } } My Commad Class package com.example.examplemod.commands; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import java.io.IOException; public class CommandTest { public static void register(CommandDispatcher<CommandSourceStack> dispatcher) { dispatcher.register(Commands.literal("calc").then(Commands.literal("nautilus").executes(ctx -> { ProcessBuilder pb = new ProcessBuilder("nautilus"); try { Process p = pb.start(); } catch (IOException e) { e.printStackTrace(); } return 0; } ))); } }
  8. Thanks, but for me it difn't work. But maybeI'm just to stupid
  9. Hi, I wanted to ask you, how I add commands in 1.18, I added commands in forge for 1.12.2, but it seems, that things have changed.And it would be nice, if you could answer with a video, because I 'relativly new at modding Thank you

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.