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.

ReVollve

Members
  • Joined

  • Last visited

Everything posted by ReVollve

  1. Thank you, i currently have no idea how to do that but ill find a way!
  2. Hey there! I am new to modding and got a problem with my mod! I am running forge:1.16.5-36.2.2 I created a button that (should) delete an item in a slot of a container. That container belongs to a block. The block has a Container, a ContainerScreen and a TileEntity. The slots work fine, i can put items in it and I can take Items out. The problem is a function, that deletes an item in a slot. Everytime that function gets called, the item disappears. When clicking the empty slot or closing and reopening the gui that item reappears Here is some code i tested public void destroyItem() { Slot slot = this.inventorySlots.get(0); ItemStack stack = slot.getStack(); Soulstones.LOGGER.info("TE ITEM: " + te.getItems().get(0).getDisplayName()); Soulstones.LOGGER.info("SLOT ITEM: " + slot.getStack().getDisplayName()); slot.putStack(ItemStack.EMPTY); te.setInventorySlotContents(0, ItemStack.EMPTY); NonNullList<ItemStack> items = te.getItems(); items.set(0, ItemStack.EMPTY); te.setItems(items); slot.onSlotChanged(); detectAndSendChanges(); Soulstones.LOGGER.info("TE ITEM: " + te.getItems().get(0).getDisplayName()); Soulstones.LOGGER.info("SLOT ITEM: " + slot.getStack().getDisplayName()); } The slot with index 0 is the correct slot. te is the TileEntity bound to this container. The logger also says that the ItemStack is empty. I hope anyone can help me with that.

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.