Posted April 18, 20205 yr (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 April 19, 20205 yr by ketchup_god
April 18, 20205 yr 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.