• Posts

    • I do know coding in Java. The only things I am struggeling with are the classes from minecraft as I don't know which are there and how to use them. Yeah I changed it, I did not recognize, that I tried something different there and forgot to type it back.    
    • So I've made an entity that has a part of the model that is a translucent cube, and now I'm trying to render an item from the entity within that translucent cube. I can see that the item is rendering, since it peeks out of the cube a bit, but I can't see the item through the translucent cube. I'm not that great with rendering since I've only recently begun modding Minecraft, so I need a bit of help figuring out how to get the item to be visible through the translucent cube.     Here is what it looks like.         Here is the renderer class that it uses.   package me.bluemond.bluemagic.client.entity.renderer; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import me.bluemond.bluemagic.BlueMagic; import me.bluemond.bluemagic.client.entity.model.EmpowermentEntityModel; import me.bluemond.bluemagic.entities.EmpowermentEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.model.EntityModel; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.util.ResourceLocation; import software.bernie.geckolib.render.IModelRenderer; public class EmpowermentEntityRenderer extends EntityRenderer<EmpowermentEntity> implements IModelRenderer { protected static final ResourceLocation TEXTURE = new ResourceLocation(BlueMagic.MOD_ID, "textures/entity/empowerment_entity.png"); protected final EmpowermentEntityModel empowermentModel = new EmpowermentEntityModel(); public EmpowermentEntityRenderer(EntityRendererManager renderManager) { super(renderManager); this.shadowSize = 0.5f; } @Override public void render(EmpowermentEntity entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn) { this.empowermentModel.setRotationAngles(entityIn, partialTicks, 0.0F, -0.1F, 0.0F, 0.0F); this.empowermentModel.setLivingAnimations(entityIn, 0, 0, partialTicks); IVertexBuilder iVertexBuilder = bufferIn.getBuffer(RenderType.getEntityTranslucent(this.getEntityTexture(entityIn))); this.empowermentModel.render(matrixStackIn, iVertexBuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn); if(entityIn.getPotionStack() != null){ matrixStackIn.push(); matrixStackIn.translate(0, 1, 0); matrixStackIn.scale(0.5F, 0.5F, 0.5F); Minecraft.getInstance().getItemRenderer().renderItem(entityIn.getPotionStack(), ItemCameraTransforms.TransformType.FIXED, packedLightIn, OverlayTexture.NO_OVERLAY, matrixStackIn, bufferIn); matrixStackIn.pop(); } } @Override public ResourceLocation getEntityTexture(EmpowermentEntity entity){ return TEXTURE; } @Override public EntityModel getEntityModel() { return this.empowermentModel; } }
    • Have you tried using the debugger to find out why the exception occurs? If it is line 57, the problem is almost certainly that containmentField is null. Perhaps it never get initialized to a value?
  • Topics

  • Who's Online (See full list)