#Placeholders not working
1 messages · Page 1 of 1 (latest)
Update to latest dev build
I don't remember what the issue was, but once you're running latest dev build, unfortunately you may need to re-apply skins for all NPCs that were previously not working.
But I'm not 100% sure whether that is the case. In any case, let me know.
I have the latest devbuild
Can you give me an example of the placeholder you're using as well as the return value from /papi parse me (placeholder)?
What's the name? Does the player have cracked account? There's a known issue that skins of cracked players are printing a console error when being fetched.
I downgraded fancynpc and fancyhologram to version 2.4.2
There are premium accounts and cracked accounts
I will remain with version 2.4.2 for now
Well, latest dev build of FancyNpcs should fix the placeholder issue and the fix was confirmed to work by a few other people. However, there are still some problems with setting skins to invalid / cracked usernames. I think the most we can do is to suppress the console error and/or make plugin do not send request to the MineSkin API when invalid username is specified. In some cases it'd still require a call to the MojangAPI however.
It's impossible to support cracked players because they simply cannot have skins.
I just want it to work for premium players
I don't care about cracked players
It should already work on latest dev build
Not working for me
Did you re-apply the skin as I suggested?
Yes
Basically set it once again, eg. /npc skin (npc) %cmi_baltop_name_1%
Hmm
Will test in a moment
I have a test server also where I test this
If you want you can join the test server and test it yourself
It have same folia build and plugins as my survival server
I just se this in console
When I use this command
and /papi parse me %cmi_baltop_name_1% returns a player name, correct?
How are you even using PlaceholderAPI on Folia? It throws this error upon loading.
[13:19:32 ERROR]: [DirectoryProviderSource] Error loading plugin: Could not load plugin 'PlaceholderAPI v2.11.6' as it is not marked as supporting Folia!
nvm I found the fork
Hmm, okay. I'm able to reproduce this issue as well. This is weird. I'll let Oliver know. Thanks for reporting.
Does the placeholder work without specifying a player? What does it say with /papi parse --null %cmi_baltop_name_1%
This seems to be a problem on Paper servers too, I tried with %player_name% and got the same error as sent here. (See #💻・contributors)
The placeholder has to be independent from any player
So it must successfully parse when using --null as player: /papi parse --null
Hm, okay - I see. I think that's new tho, isn't it?
I don't think so, but I'm not 100% sure
But it would be quite difficult to change that with the current system, since the skins get loaded per npc and not per player viewing an npc
Yeah understandable. Weird to see %cmi_baltop_name_1% needs a player though. 🤔
Will update plugins on my server and see if it works with Topper placeholders. (They should work with --null)
Does indeed work.
We still need to fix this however: (and stacktrace that happens along with this error)
it comes from this return null;, because it couldn't parse the placeholder -> probably requires a player
Yeah makes sense. Isn't there a pre-made translation for situation like this? I recall we added something when introducing placeholder skins for the first time.
Unless null can be returned in other scenario, this should be perfect solution. May need to re-phrase the warning. Hold on, I think I can PR it. (Tho this will take a few minutes because of paperweight caches 😡)
we had
npc_skin_failure_invalid_name_or_url: "<dark_gray>› {errorColor}Argument {warningColor}{input}{errorColor} is not a valid player name or URL."
```
and
npc_skin_failure_invalid: "<dark_gray>› {errorColor}Argument {warningColor}{input}{errorColor} is invalid. Common issues: invalid URL, player not found, player has no skin."
It can also return null, if the UUIDFetcher fails, the URL is invalid or the file does not exists
Hm okay. Maybe we should throw different exceptions from within the getByIdentifier method?
And catch them in the command logic.
Yeah we could make a custom exception "SkinFailedToLoad", add a short reason to it, catch it and send the reason ("COuld not load skin: <reason>" or something") to the player
Alright, I can do this.