Solved problem comparing itemstacks

Discussion in 'Plugin Development' started by Cat 700, Mar 17, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    Cat 700

    when I am comparing a itemstack with another itemstack it won't work how I want it to.

    code https://pastebin.com/a4WnTC4Z

    I have tried comparing it with == and .equals neither worked the way I want. the way I want is for it to run if the itemstacks don't equal each other
     
  2. Offline

    Tango_

    Do you get errors? Does your event fire correctly?
     
  3. Offline

    Cat 700

    @Tango_ it fires because I get the player.sendmsgs but they are given to me when they shouldn't be

    edit: I need help I have no idea what to do
     
    Last edited: Mar 17, 2020
  4. Offline

    yPedx

    @Cat 700
    You rare forgetting to return after a condition is met. E.g if savedList is empty, you do not return to stop executing the rest of the code.
     
  5. Offline

    Cat 700

    @yPedx that won't change my problem because even if I do return it just makes the loop exit earlier my problem is that when I try and see if the itemstack I get from event.getinventory.getitem(slot#) doesn't equals the other itemstack (that itemstack is just something that is given by a different class which is an api for a custom crafting inventory) but the if statement always runs now matter what even if the itemstacks equal each other


    edit: the other itemstack was wrong and I fixed that so now everything is working except when I set the result slot the item I set in there doesn't show up
     
    Last edited: Mar 17, 2020
Thread Status:
Not open for further replies.

Share This Page