I'm currently using the citizens plugin for development and have run into an issue when trying to set a player npc's skin with a SkinTrait. I've tried using the method setSkinPersistent(String name, String signature, String data) but quickly found that I have no idea what the String data is and how to get it. (Google couldn't help) Thanks in advance for helping!
#(ladycat_7018) What's skin data?
64 messages · Page 1 of 1 (latest)
(ladycat_7018) What's skin data?
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.
it's a base64 encoded URL as far as I know
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.)
@near sail
Resolved
Thread closed as resolved.
sry for doing this so late but I was on vacation the past two weeks. I tried encoding the skin url from minecraft with the base64 class and it is still not working. is there any specific link I have to use?
Thread Reopened
Thread was manually reopened by @near sail.
here's an example eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmJiMmU2OWIzODcwZmUyZjRmMWJhMTRhOGY5Y2E4YWNjOWE3NTIwZTRlNGE5Nzg0YzE5YTNhMGM5NDQ2ZTRkIn19fQ
if you base 64 decode that you get a json object
but all skins have to be paired with a signature that must be signed by mojang
So I need to encode a json object and not a URL or a string?
it's easiest to use an API like mineskin which will do the signature and encoding for you
I'm already using mineskin and got the signature, but I don't know where to find the encoded part
it's the "texture"
!skins
NPC skins are controlled in-game via the /npc skin command, or from Java API via the SkinTrait.
For more information, refer to this wiki page:
https://wiki.citizensnpcs.co/Skins
oh discord didn't load
there is nothing called texture that I can copy. only texture url and texture hash. do I need to sign in in order to get that value?
Texture hash is the b64 encoded data
I believe
well I tried using the texture hash but it spawns a completely different skin and says that the skin data is invalid
If you see here from mineskin, you have value and signature
Value is the encoded texture data
Signature is the encoded signature data
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.)
@near sail
tried the value just now (sry for the delay again)
and it doesn't work either
I might have to fix some stuff though cause the entire code is currently buggy
as it turns out the skin of the npc doesn't depend on the skin trait I give it but on the name ;-;
how do I make the npc's name independent from its skin?
generate a random name
like a uuid
@near sail what's your code?
also the citizens java doc doesn't seem to be working (at least for me)
it either gives me 403 or 404 errors when I try to open the page
should be working now
alr, so I need to give it a class and not a trait
ig I need to make a new Class or how does this work?
SkinTrait.class
ah
do I need to do anything with that? Like how do I set the actual skin?
jd is down again btw
should be the same
i don't get how I'm supposed to do this
@near sail SkinTrait trait = npc.getOrAddTrait(SkinTrait.class);
oh
Resolved
Thread closed as resolved.
mb I resolved too quickly ;-;
so the right skin now shows but the console is spaming this
Thread Reopened
Thread was manually reopened by @near sail.
oh sry it's not spaming
make sure your texture data is correct
hm, ok