Posted November 26, 20168 yr Hello, i'm trying to make an armor model only animated when a player presses a button. The issue is that when the player presses the button the animation is done on the armor for all the entities that are wearing this armor (ArmorStand, Player, etc) while i want it to only animate for the player that pressed the button. @Override public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); this.body1.rotateAngleY = 0.0F; if (PhoenixCraftKeyBindings.flyWings.isKeyDown()) { ModelBiped armorModel = PhoenixCraft.proxy.getArmorModel(0); this.body1.rotateAngleY = 0.5F + MathHelper.cos(ageInTicks * 0.6662F) * 0.4F / 1.0F; } }
November 26, 20168 yr Hello, i'm trying to make an armor model only animated when a player presses a button. The issue is that when the player presses the button the animation is done on the armor for all the entities that are wearing this armor (ArmorStand, Player, etc) while i want it to only animate for the player that pressed the button. @Override public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); this.body1.rotateAngleY = 0.0F; if (PhoenixCraftKeyBindings.flyWings.isKeyDown()) { ModelBiped armorModel = PhoenixCraft.proxy.getArmorModel(0); this.body1.rotateAngleY = 0.5F + MathHelper.cos(ageInTicks * 0.6662F) * 0.4F / 1.0F; } } Sounds like you will need to use a capability to store if the Armor should be animated on a specific entity. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 26, 20168 yr Well of course they all animate. They all use the same model and all get rendered the same way, including keybind check. You make no attempt to distinguish which armor is currently being rendered. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 26, 20168 yr How could i check which armor is being rendered? Sounds like you will need to use a capability to store if the Armor should be animated on a specific entity. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 27, 20168 yr Author I tried looking through tutorials about capabilities and i couldn't figure out a way to store if the Armor should be animated on a specific entity. ._.
November 27, 20168 yr I tried looking through tutorials about capabilities and i couldn't figure out a way to store if the Armor should be animated on a specific entity. ._. How about storing a boolean, or even a byte to differentiate between render and dont render. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 28, 20168 yr Author IRender rendered = entityIn.getCapability(RenderProvider.IS_RENDERED, null); if (PhoenixCraftKeyBindings.flyWings.isKeyDown() && rendered.getIsRendered() == 1) { this.body1.rotateAngleY = 0.5F + MathHelper.cos(ageInTicks * 0.6662F) * 0.4F / 1.0F;} this seems to cause the armor to not render when the button is pressed ._.
November 28, 20168 yr IRender rendered = entityIn.getCapability(RenderProvider.IS_RENDERED, null); if (PhoenixCraftKeyBindings.flyWings.isKeyDown() && rendered.getIsRendered() == 1) { this.body1.rotateAngleY = 0.5F + MathHelper.cos(ageInTicks * 0.6662F) * 0.4F / 1.0F;} this seems to cause the armor to not render when the button is pressed ._. Does rendered.getIsRendered()'s value ever changed to a 1? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
December 2, 20168 yr Author I do have an eventhandler that changes it to 1 when the player is rendered @SubscribeEvent public void onPlayerRendered(RenderPlayerEvent event) { EntityPlayer player = event.getEntityPlayer(); Entity entity = event.getEntity(); IRender rendered = entity.getCapability(RenderProvider.IS_RENDERED, null); rendered.setIsRendered(1); }
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.