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.

Featured Replies

Posted

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?

  • Author
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!

  • Author
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

Move your EventHandler in a client only class, you can achieve this by setting the value "value" in the EventBusSubscriber annotation to Dist#CLIENT.

  • Author
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
    }



}

 

You register the Class to the ModEventBus but RenderPlayerEvent.Pre and EntityRenderersEvent.AddLayers requires the ForgeEventBus

  • Author
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!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.