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.

Featured Replies

Posted

(I'm used to coding with other languages but Java is kind of new for me) I'm trying to create a totem of undying-ish item that gets used upon death. Everything is working, except I can't remove the item using clearMatchingItems. On the docs (https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.9.4-12.17.0.2051/net/minecraft/entity/player/InventoryPlayer.html#clearMatchingItems-net.minecraft.item.Item-int-int-net.minecraft.nbt.NBTTagCompound-) it says that the method needs an item, a metadata, and an int, but in my IDE (Eclipse) it says I need a predicate <itemstack> instead of an item (maybe the docs I'm looking at are outdated). My question is, how am I supposed to use predicate with Itemstack, and if I need a metadata how I would use it?

Edited by ketchup_god

3 hours ago, ketchup_god said:

how am I supposed to use predicate with Itemstack, and if I need a metadata how I would use it?

Metadata is old you are looking at outdated docs. A predicate is just an interface with one function you can use a lambda for it. The predicate is supposed to determine if the ItemStack passed as a parameter matches the item you want to remove.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.