-
Shaky Camera Effect When Changing Rotation (1.12.2)
I was trying to lock the player rotation. The zeros in the code were just placeholders, as I intended to freeze the yaw and pitch of the player.
-
Shaky Camera Effect When Changing Rotation (1.12.2)
I tried changing the camera rotation with this player.rotationYaw = 0; player.prevRotationYaw = 0; but when I moved my mouse, the camera rotation changed but next frame it snapped back to 0. I know that at the start of the frame the rotation is being set to zero in my code and later in it it's being changed based on my mouse movements. If there's a fix for this that'd be great. I won't be able to respond for a couple hours.
-
Canceling the sending of a chat message
Thanks! I used that and it worked.
-
Canceling the sending of a chat message
I was trying to make a mod that cancels any chat that starts with ",chatmod", but when I tried event.setCanceled(true), my client didn't show the message but the clients of other players did show the message. Here's a snippet of my code: @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { String message = event.getMessage().getUnformattedText(); print(message+" (printed)"); if (message.split(" ")[0].contentEquals(",chatmod")) { print("CHATMOD COMMAND"); print("TYPE: "+message.split(" ")[2]); event.setCanceled(true); } } Also, here's the print function I made: void print(String toP) { Minecraft.getMinecraft().player.sendMessage(new TextComponentString(toP)); }; What event could be canceled so that the message wouldn't be sent in the first place?
-
Importing doesn't work with javac
I downloaded it and ran gradlew build. It worked! Thanks so much!
-
Importing doesn't work with javac
-
Importing doesn't work with javac
-
Importing doesn't work with javac
When I try to compile a simple mod that I have, every single one of the mods supposedly doesn't exist. Here's the code: package cMod; 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.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.apache.logging.log4j.Logger; @Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION) public class ExampleMod { public static final String MODID = "examplemod"; public static final String NAME = "Example Mod"; public static final String VERSION = "1.0"; private static Logger logger; @EventHandler public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); } @EventHandler public void init(FMLInitializationEvent event) { FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { String message = event.getMessage().getUnformattedText(); if(message.contains("hi")) { Minecraft.getMinecraft().toggleFullscreen(); } } } And here's the error:
IPS spam blocked by CleanTalk.