Posted April 8, 20187 yr 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.
April 8, 20187 yr 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.
April 9, 20187 yr 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.