Java
how do get the "Name" of the item?
how do get the "Name" of the item?
An Item [] contains an Item object in each array slot, that means that to get the name of each item you need to call the .getName method of the Item object.
i.e. write: Invent[i].getName().equals(Pack)
This Code I posted, when there somethuing that is there, it works Fine, I want it to say "Not Fouind." it Shows the Igtem Info
i'm trying call ths from the
PlayerCommandEvent, could that be the prolem? it stll will NOT show the item name.
no that can't be the problem.
ok I just saw what you are trying to do and that if is impossible to access, like if the first part is true which will always be if an item is in the slot the second part will never trigger, and when the second part triggers, i.e. the slot is empty, thus null so it has no name to get.
Don’t have an account yet? Create a new account now and be part of our community!