effect spawn client [text] display %javaobject% to %players% at %location%:
trigger:
set {_x} to expr-3's x coordinate
set {_y} to expr-3's y coordinate
set {_z} to expr-3's z coordinate
(expr-1).e({_x}, {_y}, {_z})
set {_packet} to new PacketPlayOutSpawnEntity(expr-1)
set {_players::*} to expr-2
loop {_players::*}:
loop-value.getHandle().b.a({_packet})```
I got this ^ from #1129255087819206656 message
I get spammed a lot of stuff in console. I know a little bit of NMS stuff, but not really. I wanna spawn fake text displays for people.
I think the stuff spams (and doesn't work) cuz of the `loop-value.getHandle().b.a({_packet})`, but idk where did @latent mulch got those `.b` & `.a` stuff from. I suppose https://nms.screamingsandals.org/1.19.4/net/minecraft/world/entity/Display$TextDisplay.html but I can't seem to find it.
My goal is to make it work on 1 20.1 (https://nms.screamingsandals.org/1.20.1/net/minecraft/world/entity/Display$TextDisplay.html)
#Sovde, or anyone who knows NMS stuff please help!
1 messages · Page 1 of 1 (latest)
Hi sovde
Oh ok. What does EntityPlayer have to do with this? is it cuz it displays to a player?
But I am right about that it's loop-value.getHandle().b.a({_packet} that breaks?
Also, do I have to look into the Obfuscated type thing?
What do I look at here? Am I even in the right class?
you're in a package rn
yes
okay.
EntityPlayer is a spigot mapping name
look at the 1.19.4 mappings and find out
yup
what do I even have to look for... :\
well we're looking for b
but notice that we start with bA
so b is probably from a parent class
Starting as in cuz this is the first thing?
yup
How it starts with cC...
scroll down
till you find b or reach the end of the fields
yeah ok im down here...
well ya missed it because it's in there
There are like tons of b and all of em have () stuff with args and without...
you're looking at methods
No if u need help make a post urself then
stick to one channel please
k
Yeah I understand that, what else am I supposed to look at down here..? cuz the fields end here and after em there are methods
well you missed it in the fields
it's in there
(1.20.1)
so click on the return type and look for a()
notice how there are so many
it doesn't really matter which one it is, if 1.20.1 has a similar signature
Oo alright...
Ok ok
ok
So this is 1.19.4...
1.20.1!
ok same thing lol
so just change the b to c....
YEEEEEE WOOOOOOOOOOOOOOOOOOO
it works :3
I mean
at least no console spam
that's not it
that doesn't take arguments
we're trying to send something to the player, so it's likely
oh.
ok.
same thing tho ok
(1.20.1)
effect set text component of client [text] display %javaobject% to %object% [for %-players%]:
trigger:
(expr-1).c(PaperAdventure.asVanilla(expr-2.getComponent()))
if expr-3 is set:
refresh client display expr-1 for expr-3``` this now D:
%EntityPlayer% this spams so its in the right category.. yey
so its this thing.. right?
i don't see why it would tbh
hm
expr-1 should be a text display
well yeah it's obviously that
it's the only nms method
but expr-1 should not be an entity player
wym
.
.
oh
wait
well..
set {_display} to a new client text display in (world of {_l})
spawn client display {_display} to {_p} at {_l}
set text component of client text display {_display} to "<##ffb133>+<##f2cd64>100©" for {_p}```
idk..
Ohh wait
maybe cuz of the refresh effect mby
# refresh a text display's metadata for a player
effect refresh client [text] display %javaobject% for %players%:
trigger:
set {_values} to (new ArrayList())
loop ...(expr-1.aj().e.values()):
{_values}.add(loop-value.e())
set {_players::*} to expr-2
loop {_players::*}:
loop-value.getHandle().b.a(new PacketPlayOutEntityMetadata(expr-1.af(), {_values}))
# set a text display's text. Excluding the players parameter will mean the object must be refreshed manually.
effect set text component of client [text] display %javaobject% to %object% [for %-players%]:
trigger:
(expr-1).c(PaperAdventure.asVanilla(expr-2.getComponent()))
if expr-3 is set:
refresh client display expr-1 for expr-3``` this
1st
Oh..
WOOPS
I see it
effect refresh client [text] display %javaobject% for %players%:
trigger:
set {_values} to (new ArrayList())
loop ...(expr-1.aj().e.values()):
{_values}.add(loop-value.e())
set {_players::*} to expr-2
loop {_players::*}:
loop-value.getHandle().c.a(new PacketPlayOutEntityMetadata(expr-1.af(), {_values}))```
I had this rn
i ran the function
[18:07:43 INFO]: [Skript] No matching non-static method: String#getComponent called without arguments
[18:07:43 INFO]: [Skript] method PaperAdventure#asVanilla called with (null (Null)) threw a NullPointerException: Cannot invoke "net.kyori.adventure.sound.Sound$Source.ordinal()" because "source" is null```
mmm
ok..
e.........
that mighty shitty e...
(right?)
are you running paper
yes..
isnt it cuz of ...j().e.value...
e..?
no.. idk
im confused here
as in 2nd expression is not set?
...
I don't like to investigate D:
Is this cuz of the mappings or not?
(I'd guess not)
@latent mulch I cannot find the io.papermc.paper.adventure.PaperAdventure class ANYWHERE
on javadocs
Only thing
Pls help 😭
Where did u even get that from??? 😭
It's not part of the api
But my guess is your problem is you're giving it text, not a text component
congratulations
effect set billboard constraints of client [text] display %javaobject% to (1:fixed|2:vertical|3:horizontal|4:center) [for %-players%]:
trigger:
if parse mark is 1:
set {_constraint} to BillboardConstraints.a
else if parse mark is 2:
set {_constraint} to BillboardConstraints.b
else if parse mark is 3:
set {_constraint} to BillboardConstraints.c
else if parse mark is 4:
set {_constraint} to BillboardConstraints.d
(expr-1).a({_constraint})
if expr-3 is set:
refresh client display expr-1 for expr-3``` doesn't work now >:|
No error in console tho
Hopefully now you see why NMS is a nightmare
Well better start looking at the mappings for billboard constraints
ok
well
these seem to be the same...
But like, no error in console or anything. It just doesn't set the billboard to what I want
So what's the next thing to check
What
Am I doin something wrong??
mmmm yeah
ok
ok now I fixed it, but it still doesnt set the billboard D:
Ok
fixed doesn't work, but vertical does.
Ig vertical fits better anyway
How do I set it's velocity now, cuz I need it to go up :|
That's all the help I have for you today
Is it like, you do not know this anymore and I have to research myself or you know, but I have to use my brain now?
Well I haven't known any of what you've done other than how to use the mappings site
But now you know too
So you know as much as I do
Alright
@pale smelt yo dude sorry to bother but did you ever figure it out? ive been struggling with this too
Nope
agh
whats your progress at
i dont even know which part is breaking
ok well anyway im gonna keep working on it, pls let me knwo if you figure it out 🙏
Oh wait, ur about the velocity?
wat
wdym
im still just trying to get text to display above the players head
like what do we even have to update
🤨
wait kajus did you get it working on 1.20 without the velocity thing
like the base stuff
okay im sorry for bothering you still, but i saw you said this
so i've been trying to use this CraftPlayer thing, and i replaced the following lines:
loop-value.getHandle().b.a({_packet})
loop-value.getHandle().b.a(new PacketPlayOutEntityMetadata(expr-1.af(), {_values}))
to the following respectively
((CraftPlayer)loop-value).getHandle().playerConnection.sendPacket({_packet})
((CraftPlayer)loop-value).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(expr-1.getId(), {_values}))
am i on the right track here or am i being silly
did i like totally misinterpret that statement you said
you are being silly
it still has to be obfuscated
aah
you just have to find the 1.20.2 obfuscation names
that's what you have to do for all of them
if i change them all to a c and it works i WILL saw off my arms
figure out what the unobfuscated name is in 1.19.4 and then figure out what the new obfuscated name is in 1.20.2
oh ok so thats just one example
got it
is that right
or is this also a factor
https://nms.screamingsandals.org/1.19.4/net/minecraft/world/entity/player/Player.html
well you have the right site
but you'll have to figure it out for all the ones that aren't working
i don't know the right answers for 1.20.2
uhh
so like i have to figure out all the different classes that arent working
you mean
yep
okay thanks
You could use options for the obfuscated stuff. I find it makes it easier to understand the code and update it in the future :)
huuuauaaah
im confused as it is!!!
see i just dont know how to find the classes im gonna need to update, arent there like a ton of them
smart
what!!!!!
just see what errors in console
you know
i think sovde is right about all of this
like hes making me do it on my own so i LEARN and not just spoonfeed from him
even if it is taking 5 hours
or 7
also so i don't have to do any work
every time i change the obfuscated stuff, new obfuscation errors pop
im losing it
[01:23:16 INFO]: [Skript] No matching static constructor: PacketPlayOutEntityMetadata.<init> called with (net.minecraft.network.protocol.game.VecDeltaCodec@4d64fd6 (VecDeltaCodec), [] (ArrayList))
[01:23:16 INFO]: [Skript] method PlayerConnection#a called with (null (Null)) threw a NullPointerException: Cannot invoke "net.minecraft.network.protocol.game.PacketPlayInArmAnimation.a()" because "packet" is null
like this was not here before
GGRRRAAAH
um hi
@latent mulch I need some more help with actually understanding the code...
effect spawn client [text] display %javaobject% to %players% at %location%:
trigger:
set {_x} to expr-3's x coordinate
set {_y} to expr-3's y coordinate
set {_z} to expr-3's z coordinate
(expr-1).e({_x}, {_y}, {_z})
set {_packet} to new PacketPlayOutSpawnEntity(expr-1)
set {_players::*} to expr-2
loop {_players::*}:
loop-value.getHandle().c.a({_packet})``` you have this, right?
and where does the `e()` method from `(expr-1).e({_x}, {_y}, {_z})` come from? I've been searching for a little while and can't find it... (Cuz I am most likely not searching in the right place, cuz I don't get that part where to search)
I understand that...
What does it do then? Spawn the entity in?
cuz it has x y z.. and... yeah..?
i mean yeah it's obviously some sort of location setter
i don't have any other answers for you