DERPZ774 Posted August 19, 2022 Share Posted August 19, 2022 So I'm trying to make it so the overlay of the player skin "turns off" essentially after they equip certain armor, how would I go about doing that? Quote Link to comment Share on other sites More sharing options...
DERPZ774 Posted August 19, 2022 Author Share Posted August 19, 2022 13 hours ago, diesieben07 said: You can use RenderPlayerEvent.Pre to hide these parts of the model. Look at PlayerRenderer#setModelProperties for how to modify their visibility. Thank you this worked! Quote Link to comment Share on other sites More sharing options...
DERPZ774 Posted August 23, 2022 Author Share Posted August 23, 2022 On 8/19/2022 at 3:12 AM, diesieben07 said: You can use RenderPlayerEvent.Pre to hide these parts of the model. Look at PlayerRenderer#setModelProperties for how to modify their visibility. I ran into an issue while running it on a server. https://hastebin.com/qajuvasifo.properties @SubscribeEvent public static void renderPlayerPre(RenderPlayerEvent.Pre event) { if (event.getPlayer().getInventory().getArmor(2).is(ModItems.VAULT_SUIT.get())) { event.getRenderer().getModel().leftSleeve.visible = false; event.getRenderer().getModel().rightSleeve.visible = false; //event.getRenderer().getModel().hat.visible = false; event.getRenderer().getModel().jacket.visible = false; event.getRenderer().getModel().leftPants.visible = false; event.getRenderer().getModel().rightPants.visible = false; event.getRenderer().getModel().head.visible = false; } /// TODO: 8/19/2022 edit statements here for all armor /// TODO: 8/20/2022 Fix server crashing } this is the code Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 23, 2022 Share Posted August 23, 2022 Move your EventHandler in a client only class, you can achieve this by setting the value "value" in the EventBusSubscriber annotation to Dist#CLIENT. Quote Link to comment Share on other sites More sharing options...
DERPZ774 Posted August 23, 2022 Author Share Posted August 23, 2022 2 minutes ago, Luis_ST said: Move your EventHandler in a client only class, you can achieve this by setting the value "value" in the EventBusSubscriber annotation to Dist#CLIENT. Doing this fixed the server issue, however now the client wont load https://hastebin.com/yunamudeqi.properties Code : @Mod.EventBusSubscriber(modid = FalloutMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class ModEventClientBusEvents { @SubscribeEvent public static void clientSetup(final FMLClientSetupEvent event) { ItemBlockRenderTypes.setRenderLayer(ModBlocks.LAMP.get(), RenderType.cutout()); ModItemProperties.addCustomItemProperties(); MenuScreens.register(ModMenuTypes.NUKA_COLA_OPENER_MENU.get(), NukaColaOpenerScreen::new); EntityRenderers.register(ModEntityTypes.TEST.get(), TestRenderer::new); } @SubscribeEvent public static void renderPlayerPre(RenderPlayerEvent.Pre event) { if (event.getPlayer().getInventory().getArmor(2).is(ModItems.VAULT_SUIT.get())) { event.getRenderer().getModel().leftSleeve.visible = false; event.getRenderer().getModel().rightSleeve.visible = false; //event.getRenderer().getModel().hat.visible = false; event.getRenderer().getModel().jacket.visible = false; event.getRenderer().getModel().leftPants.visible = false; event.getRenderer().getModel().rightPants.visible = false; event.getRenderer().getModel().head.visible = false; } /// TODO: 8/19/2022 edit statements here for all armor /// TODO: 8/20/2022 Fix server crashing } @SubscribeEvent public static void registerArmorRenderer(final EntityRenderersEvent.AddLayers event) { GeoArmorRenderer.registerArmorRenderer(UnderArmorItem.class, new UnderArmorRenderer()); /// TODO: 8/19/2022 Armor renders here } } Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 23, 2022 Share Posted August 23, 2022 You register the Class to the ModEventBus but RenderPlayerEvent.Pre and EntityRenderersEvent.AddLayers requires the ForgeEventBus Quote Link to comment Share on other sites More sharing options...
DERPZ774 Posted August 23, 2022 Author Share Posted August 23, 2022 8 minutes ago, Luis_ST said: You register the Class to the ModEventBus but RenderPlayerEvent.Pre and EntityRenderersEvent.AddLayers requires the ForgeEventBus Wow I feel dumb now XD, tysm for all the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.