Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So far I have made this as my code:

package net.asestefan.mutationcraft.entity.client;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.asestefan.mutationcraft.Mutationcraft;
import net.asestefan.mutationcraft.entity.custom.InvokerEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemInHandRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import software.bernie.geckolib3.geo.render.built.GeoBone;
import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer;
import software.bernie.geckolib3.util.RenderUtils;

import javax.annotation.Nullable;

public class InvokerRenderer extends GeoEntityRenderer<InvokerEntity> {
InvokerEntity invoker;
public InvokerRenderer(EntityRendererProvider.Context context) {
super(context, new InvokerModel());
this.shadowRadius = 0.2f;
}
@Override
public void renderRecursively(GeoBone bone, PoseStack stack, VertexConsumer bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) {
if (bone.getName().equals("item")) {
stack.pushPose();
RenderUtils.translate(bone, stack);
stack.translate(0, -0.10, 0);
stack.scale(0.75f, 0.75f, 0.75f);
ItemStack itemstack = invoker.getMainHandItem();
if(!itemstack.isEmpty()){
Minecraft.getInstance().getItemRenderer().render(itemstack, ItemDisplayContext.THIRT_PERSON_RIGHT_HAND, packedLightIn, OverlayTexture.NO_OVERLAY, stack, bufferIn );
}
}
}






@Override
public ResourceLocation getTextureLocation(InvokerEntity instance) {
return new ResourceLocation(Mutationcraft.MOD_ID, "textures/entity/invoker.png");
}

@Override
public RenderType getRenderType(InvokerEntity animatable, float partialTicks, PoseStack stack,
@Nullable MultiBufferSource renderTypeBuffer,
@Nullable VertexConsumer vertexBuilder, int packedLightIn,
ResourceLocation textureLocation) {
return super.getRenderType(animatable, partialTicks, stack, renderTypeBuffer, vertexBuilder, packedLightIn, textureLocation);
}
}

But the highlighted text keeps giving me errors regardless of what I do, especially the "ItemDisplayContext.THIRD_PERSON_RIGHT_HAND" part. Please help :(

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.