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.

harison513

Members
  • Joined

  • Last visited

Everything posted by harison513

  1. Oh wait, now its gone... I'm confused.
  2. Okay, I have removed the rendering for now and moved the entity registration to the CommonProxy init and I still get this error: Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/Render for invalid side SERVER Am I registering it wrong? private static void register(Class<? extends Entity> entityClass, String entityName, int eggColour, int spotColour) { EntityRegistry.registerModEntity(new ResourceLocation("test_entity"), entityClass, entityName, entityID++, TestMod.instance, 128, 1, true, eggColour, spotColour); } public static void registerEntities() { // Which is called in the CommonProxy init EntityHelper.register(TestEntity.class, "test_entity", 0x000000, 0xffffff); }
  3. If I put it in the CommonProxy or anywhere else I get this crash when starting the server: Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/Render for invalid side SERVER public class CommonProxy { public void preInit() { NetworkHelper.registerMessages(); } public void init() { EntityHelper.registerEntities(); // Error here } public void postInit() { } public EntityPlayer getPlayer(MessageContext ctx) { return ctx.getServerHandler().playerEntity; } }
  4. I have created a simple entity class to figure out how to get it to work on a server but when running solely the client I am able to use the spawn egg no problem to spawn the entity, but when I try it on a server, nothing happens (no errors or entity constructor called). The egg is there it just doesn't work on the server. TestMod: @Mod(name = TestMod.NAME, modid = TestMod.MODID, version = TestMod.VERSION, acceptedMinecraftVersions = TestMod.ACCEPTED_MINECRAFT_VERSIONS) public class TestMod { public static final String NAME = "Test Mod"; public static final String MODID = "testmod"; public static final String VERSION = "1.0.0"; public static final String ACCEPTED_MINECRAFT_VERSIONS = "[1.11.2]"; public static final String PROXY_PATH = "com.testmod.proxy"; @Instance public static TestMod instance; @SidedProxy(clientSide = TestMod.PROXY_PATH + ".ClientProxy", serverSide = TestMod.PROXY_PATH + ".ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(); } } Proxies: public class CommonProxy { public void preInit() { NetworkHelper.registerMessages(); } public void init() { } public void postInit() { } public EntityPlayer getPlayer(MessageContext ctx) { return ctx.getServerHandler().playerEntity; } } public class ServerProxy extends CommonProxy { public void preInit() { super.preInit(); NetworkHelper.registerMessages(); } public void init() { super.init(); } public void postInit() { super.postInit(); } public EntityPlayer getPlayer(MessageContext ctx) { return ctx.getServerHandler().playerEntity; } } public class ClientProxy extends CommonProxy { @Override public void preInit() { super.preInit(); } @Override public void init() { super.init(); EntityHelper.registerEntities(); RenderingRegistry.registerEntityRenderingHandler(TestEntity.class, new RenderTestEntity(Minecraft.getMinecraft().getRenderManager())); } @Override public void postInit() { super.postInit(); } @Override public EntityPlayer getPlayer(MessageContext ctx) { return ctx.side.isClient() ? Minecraft.getMinecraft().player : super.getPlayer(ctx); } } EntityHelper: public class EntityHelper { private static int entityID = 3467; public static void registerEntities() { EntityHelper.register(TestEntity.class, "test_entity", 7951674, 7319108); } public static void renderEntities() { RenderingRegistry.registerEntityRenderingHandler(TestEntity.class, new RenderTestEntity(Minecraft.getMinecraft().getRenderManager())); } private static void register(Class<? extends Entity> entityClass, String entityName, int eggColour, int spotColour) { EntityRegistry.registerModEntity(new ResourceLocation("testmod:test_entity"), entityClass, entityName, entityID++, TestMod.instance, 128, 1, true, eggColour, spotColour); } }
  5. Okay figured it out, you can use... Minecraft.getMinecraft().gameSettings.keyBindInventory.isPressed() ... in your key handler class to check if a certain key binding is pressed.
  6. Is there any way to override the current inventory key binding so that I can open my custom gui in place of the the existing player inventory?

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.