#(andrew_pape) Entity type not returning any value.

39 messages · Page 1 of 1 (latest)

desert osprey
#

So i'm trying to get info of a npc, my issue is that if that npc died it break the code an exemple of my code being send " &7Entity type: &f%citizen type of {_1}%" to {_p} (btw using skript + script citizen but going to stop using skript citizen since citizenapi is better but in anycase it doesn't work)

elder onyxBOT
#

(andrew_pape) NPC info buged when not spawned

elder onyxBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

tepid blaze
#

If you're using CitizensAPI/#1026104994149171200 we can help you out here, otherwise you'll want to ask Skript's support

desert osprey
#

well the issue would be from the api more i think but i'm not sure, i'm going to check if it's really the api or just the skript-citizen that is bad and break but i don,t think it's that

desert osprey
#

welp it was skript-citizen that was breaking the whole thing~~ but small question still, how would i get the entity type of the npc? i tried {_1}.getEntity() {_1} being the npc but it returns no value~~~~ (ima ask on the denizen forum)~~ (it was because the npc was despawned mb i should read the line more)

tepid blaze
#

#1026104994149171200 is just if you're trying to script you thing in Denizen, if you're using the Java API can ask here

#

And if you're using Skript should ask in their Discord

desert osprey
#

welp skript-reflect is an addon that let you use part of java inside of skript

#

i don't know what is denizen :P

tepid blaze
#

Another plugin we support here, it's a scripting plugin with built-in Citizens integration

#

No idea how Skript works, can either ask them or just explain what are you trying to do and we can give you a Java API example for you to convert

desert osprey
tepid blaze
#

I mean, no, I wouldn't know the specific keywords (e.g. send), the variable syntax (which I assume is the {_p} parts), etc.
And definitely wouldn't be able to give you working examples or help you with using their Citizens integration/reflection support

#

If you'd know how to convert Java API code to skript's reflection we can give you some examples, otherwise if you're using Skript you'll want to ask Skript's support for help

desert osprey
#

eh thats sure but send is to send a private message to the player so it's not that hard even though sometime you wonder how people did things, but yeah i made a forum on the denizen channel and it's more of a citizen api thing then skript on that part so i will just wait :)

tepid blaze
desert osprey
#

issue with skript-reflect is that people use the different library from the different plugin they use so there is no real way to help other than know what they talk about so i'm better just asking here xD

desert osprey
tepid blaze
#

No worries :p, will just close that thread then

desert osprey
#

thanks so yeah my issue is that it returns no value

#

(andrew_pape) Entity type not returning any value.

#

Coding using skript, skript-reflect and the Citizen API and when i try getting the entity type of the npc using {_1}.getEntity() or {_1}.callMethod("getType") and it doesn't return any value ({_1} being the npc) (I don't know if it's the correct usage but thats how i did it for previous class and they worked :P)

tepid blaze
#

Well, is the NPC spawned?

desert osprey
#

yep

#

oh wait mb if the npc is spawned it give me it's name

tepid blaze
#

Then getEntity should return a Bukkit Entity, which you can get a type from

desert osprey
#

well i would guess the name of the npc is not an entity :P

vestal gorge
#

getEntity.getType

#

You want

#

@desert osprey

desert osprey
# vestal gorge getEntity.getType

I,m not sure i understand, i tried {_1}.callMethod("getEntity.getType") and {_1}.getEntity.getType() but none of them returned a value

tepid blaze
#

That's how it works with the Java API, beyond that there's not much we can do if it specifically doesn't work in Skript - can maybe send Skript's support the Java code you're trying to use and ask for help Skript-ifying it

desert osprey
#

ok so thats how you use it, thats good to know i will check maybe on a skript-help discord :)

balmy slateBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@desert osprey