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.

JooseMann

Members
  • Joined

  • Last visited

Everything posted by JooseMann

  1. Ah, alright. I got it working with the use of ScreenEvent.Render.Post, which I hadn't known about prior. Thank you!
  2. Hi there, I am trying to add an image to the screen when the inventory is opened. So far, I've been able to get the image working (using RenderSystem and blit()), but it always appears behind the inventory (in other words, if you put one over the other, only the inventory will show). I have tried to use RenderSystem.depthFunc(519); (or depthFunc()) to set the image in front, but it still is displayed behind. (Also, just a heads up, the code doesn't bind the image to the mouse like I thought it would, but that is just for testing). Clearly, I'm missing something here. What function allows an image to be rendered in front of the inventory? Thanks, and if you see this then have a nice day My code so far: public static ResourceLocation LOCK = new ResourceLocation(ExampleMod.MOD_ID, "textures/gui/lock-opaque.png"); @SubscribeEvent public static void onGuiRender(RenderGuiOverlayEvent.Post event) { if (Minecraft.getInstance().player != null && Minecraft.getInstance().screen instanceof InventoryScreen) { renderOverlay(event.getPoseStack(), (int) Minecraft.getInstance().mouseHandler.xpos(), (int) Minecraft.getInstance().mouseHandler.ypos()); } } public static void renderOverlay(PoseStack poseStack, int x, int y) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f); RenderSystem.setShaderTexture(0, LOCK); RenderSystem.enableDepthTest(); RenderSystem.depthFunc(519); blit(poseStack, x, y, 0, 0, 16, 16, 16, 16); RenderSystem.depthFunc(515); RenderSystem.disableDepthTest(); }
  3. Hi there! I am currently trying to create a feature where an event is triggered when the player drops an item, and I want to stop the player from dropping it if a boolean is set to true. What event can I use to do this? I've looked at other events and I can't seem to find one that isn't deprecated. A few that I've tried are things like onItemToss, onPlayerDropItem, and onPlayerDestroyItem, but they all appear to be deprecated and not functional. With this in mind, what other event is out there that could work for my project? 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.