Started by
SackboyGamerYT
on
Topic category: Help with Minecraft modding (Java Edition)
Hi Everyone! How are you lot today? :)
I have been making a Mod, and i need to make a Event that detects more than 1 of the same item.
but there is no option for that in Conditions.
does someone know a substitute to it?
I recommend you make a for loop , that will iterate through players inventory and if it the item in the slot is equal to yours , use stackSize variable and check for the ItemStack size.
Something like:
for (ItemStack s : entity.inventory.mainInventory) {
if (s != null && s.getItem() == YOUR_ITEM) {
if(s.stackSize > 16){
}
}
}
@#1
where do you put that?
Propably in custom code.