1. I'm trying to make a mod that replaces the player with a pig. This is purely visual and client-sided. I got pretty far, but I can't figure out where the function is that renders pigs.

    My code:
    Code:
        @SubscribeEvent
        public void replacePlayerWithPig(RenderPlayerEvent.Pre event) {
            event.setCanceled(true);
            Entity entity = EntityList.createEntityByID(90,event.entityPlayer.worldObj);
            event.renderer.renderPig(event.x, event.y, event.z, event.entityPlayer.rotationYaw); //Where i couldn't find out where pigs are rendered.
        }
     
    #1
  2. Search for it in Minecraft's source code.
     
    #2
  3. powns

    powns Well-Known Member

    powns
    MVP++
    Messages:
    3,408
    Best way to figure out how to do this is indeed by checking MC's source code. I believe you will need to call the entityrenderer used by pigs and cancel player rendering through the RenderPlayerEvent.
     
    #3

Share This Page