[Help] Need to render item in geckolib entity hand (any item in slot 1 of entity)
Abdulhanan535 opened this issue ยท 1 comments
code i'm trying to edit
package net.mcreator.accompany.entity.layer;
import software.bernie.geckolib3.renderers.geo.IGeoRenderer;
import software.bernie.geckolib3.renderers.geo.GeoLayerRenderer;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.Entity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.MultiBufferSource;
import net.mcreator.accompany.entity.TalonEntity;
import java.util.concurrent.atomic.AtomicReference;
import com.mojang.blaze3d.vertex.PoseStack;
public class HandLayer extends GeoLayerRenderer {
public static ResourceLocation LAYER_DEFAULT = new ResourceLocation("accompany", "textures/entities/talon.png");
public ResourceLocation MODEL = new ResourceLocation("accompany", "geo/talon.geo.json");
private ResourceLocation currentTexture;
public HandLayer(IGeoRenderer<?> entityRendererIn) {
super(entityRendererIn);
this.currentTexture = LAYER_DEFAULT;
}
@Override
public void render(PoseStack matrixStackIn, MultiBufferSource bufferIn, int packedLightIn, Entity entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
RenderType cameo = RenderType.armorCutoutNoCull(currentTexture);
matrixStackIn.pushPose();
matrixStackIn.scale(1.0f, 1.0f, 1.0f);
matrixStackIn.translate(0.0d, 0.0d, 0.0d);
this.getRenderer().render(this.getEntityModel().getModel(MODEL), entityLivingBaseIn, partialTicks, cameo, matrixStackIn, bufferIn, bufferIn.getBuffer(cameo), packedLightIn, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f);
matrixStackIn.popPose();
}
}