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.

maxssho13

Members
  • Joined

  • Last visited

Everything posted by maxssho13

  1. Nevermind, after hours of research I got it myself.
  2. I would like to add a feature to my mod to make it so on the client-side it doesn't render certain players.
  3. This is my first time making a mod in Minecraft so I'm a little bit of a noob when it comes to all of this. Just as a proof of concept I wanted to make a mod that would see a mathematical expression in the chat and then make my user type the answer back. I imported this library mX parser in order to evaluate the mathematical expression. It was all going well in my dev version and working just as I wanted, so I built the mod and put it into my mods folder. I was absolutely ecstatic to see that my game hadn't crashed but unfortunately when I got into the game and tested to see if it would work it didn't. I narrowed it to down to being an issue with the library just not evaluating the function but I'm not sure why. This is the code: import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.mariuszgromada.math.mxparser.Expression; import org.mariuszgromada.*; @Mod(modid = TestMod.MODID, version = TestMod.VERSION) public class TestMod { public static final String MODID = "TestMod"; public static final String VERSION = "1.0"; @EventHandler public void init(FMLInitializationEvent event) { FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onChat(ClientChatReceivedEvent event) throws Exception { String message = event.message.getUnformattedText(); if (message.contains("Solve: ")) { String[] splitArr = message.split(": ",2); System.out.println(splitArr[1]); Expression e = new Expression(splitArr[1]); double result = e.calculate(); double waitTime = Math.random()+1; Thread.sleep((long)waitTime*1000); if (result - (int)result == 0) { Minecraft.getMinecraft().thePlayer.sendChatMessage(String.valueOf((int)result)); } else { Minecraft.getMinecraft().thePlayer.sendChatMessage(String.valueOf(result)); } } } }
  4. This is my first time making a mod in Minecraft so I'm a little bit of a noob when it comes to all of this. Just as a proof of concept I wanted to make a mod that would see a mathematical expression in the chat and then make my user type the answer back. I imported this library mX parser in order to evaluate the mathematical expression. It was all going well in my dev version and working just as I wanted, so I built the mod and put it into my mods folder. I was absolutely ecstatic to see that my game hadn't crashed but unfortunately when I got into the game and tested to see if it would work it didn't. I narrowed it to down to being an issue with the library just not evaluating the function but I'm not sure why. This is the code: import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.mariuszgromada.math.mxparser.Expression; import org.mariuszgromada.*; @Mod(modid = TestMod.MODID, version = TestMod.VERSION) public class TestMod { public static final String MODID = "TestMod"; public static final String VERSION = "1.0"; @EventHandler public void init(FMLInitializationEvent event) { FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onChat(ClientChatReceivedEvent event) throws Exception { String message = event.message.getUnformattedText(); if (message.contains("Solve: ")) { String[] splitArr = message.split(": ",2); System.out.println(splitArr[1]); Expression e = new Expression(splitArr[1]); double result = e.calculate(); double waitTime = Math.random()+1; Thread.sleep((long)waitTime*1000); if (result - (int)result == 0) { Minecraft.getMinecraft().thePlayer.sendChatMessage(String.valueOf((int)result)); } else { Minecraft.getMinecraft().thePlayer.sendChatMessage(String.valueOf(result)); } } } }

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.