Search the Community
Showing results for tags 'rendering'.
-
Hi, I want to make a client-only mod, everything is ok, but when I use shaders, none of the textures rendered in RenderLevelStageEvent nor the crow entity model are rendered, I want them to be visible, because it's a horror themed mod Here is how i render the crow model in the CrowEntityRenderer<CrowEntity>, by the time i use this method, i know is not the right method but i don't think this is the cause of the problem, the renderType i'm using is entityCutout @Override public void render(CrowEntity p_entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) { super.render(p_entity, entityYaw, partialTick, poseStack, bufferSource, packedLight); ClientEventHandler.getClient().crow.renderToBuffer(poseStack, bufferSource.getBuffer(ClientEventHandler.getClient().crow .renderType(TEXTURE)), packedLight, OverlayTexture.NO_OVERLAY, Utils.rgb(255, 255, 255)); } Here renderLevelStage @Override public void renderWorld(RenderLevelStageEvent e) { horrorEvents.draw(e); } Here is how i render every event public void draw(RenderLevelStageEvent e) { for (HorrorEvent event : currentHorrorEvents) { event.tick(e.getPartialTick()); event.draw(e); } } Here is how i render the crow model on the event @Override public void draw(RenderLevelStageEvent e) { if(e.getStage() == RenderLevelStageEvent.Stage.AFTER_ENTITIES) { float arcProgress = getArcProgress(0.25f); int alpha = (int) Mth.lerp(arcProgress, 0, 255); int packedLight = LevelRenderer.getLightColor(Minecraft.getInstance().level, blockPos); VertexConsumer builder = ClientEventHandler.bufferSource.getBuffer(crow); Crow<CreepyBirdHorrorEvent> model = ClientEventHandler .getClient().crow; model.setupAnim(this); RenderHelper.renderModelInWorld(model, position, offset, e.getCamera(), e.getPoseStack(), builder, packedLight, OverlayTexture.NO_OVERLAY, alpha); builder = ClientEventHandler.bufferSource.getBuffer(eyes); RenderHelper.renderModelInWorld(model, position, offset, e.getCamera(), e.getPoseStack(), builder, 15728880, OverlayTexture.NO_OVERLAY, alpha); } } How i render the model public static void renderModelInWorld(Model model, Vector3f pos, Vector3f offset, Camera camera, PoseStack matrix, VertexConsumer builder, int light, int overlay, int alpha) { matrix.pushPose(); Vec3 cameraPos = camera.getPosition(); double finalX = pos.x - cameraPos.x + offset.x; double finalY = pos.y - cameraPos.y + offset.y; double finalZ = pos.z - cameraPos.z + offset.z; matrix.pushPose(); matrix.translate(finalX, finalY, finalZ); matrix.mulPose(Axis.XP.rotationDegrees(180f)); model.renderToBuffer(matrix, builder, light, overlay, Utils .rgba(255, 255, 255, alpha)); matrix.popPose(); matrix.popPose(); } Thanks in advance
-
Hello, I've decided I want to replace the default player model with a custom one but can't quite seem to figure it out. I'm somewhat new to minecraft modding so please forgive me if I'm missing something obvious. My code is also a bit jumbled and nothing atm (been deleting any code that hasn't been working) and imports things that aren't being used as I've been doing a lot of experimenting with this problem. I've read through probably every other existing topic on rendering player models but their solutions don't seem to quite translate to my particular issue. My PlayerRenderOverride class can't access the render method since the render is static. On a side note, I have successfully been able to render mobs using my model and renderer files. My replacement code package net.grem.bioniclemod.playerrender; import net.grem.bioniclemod.BionicleMod; import net.grem.bioniclemod.entity.custom.ToaModelLayers; import net.grem.bioniclemod.entity.custom.toamodel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.gameevent.GameEvent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import java.util.EventObject; @Mod.EventBusSubscriber(modid = BionicleMod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class PlayerRenderOverride { public static toamodel model; @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre e) { e.setCanceled(true); ToaPlayerRenderer.render(e.getEntity(), 0f, 0f, e.getPoseStack(), 0f, 0f); } } My render code package net.grem.bioniclemod.playerrender; import com.mojang.blaze3d.vertex.PoseStack; import net.grem.bioniclemod.BionicleMod; import net.grem.bioniclemod.entity.custom.ToaModelLayers; import net.grem.bioniclemod.entity.custom.toamodel; import net.minecraft.client.player.AbstractClientPlayer; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.LivingEntityRenderer; import net.minecraft.resources.ResourceLocation; public class ToaPlayerRenderer extends LivingEntityRenderer<AbstractClientPlayer, toamodel<AbstractClientPlayer>>{ public ToaPlayerRenderer(EntityRendererProvider.Context pContext, boolean pUseSlimModel) { super(pContext, new toamodel<>(pContext.bakeLayer(ToaModelLayers.toalayer)), 0.5F); // this.addLayer(new ToaArmorLayer -- doesn't exist yet. do later } @Override public void render(AbstractClientPlayer pEntity, float pEntityYaw, float pPartialTicks, PoseStack pPoseStack, MultiBufferSource pBuffer, int pPackedLight){ super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight); } @Override public ResourceLocation getTextureLocation(AbstractClientPlayer pEntity) { return new ResourceLocation(BionicleMod.MODID, "textures/entity/toa.png"); } } My model file package net.grem.bioniclemod.entity.custom;// Made with Blockbench 4.11.0-beta.1 // Exported for Minecraft version 1.17 or later with Mojang mappings // Paste this class into your mod and generate all required imports import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.world.entity.Entity; public class toamodel<T extends Entity> extends HierarchicalModel<T> { // This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor private final ModelPart toa; private final ModelPart body; private final ModelPart right_leg; private final ModelPart left_leg; private final ModelPart torso; private final ModelPart head; private final ModelPart brain; private final ModelPart right_arm; private final ModelPart left_arm; public toamodel(ModelPart root) { this.toa = root.getChild("toa"); this.body = root.getChild("toa").getChild("body"); this.right_leg = root.getChild("toa").getChild("body").getChild("right_leg"); this.left_leg = root.getChild("toa").getChild("body").getChild("left_leg"); this.torso = root.getChild("toa").getChild("body").getChild("torso"); this.head = root.getChild("toa").getChild("body").getChild("head"); this.brain = root.getChild("toa").getChild("body").getChild("head").getChild("brain"); this.right_arm = root.getChild("toa").getChild("body").getChild("right_arm"); this.left_arm = root.getChild("toa").getChild("body").getChild("left_arm"); } public static LayerDefinition createBodyLayer() { MeshDefinition meshdefinition = new MeshDefinition(); PartDefinition partdefinition = meshdefinition.getRoot(); PartDefinition toa = partdefinition.addOrReplaceChild("toa", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F)); PartDefinition body = toa.addOrReplaceChild("body", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition right_leg = body.addOrReplaceChild("right_leg", CubeListBuilder.create().texOffs(24, 47).mirror().addBox(-1.5F, 5.7394F, -2.5568F, 3.0F, 7.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-2.5F, -12.75F, 0.0F)); PartDefinition cube_r1 = right_leg.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(26, 38).mirror().addBox(-1.0F, -16.0F, -2.0F, 2.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 15.95F, -2.15F, -0.1745F, 0.0F, 0.0F)); PartDefinition cube_r2 = right_leg.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(25, 32).mirror().addBox(0.0F, -1.5F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-1.5F, 0.25F, 0.0F, 0.7418F, 0.0F, 0.0F)); PartDefinition left_leg = body.addOrReplaceChild("left_leg", CubeListBuilder.create().texOffs(24, 47).addBox(1.0F, -7.0106F, -3.0568F, 3.0F, 7.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.5F)); PartDefinition cube_r3 = left_leg.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(26, 38).addBox(-1.0F, -16.0F, -2.0F, 2.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.5F, 3.2F, -2.65F, -0.1745F, 0.0F, 0.0F)); PartDefinition cube_r4 = left_leg.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(25, 32).addBox(0.0F, -1.5F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0F, -12.5F, -0.5F, 0.7418F, 0.0F, 0.0F)); PartDefinition torso = body.addOrReplaceChild("torso", CubeListBuilder.create().texOffs(58, 34).addBox(-8.0F, -23.75F, -0.5F, 2.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(58, 34).addBox(-18.0F, -23.75F, -0.5F, 2.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(20, 23).addBox(-16.0F, -23.75F, -1.0F, 8.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)) .texOffs(45, 43).addBox(-15.0F, -13.0F, -0.5F, 6.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(44, 34).addBox(-15.0F, -16.0F, -1.0F, 6.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)) .texOffs(40, 19).addBox(-15.5F, -23.5F, -3.0F, 7.0F, 6.0F, 5.0F, new CubeDeformation(0.0F)) .texOffs(48, 30).addBox(-13.0F, -18.0F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) .texOffs(48, 37).addBox(-13.0F, -15.0F, -1.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) .texOffs(50, 11).addBox(-13.0F, -29.0F, -1.0F, 2.0F, 6.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(12.0F, 0.0F, 0.0F)); PartDefinition cube_r5 = torso.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(40, 30).addBox(0.0F, -1.0F, 0.0F, 4.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.0353F, -14.8863F, -0.5F, 0.0F, 0.0F, -1.309F)); PartDefinition cube_r6 = torso.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(40, 30).mirror().addBox(-4.0F, -1.0F, 0.0F, 4.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-14.9647F, -14.8863F, -0.5F, 0.0F, 0.0F, 1.309F)); PartDefinition head = body.addOrReplaceChild("head", CubeListBuilder.create().texOffs(21, 11).addBox(-1.5F, 0.0F, -4.45F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)) .texOffs(19, 17).addBox(-2.0F, 2.05F, -3.45F, 4.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)) .texOffs(6, 10).addBox(0.0094F, 0.0F, -3.1379F, 3.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)) .texOffs(6, 10).mirror().addBox(-3.0094F, 0.0F, -3.1379F, 3.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false) .texOffs(23, 0).addBox(-0.5F, -4.6985F, -2.7399F, 1.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -27.5F, -0.55F)); PartDefinition cube_r7 = head.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(24, 4).addBox(0.0F, -4.0F, 0.0F, 1.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.5F, -0.9397F, -4.108F, -0.3491F, 0.0F, 0.0F)); PartDefinition cube_r8 = head.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(18, 7).mirror().addBox(-2.0F, -2.0F, 0.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-0.4075F, -2.4747F, -2.8121F, -0.1278F, 0.0283F, 0.2164F)); PartDefinition cube_r9 = head.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(16, 10).mirror().addBox(-2.0F, -3.0F, 0.0F, 3.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-1.0568F, 0.4292F, -3.1944F, -0.1278F, 0.0283F, 0.2164F)); PartDefinition cube_r10 = head.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(18, 7).addBox(0.0F, -2.0F, 0.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.4075F, -2.4747F, -2.8121F, -0.1278F, -0.0283F, -0.2164F)); PartDefinition cube_r11 = head.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(16, 10).addBox(-1.0F, -3.0F, 0.0F, 3.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0568F, 0.4292F, -3.1944F, -0.1278F, -0.0283F, -0.2164F)); PartDefinition cube_r12 = head.addOrReplaceChild("cube_r12", CubeListBuilder.create().texOffs(17, 17).mirror().addBox(-0.9393F, -1.0F, -0.3536F, 2.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.0685F, 1.0F, -3.4873F, 0.0F, 0.7156F, 0.0F)); PartDefinition cube_r13 = head.addOrReplaceChild("cube_r13", CubeListBuilder.create().texOffs(17, 17).addBox(-1.0607F, -1.0F, -0.3536F, 2.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0685F, 1.0F, -3.4873F, 0.0F, -0.7156F, 0.0F)); PartDefinition cube_r14 = head.addOrReplaceChild("cube_r14", CubeListBuilder.create().texOffs(18, 4).mirror().addBox(0.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, 0.9F, -5.0F, -0.3914F, 0.0334F, 0.0807F)); PartDefinition cube_r15 = head.addOrReplaceChild("cube_r15", CubeListBuilder.create().texOffs(18, 4).addBox(-2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.5F, 0.9F, -5.0F, -0.3914F, -0.0334F, -0.0807F)); PartDefinition brain = head.addOrReplaceChild("brain", CubeListBuilder.create().texOffs(39, 3).addBox(-2.0F, -4.0515F, -0.5601F, 4.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(44, 0).addBox(-2.0F, -6.0F, 0.0F, 4.0F, 5.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 2.3015F, -2.4899F)); PartDefinition right_arm = body.addOrReplaceChild("right_arm", CubeListBuilder.create().texOffs(0, 34).mirror().addBox(-1.5F, 1.6F, -10.25F, 3.0F, 4.0F, 6.0F, new CubeDeformation(0.0F)).mirror(false) .texOffs(0, 18).mirror().addBox(-1.5F, -1.5F, -1.25F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-5.5F, -23.0F, -0.25F, 0.9861F, 0.0F, 0.0F)); PartDefinition cube_r16 = right_arm.addOrReplaceChild("cube_r16", CubeListBuilder.create().texOffs(0, 24).mirror().addBox(-1.0F, -2.0F, 0.0F, 2.0F, 3.0F, 7.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 4.8F, -5.0F, 0.637F, 0.0F, 0.0F)); PartDefinition left_arm = body.addOrReplaceChild("left_arm", CubeListBuilder.create().texOffs(0, 34).addBox(-1.5F, 1.6F, -10.25F, 3.0F, 4.0F, 6.0F, new CubeDeformation(0.0F)) .texOffs(0, 18).addBox(-1.5F, -1.5F, -1.25F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(5.5F, -23.0F, -0.25F, 1.0036F, 0.0F, 0.0F)); PartDefinition cube_r17 = left_arm.addOrReplaceChild("cube_r17", CubeListBuilder.create().texOffs(0, 24).addBox(-2.0F, -2.0F, 0.0F, 2.0F, 3.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0F, 4.8F, -5.0F, 0.637F, 0.0F, 0.0F)); return LayerDefinition.create(meshdefinition, 64, 64); } @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { // no anims yet } @Override public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { toa.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } @Override public ModelPart root(){ return toa; } }
-
Title explains it all, I think. I'm attempting to make an armor set that extends from DyeableArmorItem instead of ArmorItem and for some reason the armor model's color is not changing in-game. While the dye crafting recipes work, the resulting "tint colors" are not showing up on my character or on the inventory icon (except for the "Dyed" tag). Any assistance?
-
It's a custom pack really just for me. I have some experience but don't really know what I'm doing. It was working before but I updated some mods and I can't remember which, notably not Cobblemon. I don't rally know if it's right to put this here, but I don't really know what to do I've tried a bunch of stuff uninstalling and reinstalling mods, uninstalling Oculus and Embeddium Extras, changing Embeddium for other Sodium ports. I don't want to get rid of Cobblemon and i need some performance mod. Please any help is appreciated at your leisure Debug Log Crash Log
-
Hey there everyone, I'm building a Minecraft mod inspired by the Fallout series using Forge. My goal is to create an immersive Fallout 76-like experience, including a completely overhauled inventory system centered around a Pip-Boy. Core features: Custom Pip-Boy Interface: Replacing the default Minecraft inventory with a visually appealing Pip-Boy GUI, styled after the Fallout series. Pip-Boy Activation: Accessing the inventory only when a specific Pip-Boy item is equipped. Tab-based Organization: Implementing tabs and subtabs (STATS, ITEMS, DATA, RADIO) for efficient item management. Weight-Based Inventory: Using a weight system instead of limited slots for a more realistic inventory experience. 3D Pip-Boy Model: Rendering a 3D Pip-Boy model within the custom inventory GUI for enhanced immersion. My current Challenges: Resource Scarcity: Difficulty finding up-to-date and comprehensive Minecraft modding tutorials that align with my project's scope. Inventory Overhaul: Replacing the default inventory system with a custom Pip-Boy interface while maintaining core functionality. GUI Development: Creating a visually appealing and functional Pip-Boy GUI, including the integration of a 3D model. Weight System Implementation: Balancing item weights and player carrying capacity for a realistic and engaging experience. I'm seeking guidance on: Efficient GUI creation techniques and best practices. Methods for overriding the default inventory system. Strategies for implementing a weight-based inventory system. Tips for integrating a 3D model into a 2D GUI. I'm open to suggestions for libraries or frameworks that could streamline the development process. While I have experience with programming languages like PHP and C#, I'm relatively new to Java, so clear explanations would be greatly appreciated. Any advice, code snippets, or recommendations would be invaluable. Thank you for your time and expertise!
-
So, I have found the reason why Distant Horizons has been unable to keep the chunks loaded: Something in the Alex's Caves mod is preventing DH from rendering. However, I don't want to get rid of Alex's Caves, as it is a part of my personal modded experience. Can someone please find the issue for me?
-
Hello, I want to make it so that a certain part of my mob model is rendered as a portal to the end. Using the second layer I was able to render a second model with the portal effect, but I don't need the whole model. How to fix this? (This is a test mob, I want to render its head as a portal). Current code: Constructor of Renderer public MegovidRenderer(EntityRendererProvider.Context pContext) { super(pContext, new MegovidModel<>(pContext.bakeLayer(ModModelLayers.MEGOVID_LAYER)), 0.5f); this.addLayer(new MegovidHeadRenderer(this)); } Register renderer @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { EntityRenderers.register(ModEntities.MEGOVID.get(), MegovidRenderer::new); } HeadRenderer public class MegovidHeadRenderer<T extends LivingEntity> extends RenderLayer<T, MegovidModel<T>> { private static final RenderType GATEWAY = RenderType.endGateway(); public MegovidHeadRenderer(RenderLayerParent<T, MegovidModel<T>> pRenderer) { super(pRenderer); } @Override public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, T t, float v, float v1, float v2, float v3, float v4, float v5) { poseStack.pushPose(); poseStack.translate(0,-2,0); this.getParentModel().renderToBuffer( poseStack, multiBufferSource.getBuffer(this.renderType()), 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); poseStack.popPose(); } private RenderType renderType() { return GATEWAY; } } Result:
-
I have every compat (wood good) along with other mods, so when i try them in creative the game crashes when sliding tabs in the inventory screen (key E), particularly when reaching the 4th section of the inventory. The mod version is 1.6.4 (1.18.2). Is there any way to solve it? Crash log in the link. https://github.com/MehVahdJukaar/WoodGood/issues/567
-
I want to make a custom sky, moon, sun, fog, etc. How would I do this?
- 2 replies
-
- 1.20.1
- dimensions
-
(and 1 more)
Tagged with:
-
Hi, I was wondering how to make a "screenspace texture" like the background of the end portal (not including the moving stars). This is an example of what I want: I have taken a look at the vanilla shader files, but I don't know how to use the effect for myself. Any help would be great,
-
The version I am in is 1.20.1 and i am using GeckoLib 4.4.4. So I am making a mob that can be tamed and when you right-click it, you can access its inventory. How would I make it so when I give the mob an item, it displays it on its model like how a horse displays horse armor?
-
Here is my code: @Mod.EventBusSubscriber(modid = Mod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class PlayerRenderModifications { @SubscribeEvent public static void prePlayerRender(RenderPlayerEvent.Pre evt) { RenderSystem.setShaderColor(0.0F, 1.0F, 1.0F, 1.0F); } @SubscribeEvent public static void postPlayerRender(RenderPlayerEvent.Post evt) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); } } This code is supposed to tint the player blue, however it doesn't tint the player at all (yes i know it only runs in f5 mode or when rendering players in multiplayer). I had also done some testing and it seems if I remove "postPlayerRender" then it tints the player, and also tints everything else that renders after the player (like other entities, clouds, etc.) If you need me to provide other information then go ahead and ask!
-
I got a working post processing shader inside assets/shaders/post but now I'm stuck at, having my mod run the shader. How would I go about that?
-
So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI) I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
-
Hi everyone! I'm learning modding on forge 1.16.5 and want to make the Leviathan Axe from the God of War games, but I'm facing two problems: 1) The entity model in the air and on the ground when thrown is not rendered 2) There's no sound of picking up the axe Moreover, when thrown, the entity itself spawns, that is, it causes damage, falls, creates sounds of falling and hitting other entities, but the axe model is not visible. I registered the renderer in the doClientStuff method in the main class of the mod, but still the model is not rendered. Renderer class: LeviathanAxeRenderer Model class: LeviathanAxeModel Entity class: LeviathanAxeEntity Item Class: LeviathanAxeItem I hope this information is enough to help me resolve the issue, if not I will be happy to provide more. I would be very grateful for your help, I’ve been struggling with this for a day now and can’t figure out what the problem is
-
I succeeded in rendering quads. However, they go dark when players are above them. Like these picture : https://drive.google.com/file/d/1zdbiE-pmGk3VuLy5ZSPtPDo-4UpHcKsa/view?usp=sharing https://drive.google.com/file/d/1AgJv2ncXjqRGh_oTURNCtVdMfDWws8s2/view?usp=sharing Is there something wrong with my codes? public class RenderTester implements BlockEntityRenderer<BlockEntityTester> { private static final ResourceLocation GRAVEL_TEXTURE = new ResourceLocation("textures/block/gravel.png"); public RenderTester (BlockEntityRendererProvider.Context context) {} @Override public void render(@NotNull BlockEntityTester pBlockEntity, float pPartialTick, @NotNull PoseStack pPoseStack, @NotNull MultiBufferSource pBuffer, int pPackedLight, int pPackedOverlay) { VertexConsumer builder = pBuffer.getBuffer(RenderType.entityCutoutNoCull(GRAVEL_TEXTURE)); BufferUtil.drawQuad(builder, pPoseStack, 0.0F, 1.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.0F, 1.0F, 1.0F, pPackedLight, pPackedOverlay, 0xFFFFFFFF); } } public class BufferUtil { public static void drawVertex(VertexConsumer builder, PoseStack poseStack, float x, float y, float z, float u, float v, int packedLight, int pPackedOverlay, int color) { builder.vertex(poseStack.last().pose(), x, y, z) .color(color) .uv(u, v) .overlayCoords(pPackedOverlay) .uv2(packedLight) .normal(0, 1, 0) .endVertex(); } public static void drawQuad(VertexConsumer builder, PoseStack poseStack, float x0, float y0, float z0, float x1, float y1, float z1, float u0, float v0, float u1, float v1, int packedLight, int pPackedOverlay, int color) { drawVertex(builder, poseStack, x0, y0, z0, u0, v0, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x0, y1, z1, u0, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y1, z1, u1, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y0, z0, u1, v0, packedLight, pPackedOverlay, color); } }
-
I have made a post shader with all of it's files (in post and program) being finished, it's just an edited creeper post shader for now. How do I load it ingame? Minecraft.getInstance().gameRenderer.loadEffect(new ResourceLocation("thedefused:shaders/post/creep.json")); This just gives an error due to it trying to find program in minecraft:shaders/program However, I have seen multiple mods use post shaders. how?
-
I have been researching existing topics related to this question for a while, but unfortunately, they are all outdated. I tried to understand the principle of such rendering from the debug code (displaying the view direction, displaying hitboxes), but to no avail. In one of the topics (Forum link) where this question was discussed, there was a reference to "some really old code, but has the relevant math" (GitHub link), which I tried to update (spoiler below), but it didn't yield any results. Nothing gets rendered. Does anyone know of projects that use custom rendering of simple shapes (lines/squares/circles) so that I can investigate their source code? Or can anyone help fix existing code? In general, any information on this matter would be helpful) More information about the code: The code is called for two blocks located on the same level. The initiation of this code call is through the RenderLevelStageEvent event, where the getStage method returns the value AFTER_TRIPWIRE_BLOCKS. The drawLine method is precisely called on the necessary blocks, and there are no error messages during this process.
-
Hi, I'm having an issue with my block entities (it's currently two) where the model isn't rendering correctly. Not only is there no texture, but the custom model also isn't there; it appears as the standard Minecraft square. I'm not sure why this is happening, because I used the exact same method for another block entity and the model works perfectly fine. I checked the .json file and it's referencing everything correctly. Even weirder, the item model is completely fine; it's just an issue when I place it. Below I'll send the .json and the Block class of one of the block entities. If you need any more files, I'd be glad to send them! .json file: { "credit": "Made with Blockbench", "texture_size": [128, 128], "textures": { "0": "darkcollective:block/fabricatormk1", "particle": "darkcollective:block/fabricatormk1" }, "elements": [ { "name": "fabricator", "from": [1, 8, -6], "to": [2, 16, -5], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [0.875, 0.125, 1, 1.125], "texture": "#0"}, "east": {"uv": [0.75, 0.125, 0.875, 1.125], "texture": "#0"}, "south": {"uv": [1.125, 0.125, 1.25, 1.125], "texture": "#0"}, "west": {"uv": [1, 0.125, 1.125, 1.125], "texture": "#0"}, "up": {"uv": [1, 0.125, 0.875, 0], "texture": "#0"}, "down": {"uv": [1.125, 0, 1, 0.125], "texture": "#0"} } }, { "name": "fabricator", "from": [0, 8, 0], "to": [16, 16, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2, 2, 4, 3], "texture": "#0"}, "east": {"uv": [0, 2, 2, 3], "texture": "#0"}, "south": {"uv": [6, 2, 8, 3], "texture": "#0"}, "west": {"uv": [4, 2, 6, 3], "texture": "#0"}, "up": {"uv": [4, 2, 2, 0], "texture": "#0"}, "down": {"uv": [6, 0, 4, 2], "texture": "#0"} } }, { "name": "fabricator", "from": [1, 0, 0], "to": [15, 8, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2, 5, 3.75, 6], "texture": "#0"}, "east": {"uv": [0, 5, 2, 6], "texture": "#0"}, "south": {"uv": [5.75, 5, 7.5, 6], "texture": "#0"}, "west": {"uv": [3.75, 5, 5.75, 6], "texture": "#0"}, "up": {"uv": [3.75, 5, 2, 3], "texture": "#0"}, "down": {"uv": [5.5, 3, 3.75, 5], "texture": "#0"} } }, { "name": "fabricator", "from": [15, 0, 4], "to": [16, 7, 12], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [4.25, 8.875, 4.375, 9.75], "texture": "#0"}, "east": {"uv": [3.25, 8.875, 4.25, 9.75], "texture": "#0"}, "south": {"uv": [5.375, 8.875, 5.5, 9.75], "texture": "#0"}, "west": {"uv": [4.375, 8.875, 5.375, 9.75], "texture": "#0"}, "up": {"uv": [4.375, 8.875, 4.25, 7.875], "texture": "#0"}, "down": {"uv": [4.5, 7.875, 4.375, 8.875], "texture": "#0"} } }, { "name": "fabricator", "from": [0, 0, 4], "to": [1, 7, 12], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [6.75, 8.5, 6.875, 9.375], "texture": "#0"}, "east": {"uv": [5.75, 8.5, 6.75, 9.375], "texture": "#0"}, "south": {"uv": [7.875, 8.5, 8, 9.375], "texture": "#0"}, "west": {"uv": [6.875, 8.5, 7.875, 9.375], "texture": "#0"}, "up": {"uv": [6.875, 8.5, 6.75, 7.5], "texture": "#0"}, "down": {"uv": [7, 7.5, 6.875, 8.5], "texture": "#0"} } }, { "name": "fabricator", "from": [1, 16, -14], "to": [2, 17, 2], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [8, 3, 8.125, 3.125], "texture": "#0"}, "east": {"uv": [6, 3, 8, 3.125], "texture": "#0"}, "south": {"uv": [10.125, 3, 10.25, 3.125], "texture": "#0"}, "west": {"uv": [8.125, 3, 10.125, 3.125], "texture": "#0"}, "up": {"uv": [8.125, 3, 8, 1], "texture": "#0"}, "down": {"uv": [8.25, 1, 8.125, 3], "texture": "#0"} } }, { "name": "fabricator", "from": [0, 16, 3], "to": [16, 28, 5], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2.5, 6.375, 4.5, 7.875], "texture": "#0"}, "east": {"uv": [2.25, 6.375, 2.5, 7.875], "texture": "#0"}, "south": {"uv": [4.75, 6.375, 6.75, 7.875], "texture": "#0"}, "west": {"uv": [4.5, 6.375, 4.75, 7.875], "texture": "#0"}, "up": {"uv": [4.5, 6.375, 2.5, 6.125], "texture": "#0"}, "down": {"uv": [6.5, 6.125, 4.5, 6.375], "texture": "#0"} } }, { "name": "fabricator", "from": [3, 17, 2], "to": [13, 27, 3], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [6.875, 6.25, 8.125, 7.5], "texture": "#0"}, "east": {"uv": [6.75, 6.25, 6.875, 7.5], "texture": "#0"}, "south": {"uv": [8.25, 6.25, 9.5, 7.5], "texture": "#0"}, "west": {"uv": [8.125, 6.25, 8.25, 7.5], "texture": "#0"}, "up": {"uv": [8.125, 6.25, 6.875, 6.125], "texture": "#0"}, "down": {"uv": [9.375, 6.125, 8.125, 6.25], "texture": "#0"} } }, { "name": "fabricator", "from": [14, 16, -14], "to": [15, 17, 2], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2, 8, 2.125, 8.125], "texture": "#0"}, "east": {"uv": [0, 8, 2, 8.125], "texture": "#0"}, "south": {"uv": [4.125, 8, 4.25, 8.125], "texture": "#0"}, "west": {"uv": [2.125, 8, 4.125, 8.125], "texture": "#0"}, "up": {"uv": [2.125, 8, 2, 6], "texture": "#0"}, "down": {"uv": [2.25, 6, 2.125, 8], "texture": "#0"} } }, { "name": "fabricator", "from": [14, 8, -6], "to": [15, 16, -5], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [1.375, 0.125, 1.5, 1.125], "texture": "#0"}, "east": {"uv": [1.25, 0.125, 1.375, 1.125], "texture": "#0"}, "south": {"uv": [1.625, 0.125, 1.75, 1.125], "texture": "#0"}, "west": {"uv": [1.5, 0.125, 1.625, 1.125], "texture": "#0"}, "up": {"uv": [1.5, 0.125, 1.375, 0], "texture": "#0"}, "down": {"uv": [1.625, 0, 1.5, 0.125], "texture": "#0"} } }, { "name": "fabricator", "from": [7, 16, -14], "to": [9, 17, 2], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [7.5, 6, 7.75, 6.125], "texture": "#0"}, "east": {"uv": [5.5, 6, 7.5, 6.125], "texture": "#0"}, "south": {"uv": [9.75, 6, 10, 6.125], "texture": "#0"}, "west": {"uv": [7.75, 6, 9.75, 6.125], "texture": "#0"}, "up": {"uv": [7.75, 6, 7.5, 4], "texture": "#0"}, "down": {"uv": [8, 4, 7.75, 6], "texture": "#0"} } }, { "name": "fabricator", "from": [7, 8, -6], "to": [9, 16, -5], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [0.125, 0.125, 0.375, 1.125], "texture": "#0"}, "east": {"uv": [0, 0.125, 0.125, 1.125], "texture": "#0"}, "south": {"uv": [0.5, 0.125, 0.75, 1.125], "texture": "#0"}, "west": {"uv": [0.375, 0.125, 0.5, 1.125], "texture": "#0"}, "up": {"uv": [0.375, 0.125, 0.125, 0], "texture": "#0"}, "down": {"uv": [0.625, 0, 0.375, 0.125], "texture": "#0"} } } ], "display": { "thirdperson_righthand": { "rotation": [70, 0, 0], "translation": [0, 1, 0.25], "scale": [0.25, 0.25, 0.25] }, "thirdperson_lefthand": { "rotation": [70, 0, 0], "scale": [0.25, 0.25, 0.25] }, "firstperson_righthand": { "scale": [0.4, 0.4, 0.4] }, "firstperson_lefthand": { "scale": [0.4, 0.4, 0.4] }, "ground": { "scale": [0.4, 0.4, 0.4] }, "gui": { "rotation": [0, 126, 0], "translation": [0, -2.75, 0], "scale": [0.5, 0.5, 0.5] }, "fixed": { "translation": [0, -1.5, 0], "scale": [0.4, 0.4, 0.4] } }, "groups": [ { "name": "fabricator", "origin": [8, 0, 8], "color": 0, "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] } ] } Block class: private static final VoxelShape SHAPE = makeShape(); public FabricatorMK1(BlockBehaviour.Properties properties) { super(properties); } @Override public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext ctx) { return SHAPE; } @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return BlockEntityInit.FABRICATORMK1_ENTITY.get().create(pos, state); } @Override public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) { if(state.getBlock() != newState.getBlock()){ BlockEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof FabricatorMK1Entity){ ((FabricatorMK1Entity) blockEntity).drops(); } } } @Override public RenderShape getRenderShape(BlockState state) { return RenderShape.MODEL; } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { super.createBlockStateDefinition(builder); builder.add(HorizontalDirectionalBlock.FACING); } @Nullable @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { return defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, ctx.getHorizontalDirection().getOpposite()); } @Override public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand interactionHand, BlockHitResult result) { if(!level.isClientSide()) { BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FabricatorMK1Entity) { NetworkHooks.openScreen(((ServerPlayer)player), (FabricatorMK1Entity)entity, pos); } else { throw new IllegalStateException("Our Container provider is missing!"); } } return InteractionResult.sidedSuccess(level.isClientSide()); } @Nullable @Override public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) { if(level.isClientSide()) { return null; } return createTickerHelper(type, BlockEntityInit.FABRICATORMK1_ENTITY.get(), (level1, pos, state1, blockEntity) -> blockEntity.tick(level1, pos, state1)); } public static VoxelShape makeShape(){ VoxelShape SHAPE = Shapes.empty(); SHAPE = Shapes.join(SHAPE, Shapes.box(0.0625, 0.5, -0.375, 0.125, 1, -0.3125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0, 0.5, 0, 1, 1, 1), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.0625, 0, 0, 0.9375, 0.5, 1), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.9375, 0, 0.25, 1, 0.4375, 0.75), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0, 0, 0.25, 0.0625, 0.4375, 0.75), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.0625, 1, -0.875, 0.125, 1.0625, 0.125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0, 1, 0.1875, 1, 1.75, 0.3125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.1875, 1.0625, 0.125, 0.8125, 1.6875, 0.1875), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.875, 1, -0.875, 0.9375, 1.0625, 0.125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.875, 0.5, -0.375, 0.9375, 1, -0.3125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.4375, 1, -0.875, 0.5625, 1.0625, 0.125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.4375, 0.5, -0.375, 0.5625, 1, -0.3125), BooleanOp.OR); return SHAPE; } I also have a GitHub where you can find the necessary files for the Fabricator (Block entity in question):https://github.com/giornoggiovanna/DarkCollectiveGit Thanks for the help!
-
Hello there I have been trying to rotate player upside down but can`t for some reason I tried many events and codes but still not able and the latest code I used is this package net.skatric.tutorialmod.event; import com.mojang.math.Axis; import net.minecraft.client.model.PlayerModel; import net.minecraft.client.player.AbstractClientPlayer; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.skatric.tutorialmod.TutorialMod; import org.lwjgl.opengl.GL11; @Mod.EventBusSubscriber(modid = TutorialMod.MOD_ID,bus = Mod.EventBusSubscriber.Bus.FORGE) public class bodyrotation { static boolean checking = false; @SubscribeEvent public static void event(RenderPlayerEvent.Pre event) { if (checking == false) { checking = true; PlayerModel<AbstractClientPlayer> model = event.getRenderer().getModel(); event.getPoseStack().mulPose(Axis.XN.rotationDegrees(0f)); event.getPoseStack().mulPose(Axis.YN.rotationDegrees(0f)); event.getPoseStack().mulPose(Axis.ZN.rotationDegrees(180f)); } } }
-
How to make an entity have a short animation when an event is triggered?
-
Topic for making tags
-
- 1.10.2
- 1.11.2
-
(and 81 more)
Tagged with:
- 1.10.2
- 1.11.2
- 1.12.2
- 1.13.2
- 1.14.4
- 1.15.2
- 1.16.5
- 1.17.1
- 1.18.2
- 1.19.0
- 1.19.1
- 1.19.2
- 1.19.3
- 1.19.4
- 1.2.5
- 1.20.0
- 1.3.2
- 1.4.7
- 1.5.2
- 1.6.4
- 1.7.10
- 1.8.9
- 1.9.4
- armour
- bad jvm args
- biomes
- blocks
- broken mod
- bug
- capabilities
- client
- client-only mods on server
- codecs
- commands
- dimensions
- effects
- enchantments
- entities
- events
- feature request
- fluids
- food
- gradle
- groovy
- guis
- ide
- installer
- items
- java
- kotlin
- launcher
- libraries
- loot
- metadata
- missing jar association
- missing java
- missing mods
- mixin
- needs more info
- networking
- news
- optifine
- ores
- out of memory
- outdated drivers
- particles
- performance
- porting
- potions
- recipes
- registries
- rendering
- scala
- server
- solved
- sounds
- textures
- tools
- tutorial
- weapons
- worldgen
- wrong java version
- wrong mod version