[[Template core/global/global/includeCSS is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] 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.

Half530

Members
  • Joined

  • Last visited

Everything posted by Half530

  1. Hello everyone. I am having an issue with some GUI rendering I am trying to perform in my mod. I want to add a full screen multiple frame effect, and it all works, aside from that the transparent parts of the images are black and obscure vision. I don't actually know much about GUI code, so a lot of this code is straight from the part of Minecraft that renders the pumpkin overlay, with some changes to add the multiple frame effect: public class TimeSkipEffectGUI extends AbstractGui { public static final Minecraft mc = Minecraft.getInstance(); public void renderEffect() { PlayerEntity player = mc.player; if (mc.world == null) return; if (player == null) return; Stand.getLazyOptional(player).ifPresent(props -> { if (props.getTimeSkipEffectTicker() > 0) { RenderSystem.disableDepthTest(); RenderSystem.depthMask(false); RenderSystem.defaultBlendFunc(); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation(DiamondIsUncraftable.MOD_ID, "textures/gui/timeskip/time_skip" + (16 - props.getTimeSkipEffectTicker()) + ".png")); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); bufferbuilder.pos(0.0D, mc.getMainWindow().getScaledHeight(), -90.0D).tex(0.0F, 1.0F).endVertex(); bufferbuilder.pos(mc.getMainWindow().getScaledWidth(), mc.getMainWindow().getScaledHeight(), -90.0D).tex(1.0F, 1.0F).endVertex(); bufferbuilder.pos(mc.getMainWindow().getScaledWidth(), 0.0D, -90.0D).tex(1.0F, 0.0F).endVertex(); bufferbuilder.pos(0.0D, 0.0D, -90.0D).tex(0.0F, 0.0F).endVertex(); tessellator.draw(); RenderSystem.depthMask(false); RenderSystem.enableDepthTest(); RenderSystem.enableAlphaTest(); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); } }); } } The images I am using are transparent in all other settings I have tested them in. I am wondering, do I need entirely new rendering code, or can this code be adapted with some setting changes? It confuses me how the pumpkin overlay texture has transparency in it and works yet these images don't.
  2. Thank you for the quick response. I tried to interpret what you said and came out with this: clone = entityIn.getLowestRidingEntity(); clone.writeUnlessPassenger(entityIn.serializeNBT()); EntityType.loadEntityAndExecute(entityIn.serializeNBT(), world, Function.identity()); world.addEntity(clone); However, something feels off about it. First of all, EntityType.func_220335_a wasn't there, so I presumed it was loadEntityAndExecute because it required nbt. That is the first possible mistake on my part. Secondly, I feel like I may have misinterpreted your psuedocode, because I feel as if entityIn.getLowestRidingEntity() is redundant. Could you please elaborate on how these functions are meant to click together? Most of my Minecraft coding so far has been motion and math, so thank you for the help and dealing with me. Edit: clone is defined as a LivingEntity
  3. Hello everyone, I have recently come across the need for a function that gets fed in a LivingEntity and will create another entity of the same type, almost like cloning. I am coding in forge 1.15.2 31.2.36.. The main issue I have is getting the Entity to be the same type without a large if-else statement. I only starting coding with forge about 3 months ago, so this may be something obvious I haven't learned yet. Thank you!

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.