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

I've Tried this with success however I can't re-enable the rendering event so player remains invisible aswell as being unsure if this would just target one player or if it disables all. which isn't my intent..

@SubscribeEvent
public void pre(RenderPlayerEvent.Pre event) {
  if (RWBYSword.runhideevent){
	event.setCanceled(true);
  }
}

This has same problem as above not being able to reset the render of the player aswell as the problems of below.

    @SubscribeEvent
    public void renderPlayerPostEvent(RenderPlayerEvent.Post e) {

        FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
        EntityPlayer player = Minecraft.getMinecraft().player;
        ModelPlayer model = (ModelPlayer) e.getRenderer().getMainModel();

        if (e.getEntityPlayer() != null && e.getRenderer().getMainModel() instanceof ModelPlayer) {
            if (RWBYSword.runhideevent)
            model.bipedLeftArm.isHidden =
                    model.bipedLeftArmwear.isHidden =
                    model.bipedBody.isHidden =
                            model.bipedBodyWear.isHidden =
                                    model.bipedHead.isHidden =
                                            model.bipedHeadwear.isHidden =
                                                    model.bipedRightArm.isHidden =
                                                            model.bipedRightArmwear.isHidden =
                                                                    model.bipedLeftLeg.isHidden =
                                                                            model.bipedLeftLegwear.isHidden =
                                                                                    model.bipedRightLeg.isHidden =
                                                                                            model.bipedLeftLegwear.isHidden = true;

        }}

These all have similar effects ie armour and held item will still render which isn't what I'm trying to accomplish

player.setInvisible(true);
PotionEffect potioneff = new PotionEffect(MobEffects.INVISIBILITY, 10, 5, true, false);
playerIn.addPotionEffect(potioneff);

In Addition to These: Which didn't do anything, which I've put down to being deprecated as my event handler will fire the other events just fine

    @SubscribeEvent
    public void onArmorEvent(RenderPlayerEvent.SetArmorModel e) {
        if (e.getEntityPlayer() !=null) {
            if (RWBYSword.runhideevent){
                e.setCanceled(true);
        }}
    }

    @SubscribeEvent public void onSpecials(RenderPlayerEvent.Specials en){
        if (en.getEntityPlayer() !=null){
            if (RWBYSword.runhideevent){
            en.setCanceled(true);
        }}
    }

 

I'm open to any suggestions on how to get complete toggle-able invisibility of the target player as my attempts don't seem to be working.

the effect I'd like to achieve is very similar to /vanish from bukkit or similar. any help would be appreciated.

  • Author

Canceling the event does work. however as I said not entirely, It won't start rendering the player again unless you restart the game. I'm just wondering if there is a way to force the player to be rendered again after canceling the event as it doesn't seem to want to restart or render the player again on its own.

  • Author

Thanks for that information. it is much appreciated. I worked it out with a bit of a timer delay and have achieved the desired effect for the most part. however this currently cancels rendering of all players. is there a way to specify just one player say with a player instance? or something like that?

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.