• 1

    posted a message on How to use the Render Player API with Forge ?

    Hello everyone,

    I'd like to create a mod that changes the player model. I found the RenderPlayerAPI on this forums but I've no clue on how to use it.

    On the forum page it said how to install it and how to adapt my mod to it, but that's not clear.

    I don't know how to register my RenderPlayer Class.

    I've tried

    RenderPlayerAPI.register("modid", RenderPlayer.class);


    But then when I launch the game it crashes. When I remove this line it doesn't.


    Does someone know how to use it or can somebody give me a link to a good tutorial ?

    Thank you

    Posted in: Modification Development
  • 0

    posted a message on How to render a mob model instead of the player model ?

    You should be able to just rotate in the model or in the render call

    How can I do that ?

    Posted in: Modification Development
  • 0

    posted a message on How to render a mob model instead of the player model ?

    Thank you for your answer :)

    The horse model was a mistake I made, because when I noticed the creeper didn't work, I tried a different mob, and then I changed it back and forgot to change the model.


    Thanks to your help, I managed to render a creeper with his texture, but it renders upside down (it's head is on the floor)

    This is the code I used:

    public class RenderCreeperMorph extends RenderLivingBase<EntityLivingBase> {
    	private ModelCreeper model = new ModelCreeper();
    	
    	public RenderCreeperMorph(ModelCreeper model) {
    		super(Minecraft.getMinecraft().getRenderManager(), model, 1.0F);
    		this.model = model;
    	}
    	
    	public void render(EntityPlayer player) {
    		doRender(player, player.posX, player.posY, player.posZ, player.rotationYaw, 1F);
    		model.render(player, player.limbSwing, player.limbSwingAmount, 1, player.rotationYaw, player.rotationPitch, 0.07F);
    	}
    
    	@Override
    	protected ResourceLocation getEntityTexture(EntityLivingBase entity) {
    		return new ResourceLocation("minecraft:textures/entity/creeper/creeper.png");
    	}
    
    }

    And then I called the RenderCreeperMorph#render method inside the onRenderPlayer method with the player as parameter.

    I could just create another Creeper model and flip every part, but please let me know if there is any better solution.

    Thank you

    Posted in: Modification Development
  • 0

    posted a message on How to render a mob model instead of the player model ?

    Hi, I want to replace the player's model by a mob's model (ex: a creeper).

    How can I do this with Minecraft Forge 1.12 ?


    That's what I've tried:

    @SubscribeEvent
    	public void onRenderPlayer(RenderPlayerEvent.Pre e) {
    		e.setCanceled(true);
    		ModelHorse model = new ModelHorse();
    		EntityLivingBase entity = e.getEntityLiving();
    		EntityCreeper creeper = new EntityCreeper(entity.getEntityWorld());
    		creeper.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
    		creeper.setEntityInvulnerable(true);
    		RenderCreeper render = new RenderCreeper(Minecraft.getMinecraft().getRenderManager());
    		render.prepareScale(creeper, 0);
    		render.doRender(creeper, entity.posX, entity.posY, entity.posZ, entity.rotationYaw, 0);
    	}
    
    But that only results in the player being invisible.
    Thank you for your help.
    Posted in: Modification Development
  • 0

    posted a message on How to use RenderingRegistry.registerEntityRenderingHandler in 1.12

    Thank you, that was the problem, I had it in the init event, no it works !

    Posted in: Modification Development
  • 0

    posted a message on How to use RenderingRegistry.registerEntityRenderingHandler in 1.12

    I tried

    		RenderingRegistry.registerEntityRenderingHandler(EntityWizard.class, new IRenderFactory() {
    
    			@Override
    			public Render<? super EntityWizard> createRenderFor(RenderManager manager) {
    				System.out.println("creating renderer");
    				return new RenderWizard(manager, new ModelWizard(), 1.0F);
    			}
    		});

    But the "creating renderer" message doesn't show up in the console and the entity renders as a white box.

    The problem is not related to the model because when I use the deprecated way it works

    Posted in: Modification Development
  • 0

    posted a message on How to use RenderingRegistry.registerEntityRenderingHandler in 1.12

    Hello everyone. I made a new entity, but I have an issue when I'm registering the renderer:

    What I use (it works but it is deprecated):

    RenderingRegistry.registerEntityRenderingHandler(EntityWizard.class, new RenderWizard(mc.getRenderManager(), new ModelWizard(), 1.0F));


    But the problem is that this method is deprecated, so what should I use instead ? Thank you !

    Posted in: Modification Development
  • 0

    posted a message on My block doesn't exist in game

    Ok thank you that solved my problem !

    Posted in: Modification Development
  • 0

    posted a message on My block doesn't exist in game

    Block class: https://pastebin.com/g4Khem07

    EventListener / registry class: https://pastebin.com/duzmvArh

    WizBlocks class (wiz is the beginning of the mod name): https://pastebin.com/G38HLZ6P


    I hide the name of the mod for security purposes.

    I found out that the block actually exists when I use the setblock command, but I can't get it using /give

    Posted in: Modification Development
  • 0

    posted a message on My block doesn't exist in game

    I making a 1.12 mod, and I registered my block in my EventListener (I read on the forge docs that you have to) like this:

    @SubscribeEvent
    public void registerBlocks(RegistryEvent.Register<Block> event) {
    	IForgeRegistry<Block> reg = event.getRegistry();
    	reg.register(MainClass.BLOCK);
            System.out.println("Block registered");
    }

    EDIT: I found out that the block actually exists when I use the setblock command, but I can't get it using /give

    My eventlistener is working fine, the "Block registered" message shows up in the console, but the blocks aren't in the game, even when I try to give them to myself using

    /give @p modid:unlocalized_name

    but that doesn't work either. I created the model, blockstate, and item model files, and I added the texture. When I register my items, it works very well.

    Thank you for your help.

    Posted in: Modification Development
  • 0

    posted a message on [MojangAPI] How to get the access token of a player by its uuid / username.

    How can I get the Minecraft access token from a player by its unique id or his username ?

    Thank you

    Posted in: Discussion
  • 0

    posted a message on FMLCommonHandler.instance().bus() is Deprecated. What should I use

    Thank you for your answer ! I'll try that right away.

    Posted in: Modification Development
  • 0

    posted a message on Programs to Make Mods?

    If you realy want to make a mod without programming use MCreator (but I recommend learning Java).


    And Jabelar, I ofter read your blog, could you update it to 1.12 ? Thank you

    Posted in: Modification Development
  • 0

    posted a message on FMLCommonHandler.instance().bus() is Deprecated. What should I use

    Hi, I want to use the ServerTickEvent, but I need to register the Event handler using FMLCommonHandler.instance().bus().register(), but this method is deprecated in Forge 1.12. Any ideas on what method I should use instead ?

    Thank you

    Posted in: Modification Development
  • To post a comment, please or register a new account.