#pyramid

1 messages · Page 1 of 1 (latest)

ornate mirage
#

okay

#

ensure you are using the right item

#

and that the check is running your intended branch

inland dagger
ornate mirage
#

for testing, reduce your IF mass to just 1 branch - the one you want to test out

inland dagger
#

i made the if statement just

if (p.getWorld().equals("lobby")) {
                    p.sendMessage(ChatColor.RED + "You can't locate POIs at spawn!");
                }```
#

but it still didnt work

ornate mirage
#

are you sure the item match is matching at all

inland dagger
#

yes, i added a console log after the event cancelles and it works

ornate mirage
#

print the name of the players world

#

print debug stuff

inland dagger
ornate mirage
#

also you're storing the itemstacks in a CommandExecutor?

#

oh I know

#

you're comparing World and String

#

like you're doing:

#
World.equals(String)```
#

Player.getWorld() returns a World

#

you want to equals on the world's name

inland dagger
#

this is what i have:

if (p.getWorld().equals("lobby"))```
#

how do i change that then?

#

oh like this? if (p.getWorld().getName().equals("lobby"))

ornate mirage
#

yes

inland dagger
#

ok thanks

ornate mirage
#

you were trying to compare World and String

#

not String and String