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.

recklessGreed_

Members
  • Joined

  • Last visited

  1. Okay Thanks for your time and your opinions i hope i'll get an answer to my Event Problem soon
  2. Sure here my Classes: First The Main: package de.recklessGreed.chatMod; import ibxm.Player; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ServerChatEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = Reference.Mod_ID, name = Reference.Mod_Name, version = Reference.Version) public class ChatControlMain { @Instance(value = Reference.Mod_ID) public static ChatControlMain instance; EntityPlayerSP user = Minecraft.getMinecraft().thePlayer; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new Events(this)); } } and the Events: package de.recklessGreed.chatMod; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.event.ServerChatEvent; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class Events { ChatControlMain classMain; public Events(ChatControlMain main) { classMain = main; } @SubscribeEvent public void chatEvent(ServerChatEvent event) { /*String message = event.message; String username = event.username; String[] words = message.split(" "); EntityPlayerMP sender = event.player; if(checkForWord(words, "hallo")) { classMain.user.sendChatMessage("Hallo. This is an automatic Message."); }*/ System.out.println("Chat registered"); } @SubscribeEvent public void blockBreak(BreakEvent event) { System.out.println("Block has been broken."); } public boolean checkForWord(String[] words, String cmd) { for(String word : words) { if(word.equalsIgnoreCase(cmd)) return true; } return false; } } Refercences just holds the MOD ID, The Version and the Name
  3. Hello Modders, I am quite new to Client Modding and now have a problem with handeling Events with Forge. Here is my code: @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new Events(this)); } and in the Events Class: @SubscribeEvent public void chatEvent(ServerChatEvent event) { System.out.println("Chat registered"); } @SubscribeEvent public void blockBreak(BreakEvent event) { System.out.println("Block has been broken."); } I do not get any Errors which can help me. If i start the client (via Eclipse) Forge tells me the mod is loaded but nothing happens when i write (with my second account) in chat or if i break a block. I used the breakBlock event to check wether the ChatEvent is just lost or wheter i have a problem with the Events. I am Stuck with this for 36 hours now and i searched all over Google and Forums for a solution. If I am just too stupid to find anything please let me know. When my english is corrupted somewhere please forgive me i am german and my writing skills are not the best... Thanks for your help.

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.