#Sovde, or anyone who knows NMS stuff please help!

1 messages · Page 1 of 1 (latest)

pale smelt
#
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)
latent mulch
#

well you gotta look at EntityPlayer

severe nebula
#

Hi sovde

pale smelt
#

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?

latent mulch
#

and yes

#

loop-value -> CraftPlayer (bukkit)
getHandle -> EntityPlayer (nms)

pale smelt
#

What do I look at here? Am I even in the right class?

latent mulch
#

you're in a package rn

pale smelt
#

yesa, package.

#

(I'd guess just Player?)

latent mulch
#

yes

pale smelt
#

okay.

latent mulch
#

EntityPlayer is a spigot mapping name

pale smelt
#

Ooo okay

#

So what are those .b.a() supposed to be?

latent mulch
#

look at the 1.19.4 mappings and find out

latent mulch
#

yup

pale smelt
#

what do I even have to look for... :\

latent mulch
#

well we're looking for b

#

but notice that we start with bA

#

so b is probably from a parent class

pale smelt
latent mulch
#

well yeah
but if you scroll down there's only bX fields

#

we want just b

pale smelt
#

yeah....

#

So what do we do?

latent mulch
#

oh my mistake

#

it's not Player

#

look up EntityPlayer in the search bar

pale smelt
#

;-; ok

#

empty...?

latent mulch
#

Spigot mappings

#

not Mojang

pale smelt
#

Oh spigot yes

#

ServerPlayer??

#

It sent me here

latent mulch
#

yup

pale smelt
#

How it starts with cC...

latent mulch
#

scroll down

pale smelt
#

so how do we find b?

#

How much?

#

do I just search for just b?

latent mulch
#

till you find b or reach the end of the fields

pale smelt
#

yeah ok im down here...

latent mulch
#

well ya missed it because it's in there

pale smelt
#

and what do I look here for??

latent mulch
#

what else?

pale smelt
#

There are like tons of b and all of em have () stuff with args and without...

vivid iron
#

#skript-help-2 pls

#

pls

pale smelt
latent mulch
vivid iron
pale smelt
latent mulch
#

it's in there

pale smelt
#

so there's an impostor b in classes cX... ok

#

Ayy lol

#

Is that it?

latent mulch
#

mhm

#

so in 1.20.2 we'll look for connection
but we also need to find a() first

pale smelt
#

(1.20.1)

latent mulch
#

so click on the return type and look for a()

pale smelt
#

alr

#

This is 1.20.1 btw

#

gl

#

to me

latent mulch
#

notice how there are so many

#

it doesn't really matter which one it is, if 1.20.1 has a similar signature

pale smelt
#

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

latent mulch
#

that doesn't take arguments

#

we're trying to send something to the player, so it's likely

pale smelt
#

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?

latent mulch
#

i don't see why it would tbh

pale smelt
#

hm

latent mulch
#

expr-1 should be a text display

pale smelt
#

this mby?

latent mulch
#

well yeah it's obviously that
it's the only nms method

#

but expr-1 should not be an entity player

pale smelt
#

wym

latent mulch
pale smelt
#

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?)

latent mulch
#

are you running paper

pale smelt
#

yes..

pale smelt
#

e..?

#

no.. idk

#

im confused here

latent mulch
#

expr-2.getComponent() seems to be null

pale smelt
#

as in 2nd expression is not set?

latent mulch
#

who knows

#

you gotta investigate

pale smelt
#

...

#

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??? 😭

latent mulch
#

It's not part of the api

#

But my guess is your problem is you're giving it text, not a text component

pale smelt
#

ah yes

#

I am.

#

YEEEESSSSS

latent mulch
#

congratulations

pale smelt
#
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

latent mulch
#

Hopefully now you see why NMS is a nightmare

pale smelt
#

It just doesnt set the billboard mode :\

#

yeah I do lol

latent mulch
pale smelt
#

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

latent mulch
#

So what's the next thing to check

pale smelt
#

This seems to be the same

#

1.20.1 ^

#

1.19.4

#

I'm about this btw

#

Sovde..?

latent mulch
#

What

pale smelt
#

Am I doin something wrong??

latent mulch
#

Idk

#

I don't know the answers
You gotta debug

pale smelt
#

okay :\

#

OK I C

#

expr-3 is not set

#

Why tho D:

latent mulch
#

I don't think there is an expr 3

#

I only see 2

pale smelt
#

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 :|

latent mulch
#

That's all the help I have for you today

pale smelt
#

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?

latent mulch
#

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

pale smelt
#

Alright

slender timber
#

@pale smelt yo dude sorry to bother but did you ever figure it out? ive been struggling with this too

pale smelt
#

Nope

slender timber
#

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 🙏

pale smelt
slender timber
#

wat

#

wdym

#

im still just trying to get text to display above the players head

#

like what do we even have to update

#

🤨

slender timber
#

wait kajus did you get it working on 1.20 without the velocity thing

#

like the base stuff

slender timber
# latent mulch loop-value -> CraftPlayer (bukkit) getHandle -> EntityPlayer (nms)

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

latent mulch
#

you are being silly

latent mulch
#

it still has to be obfuscated

slender timber
#

aah

latent mulch
#

you just have to find the 1.20.2 obfuscation names

slender timber
#

idk what that means but ill find out

#

thanks

latent mulch
#

see how it changes from b to c in 1.19.4 to 1.20.1

slender timber
#

oh yeah?

#

..

#

do i just

latent mulch
#

that's what you have to do for all of them

slender timber
#

if i change them all to a c and it works i WILL saw off my arms

latent mulch
#

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

latent mulch
#

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

slender timber
#

uhh

#

so like i have to figure out all the different classes that arent working

#

you mean

latent mulch
#

yep

slender timber
#

okay thanks

cosmic perch
#

You could use options for the obfuscated stuff. I find it makes it easier to understand the code and update it in the future :)

slender timber
#

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

latent mulch
slender timber
#

what!!!!!

slender timber
#

im out of my league here

#

hmms

#

oh boy whats all that

slender timber
#

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

latent mulch
#

also so i don't have to do any work

slender timber
#

lol!!!

#

(i am going to be up all night)

#

(end me)

slender timber
#

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

pale smelt
#

um hi

slender timber
#

still workin on this

#

i wanna die

pale smelt
#

@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)
latent mulch
#

it's obfsucated NMS

#

i don't remember where it came from

pale smelt
#

I understand that...

#

What does it do then? Spawn the entity in?

#

cuz it has x y z.. and... yeah..?

latent mulch
#

i mean yeah it's obviously some sort of location setter

#

i don't have any other answers for you

pale smelt
#

ah.. okay :c

#

Thank u anyway ig

#

@latent mulch do you maybe at least know how you got the new TextDisplay(EntityTypes.aX, (expr-1).getHandle()) (TextDisplay constructor or whatever it's called)?

latent mulch
#

Well it's just making a new text display

#

What's your question