Problems removing multiple different items from inventory at once.

Started by Ghoulander on

Topic category: Help with modding (Java Edition)

Last seen on 22:00, 20. Sep 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Problems removing multiple different items from inventory at once.

So I have a GUI setup as sort of a "Quest Box"

The GUI has 5 input boxes. The first 4 are the required items and the 5th is the rewarded item.

My procedure checks if the player has the all four of the items in the inventory. Removes the four items and awards the 5th input box item.

My problem is, is that it is removing four of the first item in my inventory and not 1 of each item.

Here is a pic of the procedure.

https://ibb.co/Nnfv5Ct

 

 

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try using the print block to…
Fri, 02/12/2021 - 09:47

try using the print block to print out the items in slot 0 - 3 and see if its correct

Last seen on 22:00, 20. Sep 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Even with just Print Block…
Fri, 02/12/2021 - 18:12

Even with just Print Block and Get Item From Slot 0 If Block Has Inventory nothing prints.

If I take items from the slots 2 and 3 and leave just 0 and 1, it does the same thing but takes two of the same items

instead of the 1 of each of the two items I have in there.

*Shrug*

I should probably mention I am using 2020.2 as well.

Yes. I know. I should upgrade. But my mod needs to work with another mod *cough* customnpcs *cough* and it is still way behind on updates unfortunately. ;(

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you know the print code…
Sat, 02/13/2021 - 02:05

you know the print code block prints to the console right?

you're gonna need to start learning these debug principles to find your bugs, because thats the only way bugs are found.

Last seen on 22:00, 20. Sep 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well Ahznb. I am ashamed to…
Mon, 02/15/2021 - 01:38

Well Ahznb. I am ashamed to admit I did not know that but am eternally grateful for you pointing a noob in the right direction! Thanks!

 

That being said, I found my problem.

In the input blocks, I was using 4 different saplings, just for testing sakes.

So I swapped that out with tnt, an acacia door, a redstone block and dirt and it worked flawlessly.

So the input blocks will have to be checked for damage going forward to detect variants of saplings?

 

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yes. for mc 1.12.2 different…
Mon, 02/15/2021 - 03:42

yes. for mc 1.12.2 different saplings are the same "Sapling" block with different properties, and the properties is contained in the "damage" field.