Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Animate vanilla model


Kahel
 Share

Recommended Posts

Hello, I've been looking all day to a way to animate any BidepModel (player, zombie, squelleton, any other biped, vanilla or not...) with the same animation/pose (all biped having the same "structure" arms, legs...).

My first approach was to use the render event hook that way:

    @SubscribeEvent 
    public void onRenderBiped(RenderLivingEvent.Pre event){
    	/*ICaster caster = CasterHandler.getCaster(event.getEntity());
    	if(caster!=null) {
    		ModelPlayer modelplayer = event.getRenderer().getMainModel();
    		modelplayer.bipedRightArm.
    	}*/
    	if(event.getRenderer().getMainModel() instanceof ModelBiped) {
    		event.setCanceled(true);
    		ModelBiped model = (ModelBiped)event.getRenderer().getMainModel();
    		model.bipedRightArm.rotateAngleX = 5f;
    	}
    }

but it does'nt work (because the rotate angle values are overrided by the model render method, and of course if I use RenderLivingEvent.Post the model is already rendered so it's too late).

 

I found some answers saying to create a custom BipedModel but it would mean to create as many Renderer as biped entity to override the vanilla BipedModel (and is it even possible?), plus would'nt it be a compatibility-killer?

 

Is there a better maintenable solution?

Link to comment
Share on other sites

You can force the model to skip normal rendering by canceling the event with event.setCanceled(true). The plus side is you'll be able to do exactly what you want with the model. The down side is you'll have to write the entire rendering method, including rendering sleeping/sneaking conditions as well as nameplates.

Edited by Azaka7
Link to comment
Share on other sites

4 minutes ago, Azaka7 said:

You can force the model to skip normal rendering by canceling the event with event.setCanceled(true). The plus side is you'll be able to do exactly what you want with the model. The down side is you'll have to write the entire rendering method, including rendering sleeping/sneaking conditions as well as nameplates.

I tough of this solution but imagine the render method changes in future versions or is used in other mods. It's kind the same problem as overriding the model. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I have my structure in .nbt format. When I click with my custom item on the ground it should place the structure. However, it only places one block from the bottom corner of the structure. When I try to walk, the player moves very slowly, like the wall structure is there. For some reason it's just not visible. After reopening the world, the structure is visible. My code:  if (world instanceof ServerLevel _serverworld) { StructureTemplate template = _serverworld.getStructureManager().getOrCreate(new ResourceLocation(TransportMod.MOD_ID, name)); if (template != null) { template.placeInWorld(_serverworld, new BlockPos((int) x, (int) y, (int) z), new BlockPos((int) x, (int) y, (int) z), new StructurePlaceSettings().setRotation(Rotation.NONE).setMirror(Mirror.NONE).setIgnoreEntities(true), _serverworld.random, 3); } } How make the structure visible right after placing? Or am I doing something wrong? Thanks in advance!
    • Hey im trying to make server side mod with some basic server commands currently im stuck getting text colored after loading it from a txt file i got the text show up fine but how would i go about getting it recognize color codes like §b or \u00A7b
    • do you mean going to java 7 or java 8 update 320?
    • I downloaded the server files for a 1.16.5 forge server server (forge-1.16.5-36.2.20) but when i run the .jar file it doesn't start up.   I also tried running it with the following .bat script : "C:\Program Files\Java\jre1.8.0_321\bin\javaw.exe" -Xmx4096M -Xms4096M -jar forgeserver.jar pause when I run the server it gives this log: [25jan2022 14:41:46.874] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.20, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge] [25jan2022 14:41:46.876] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_321 by Oracle Corporation [25jan2022 14:41:47.215] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [25jan2022 14:41:47.248] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/C:/Users/USER/Desktop/folder%20folder/servers/servers/lege%20folder/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=SERVER [25jan2022 14:41:48.005] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmlserver' with arguments [--gameDir, .] [25jan2022 14:41:48.063] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]: java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V [25jan2022 14:41:48.064] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.SecureJarHandler.createCodeSource(SecureJarHandler.java:66) [25jan2022 14:41:48.064] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:275) [25jan2022 14:41:48.065] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136) [25jan2022 14:41:48.065] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) [25jan2022 14:41:48.065] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.lang.ClassLoader.loadClass(Unknown Source) [25jan2022 14:41:48.066] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.lang.Class.forName0(Native Method) [25jan2022 14:41:48.066] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.lang.Class.forName(Unknown Source) [25jan2022 14:41:48.066] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) [25jan2022 14:41:48.067] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [25jan2022 14:41:48.067] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [25jan2022 14:41:48.067] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [25jan2022 14:41:48.068] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [25jan2022 14:41:48.068] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [25jan2022 14:41:48.068] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [25jan2022 14:41:48.068] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [25jan2022 14:41:48.069] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.server.ServerMain.main(ServerMain.java:57)    
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.