#httpspaste md 5 netyocibuniqa java

1 messages · Page 1 of 1 (latest)

snow ocean
#

support

#

alright let me take a look

steady flare
#

k

ocean bluff
#

are u using intellij?

steady flare
#

I have 2 other classes that I know work as I have tested them

snow ocean
#

Don't return BasketballMode in the command

steady flare
#

no

snow ocean
steady flare
#

ok

snow ocean
#

and you never actually registered the command

steady flare
#

wdym?

#

it works for the other classes

#

so idk

snow ocean
#

getCommand("whatever your command is").setExecutor(this);

In the onEnabled()

#

Send me the other classes too

steady flare
#

ok

ocean bluff
#

pretty sure that's a command

steady flare
snow ocean
#

Ah I think I see

#

You're storing the entire entity

#

Store their UUID's

steady flare
#

you cant store a shooters UUID

#

therfor I us the entity

snow ocean
#

public static UUID hasBall

#

Sure you can

#

Cast it to a player

steady flare
#

lemme try it

steady flare
snow ocean
#
if (event.getEntity() instanceof Player player) {
Main.HasBall = player.getUniqueId();
}
steady flare
#

I want the shooter though

#

I already know how to get the entity

#

but you cannot get the UUID of a shooter

snow ocean
#

event.getShooter() is just an entity

#

under a different method name

#

it still returns an entity

steady flare
#

if you put .get the only other thing that comes up is .getClass

snow ocean
#

therefore you can cast it the same way

#
if (event.getShooter() instanceof Player player) {
Main.HasBall = player.getUniqueId();
}
steady flare
#

where would I put that?

snow ocean
#

Look I'm going to be completely honest with you, this is a horrible plugin idea if you're just learning how to code. I highly recommend making something simple like /fly or /feed, then start working up the difficulty slowly.

steady flare
#

OH i see the problem

#

i am trying to get the projectile shooter

steady flare
steady flare
#

ok so update, I think the problem was that a shot arrow is not an Item, I have to use a playerpickuparrowevent

#

and it worked

#

W