Jump to content

Recommended Posts

Posted

Hello,

 

I tried to make the player invisible at all by this code:

player.setInvisible(true);

 

But I noted that the armor and the held item still visible .... then I tried this code in addiction:

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

 

but nothing to do ... please help.

Posted
  On 2/5/2015 at 3:35 PM, Belpois said:

You could look for the items the player is wearing and set them to invisible too

 

How? I cant see any "Item.isVisible" property to modify ...

 

I think about something render prohibition instead...

Posted

I got this from the MC Wiki

 

http://minecraft.gamepedia.com/Potion

  Quote

Makes player model disappear and mobs will act neutral towards the player if the player is not wearing armor (leave chunk to perform). In splash form it is able to make mobs or other players invisible. Armor and items held in hand are not affected by this. Some mob 'Armor' (sheep's wool, mushrooms of a mooshroom, eyes of spiders/enderman, 'Arrows' and a snow golem's pumpkin) is still visible.

 

Seems like even vanilla MC doesn't hide the armor.

I require Java, both the coffee and the code :)

Posted
  Quote

I got this from the MC Wiki

 

http://minecraft.gamepedia.com/Potion

  Quote

Makes player model disappear and mobs will act neutral towards the player if the player is not wearing armor (leave chunk to perform). In splash form it is able to make mobs or other players invisible. Armor and items held in hand are not affected by this. Some mob 'Armor' (sheep's wool, mushrooms of a mooshroom, eyes of spiders/enderman, 'Arrows' and a snow golem's pumpkin) is still visible.

Seems like even vanilla MC doesn't hide the armor.

 

 

I think that was what he was referring to from the beginning.

 

@deenkayros

You could see what the Player.setInvisble do and do something similar with the items in hes inventory

or perhaps hook into the render and "temporary" stop it from rendering the items.

 

 

Naturalis - The easy way for nature.!

Esquire - A helping hand for your adventure.

Jimanju - The Random Disasters!

Posted
  On 2/5/2015 at 10:42 PM, diesieben07 said:

Canceling the RenderPlayerEvent should work fine.

 

yes, i tried this:

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

or

@SubscribeEvent
public void pre(RenderPlayerEvent event) {
	event.setCanceled(true);
}

 

But seems wont work ...

Posted

Main class:

@SidedProxy(clientSide = "ClientProxy", serverSide = "ServerProxy")

 

ClientProxy class:

public class ClientProxy
   extends CommonProxy
{
   public void registerEvents()
   {
     super.registerEvents();
     //FMLCommonHandler.instance().bus().register(new ServerTickHandler());
    }
}

 

ServerProxy class:

public class ServerProxy
   extends CommonProxy
{
   public void registerEvents()
   {
     super.registerEvents();
     //FMLCommonHandler.instance().bus().register(new ServerTickHandler());
   }
}

 

CommonProxy class:

public class CommonProxy
   implements IProxy
{
   public void registerEvents()
   {
     FMLCommonHandler.instance().bus().register(new ServerTickHandler());
   }
}

Posted
  On 2/5/2015 at 11:03 PM, diesieben07 said:

RenderPlayerEvent is a forge event, it will not be fired on FML's EventBus.

 

I added a new class:

 

RenderTickHandler class:

public class RenderTickHandler {

@SubscribeEvent
public void pre(RenderPlayerEvent event) {
	//if (event.entityPlayer.isInvisible()) {
		event.setCanceled(true);
	//}
}
}

 

And into CommonProxy:

       MinecraftForge.EVENT_BUS.register(new RenderTickHandler());

 

but nothing to do...

Posted
  On 2/5/2015 at 11:20 PM, diesieben07 said:

You need to cancel the Pre version of the event. And that should make all players invisible on screen.

 

Yes, i do:

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

 

but seems can't fire this event at all ....

Posted
  On 2/5/2015 at 11:33 PM, diesieben07 said:

How are you testing this? Without other players online or in 3rd person this event will not fire.

 

oh, i need to do this strictly in 3rd person ... xD

Posted

I just wrote the code in my mod and it works, also in 3rd person mode. Obviously other players need to receive a packet to know that they don't have to show the player model.

 

Image:

 

  Reveal hidden contents

 

 

Start a different MC in debug mode and open to LAN so you can test this, with multiple players.

I require Java, both the coffee and the code :)

Posted
  On 2/6/2015 at 7:12 AM, Belpois said:

I just wrote the code in my mod and it works, also in 3rd person mode. Obviously other players need to receive a packet to know that they don't have to show the player model.

 

Image:

 

  Reveal hidden contents

 

 

Start a different MC in debug mode and open to LAN so you can test this, with multiple players.

 

What method or function you have used?

Posted
  On 2/6/2015 at 5:33 PM, deenkayros said:

  Quote

I just wrote the code in my mod and it works, also in 3rd person mode. Obviously other players need to receive a packet to know that they don't have to show the player model.

 

Image:

 

  Reveal hidden contents

 

 

Start a different MC in debug mode and open to LAN so you can test this, with multiple players.

 

What method or function you have used?

 

The same one that was mentioned in this forum:

 

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

 

The class I implemented it in, is hooked with both the Forge Event bus and FML event bus. Try both see which one will trigger it.

I require Java, both the coffee and the code :)

Posted
  On 2/6/2015 at 6:24 PM, diesieben07 said:

  Quote
Try both see which one will trigger it.

No. Please no.

 

Ok ok, I checked it's the forge event bus :) Hooking it up with the forge event bus makes it work.

 

Even armor is hidden and anything in my hand.

 

PPPatternClientGuiManager ppPatternClientGuiManager = new PPPatternClientGuiManager();
MinecraftForge.EVENT_BUS.register(ppPatternClientGuiManager);
this.guiManagers.put(GuiPPPattern.class, ppPatternClientGuiManager);

 

ignore the names, I just stuck it in a handler to check if the code works or not :P

I require Java, both the coffee and the code :)

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Yes that’s the full log, I managed to get it working last night, the anvil fix mod is what was causing it to crash
    • Hey guys, i'm currently developping a mod with forge 1.12.2 2860 and i'm using optifine and gradle 4.9. The thing is i'm trying to figure out how to show the player's body in first person. So far everything's going well since i've try to use a shader. The player's body started to blink dark when using a shader. I've try a lot of shader like chocapic, zeus etc etc but still the same issue. So my question is : How should i apply the current shader to the body ? At the same time i'm also drawing a HUD so maybe it could be the problem?   Here is the issue :    And here is the code where i'm trying to display the body :    private static void renderFirstPersonBody(EntityPlayerSP player, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); try { // Préparation OpenGL GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.enableAlpha(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // Éclairage correct pour shaders GlStateManager.enableLighting(); RenderHelper.enableStandardItemLighting(); GlStateManager.enableRescaleNormal(); // Active la lightmap pour les shaders mc.entityRenderer.enableLightmap(); // Position de rendu interpolée double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; GlStateManager.translate( px - mc.getRenderManager().viewerPosX, py - mc.getRenderManager().viewerPosY, pz - mc.getRenderManager().viewerPosZ ); // Rendu du joueur sans la tête Render<?> render = mc.getRenderManager().getEntityRenderObject(player); if (render instanceof RenderPlayer) { RenderPlayer renderPlayer = (RenderPlayer) render; boolean oldHeadHidden = renderPlayer.getMainModel().bipedHead.isHidden; boolean oldHeadwearHidden = renderPlayer.getMainModel().bipedHeadwear.isHidden; renderPlayer.getMainModel().bipedHead.isHidden = true; renderPlayer.getMainModel().bipedHeadwear.isHidden = true; setArmorHeadVisibility(renderPlayer, false); renderPlayer.doRender(player, 0, 0, 0, player.rotationYaw, partialTicks); renderPlayer.getMainModel().bipedHead.isHidden = oldHeadHidden; renderPlayer.getMainModel().bipedHeadwear.isHidden = oldHeadwearHidden; setArmorHeadVisibility(renderPlayer, !oldHeadwearHidden); } // Nettoyage post rendu mc.entityRenderer.disableLightmap(); GlStateManager.disableRescaleNormal(); } catch (Exception e) { // silent fail } finally { GlStateManager.popAttrib(); GlStateManager.popMatrix(); } }   Ty for your help. 
    • Item successfully registered, but there was a problem with the texture of the item, it did not insert and has just the wrong texture.     
    • Keep on using the original Launcher Run Vanilla 1.12.2 once and close the game Download Optifine and run optifine as installer (click on the optifine jar) Start the launcher and make sure the Optifine profile is selected - then test it again  
    • Hi everyone, I’m hoping to revisit an old version of Minecraft — specifically around Beta 1.7.3 — for nostalgia’s sake. I’ve heard you can do this through the official Minecraft Launcher, but I’m unsure how to do it safely without affecting my current installation or save files. Are there any compatibility issues I should watch out for when switching between versions? Would really appreciate any tips or advice from anyone who’s done this before! – Adam
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.