#help-development

1 messages Β· Page 65 of 1

tender shard
#

maven is great

coarse finch
#

gradle πŸ’ͺ

tender shard
#

gradle is weird πŸ˜›

#

both are great tools

coarse finch
#

gradle is easier to me tho

#

maven uses xml 😨

tender shard
#

gradle is just way too complicated and sooo bloated although it has no features

#

I prefer maven

#

gradle cannot even shade stuff πŸ₯²

coarse finch
#

wdym

tender shard
#

(unless you use a plugin made by some random github guy)

#

(also gradle thinks that it needs to run a daemon the whole time)

coarse finch
#
shadowJar {
    relocate 'dev.dejvokep.boostedyaml', 'me.kidneybean.generalutils.shaded.boostedyaml'
    relocate 'org.bstats', 'me.kidneybean.generalutils.shaded.bstats'
}```
#

boom

#

shading

tender shard
#

(and it needs to download itself first, and it's like 150mb from a slow server)

tender shard
#

you need a plugin for this to work

coarse finch
#

its like 1 line to add that plugin tho

tender shard
#

but again, I dont hate gradle. it's awesome. but maven is just better πŸ˜›

tender shard
#

maven however has an official shade plugin

coarse finch
#

i just tried to do a : after an if 🀣

#

my brain is pythonified

tender shard
#

IIRC gradle cannot even use your local maven repo without an explicit declaration

#

gradle is just overly verbose

#

people claim maven is verobse because of XML

#

but thats kinda bs

coarse finch
#

i gtg

tender shard
#

I mean which one is more readable?

compileOnly org.spigotmc:spigot:remapped-mojang:1.19.2-R0.2-SNAPSHOT
#

or a nicely formatted xml file

tender shard
quaint mantle
#

Can someone help me?

dusk flicker
#

no

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

I have a plugin Im getting help building, and I cant get it to drop the item. d:

ancient plank
#

Drop this item instead

shy rock
#

    static VillagerVault plugin;

    public villager (VillagerVault plugin) {
        this.plugin = plugin;
    }

    public static void init() {
    }

    public void createdvvilager(Location location) {
        Villager vvilager = location.getWorld().spawn(location, Villager.class);
        vvilager.setCustomName(ChatColor.GOLD + "Item Safe");    //Color and name of mob//
        vvilager.setCustomNameVisible(true);
    }
        @EventHandler

    public void onInteractEntity(PlayerInteractEntityEvent event) {


            if(event.getEntity().getType() == EntityType.SILVERFISH) {
        if (event.getRightClicked().getType() == EntityType.VILLAGER) {
            if (event.getEntity() instanceof Villager && event.getEntity().getCustomName().equals((ChatColor.GOLD + "Item Safe"))) {

            } }
        }
    }
}```
on eventhandler, theres an error on getEntity..
'Cannot resolve method 'getEntity' in 'PlayerInteractEntityEvent''
But its PlayerInteractEntityEvent ??
quaint mantle
subtle light
#

I need plugins Devs DM me

hasty prawn
#

?services

undone axleBOT
digital basin
#

I've compiled my plugin using 3 different JRE's (18,17,16) and every time it's telling me the same error
has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 61.0
I have no idea how it's still building in runtime 62

dim bronze
#

version 61 correlates to jdk 17, so compiling with 16 or 17 should work

digital basin
#

I'm using intellij, I've updated the pom, I've updated the maven run config, I've updated the project settings source language level and dependency, I've updated the project SDK settings and language level...

dim bronze
#

are you sure you have been using different jdks to compile?

eternal oxide
#

you need to set the source/target not the JDK you use

dim bronze
#

^

digital basin
#

I set that in the pom

dim bronze
#

how

eternal oxide
#

?paste pom

undone axleBOT
digital basin
#

compiler source and target are set to 16

eternal oxide
#

InteliJ or Eclipse?

digital basin
#

InteliJ

eternal oxide
#

Artifacts or lifecycle to build?

digital basin
#

I'm using lifecycle

eternal oxide
#

package?

digital basin
#

yes

eternal oxide
#

add teh compile plugin to your pom as thats the only reason it would be broken

digital basin
#

The compile plugin?

eternal oxide
#

if everything is as you specified above

strong parcel
#

I didn't understand what you meant yesterday, but I think I do now. Because the Flood class is registered as both an event and a command, it opens one instance of Flood when the command is triggered and a new instance of flood every time the event is triggered, right?

eternal oxide
#
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
            </plugin>```
digital basin
#

Ahh, plugins is getting a red line under it when I use that

eternal oxide
#

it goes in the <build> section

strong parcel
#

How can I target an instance of a class to make sure they both use the same one?

digital basin
#

ah perfect, I'll reload maven and try building again

#

Just gotta restart my server to see if it works

tender shard
#

porn.xml

#

Whut?

eternal oxide
#

not sure that would be good porn

#

I remember it back in the day

digital basin
#

Jeeze, still reporting the same error,
io/github/klaustrix/greentext/GreenText has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 61.0

dim bronze
tender shard
digital basin
#

From the minecraft server on load up

dim bronze
eternal oxide
#

You can;t be correctly updatign yrou jar on the server

tender shard
eternal oxide
#

My guess is you have the server running and fail to update

dim bronze
#

make sure you haven't got multiple jars in your server for the same plugin

eternal oxide
#

PC crashed so catching up

digital basin
#

Update the server java?

eternal oxide
#

no your plugin

#

you copy it from yoru target folder to your server?

digital basin
#

I started on Java 18, I stop the server, delete the old file, upload the new one, start the server again

tender shard
#

are you using maven @digital basin ?

digital basin
#

yes

eternal oxide
#

he is, lifecyles package to build

tender shard
#

read this pls

eternal oxide
#

Your pom is now fine. you are either failing to build or not uploading the correct jar

dim bronze
#

when in doubt invalidate caches and restart

tender shard
digital basin
tender shard
#

SO MUCH TO DO, SO MUCH TO SEE

tender shard
undone axleBOT
dim bronze
#

they have

#

scroll up questions hae been asked and answered

tender shard
#

are you using intellij?

digital basin
#

yes

tender shard
#

File -> Project Settings -> set the java version to 17 or above

digital basin
#

Already did that

tender shard
dim bronze
#

do you have maven installed on your computer separate to intellij? you could try build using mvn package to see if intellij is messing anything up

#

java 17 is fine, it's what the server is running on

eternal oxide
#

Confirm, you are using the menu on the right, Maven and package in the lifecycle section? Not building via artifacts

digital basin
#

I tried 18, 17, and 16 but I can bump everything back up to 17

eternal oxide
#

k

digital basin
#

Maven is part of intellij I think

tender shard
#

okay lets start from scratch. send the FULL maven log pls

digital basin
#

Where do I get that

tender shard
#

not just the error message. please ?paste the WHOLE maven log

#

ok wait

#

i'll explain, lemme start IJ

dim bronze
#

the error message he sent isn't from maven

#

its from the server

digital basin
#

the error is coming from the minecraft server, not maven

eternal oxide
#

we need the maven log to see if its even building

#

everythign you changed shoudl have altered the target version and its not

tender shard
eternal oxide
#

So we are guessing there is a build error

dim bronze
#

when it builds, the bottom pane should show a maven window with the build logs in

tender shard
dim bronze
tender shard
#

huh

#

that is weiiiird

digital basin
tender shard
#

then I also cannot help

digital basin
#

I'm running Spigot 1.19

tender shard
#

I am like 1000% sure that your server runs java 16 or older

digital basin
#

on an apex host

#

Is there a way to verify the java version?

#

Maybe a console command?

tender shard
tender shard
#

java -version

dim bronze
#

confirm there is only 1 GreenText.jar plugin in your plugins folder

#

versioning sometimes messes that up

#

you move the file over and it doesn't overwrite the old one because they are different versions

tender shard
#

(usually spigot uses the latest file if 2 .jars have the same "plugin" name)

#

but yeah cant hurt to double check this

digital basin
#

Each time I delete the old file, a new one generates, I delete the one on the server and upload the new one, even changing the version number to make sure it's different each time

#

There's only ever one file in existence at a time

tender shard
#

?paste

undone axleBOT
tender shard
#

just paste your whole latest.log there ^

digital basin
#

java -version produces a unknown command error

#

I'll post the log

tender shard
#

oki

river oracle
dusk flicker
#

?javahome

tender shard
#

fuck that, just let them paste the log

dusk flicker
#

we need a command for it tbh

dim bronze
#

dont think thats the problem, intellij finds the jdk fine

tender shard
#

I am like 99.9% sure that they run java 16 instead of 17

dim bronze
#

its path is manually specified in intellij

tender shard
#

intelliJ has nothing(!) to do with your server

river oracle
#

just because intellij found the jdk doesn't mean your computer has

dim bronze
#

the server is running externally

#

on apex

tender shard
#

just paste your latest.log pls

digital basin
#

here you go it's a biggen

tender shard
#

thats not the full log

#

restart your server, then open latest.log again and paste the full file pls

digital basin
#

Okay one sec

tender shard
#

the log gets rotated automatically at 0 or 1 in the night

#

so yeah pls restart it and send it again

iron glade
#

Do you guys know that feeling when you're facing a problem while programming and eventually you come up with a 3 line solution xd

iron glade
#

It's so relieving

tender shard
#

mostly the 3 line solution involves NMS though lol

iron glade
#

:(

digital basin
#

I just have to dc my players to restart so I gotta explain whats up

dim bronze
#

the server isn't the problem here

tender shard
dim bronze
#

its intellij/maven not compiling with the right target

tender shard
#

huh

digital basin
#

I thought that was the problem

tender shard
#

I thought it compiles fine

dim bronze
#

class file version 62 is java 18

#

yes it compiles fine

#

just not with the correct target

tender shard
#

does your plugin compile fine, or does it not?!

dim bronze
#

that's whats important

#

no error doesn't mean correct

digital basin
#

It compiles but the compile version is always too high even when set lower

tender shard
#

does maven say "BUILD SUCCESS" or does it say "BUILD FAILURE" when you compile?

dim bronze
#

success you've read the output

#

that doesn't matter

tender shard
#

ok ok good

tender shard
#

if it says "build success" then its obvious that the only problem is the server running java 16 πŸ™‚

wet breach
dim bronze
#

the fact its successfully built doesnt matter if the target is still incorrect

#

the srever

digital basin
#

The problem is that the server only wants java 17 or lower, but the plugin is always being built in version 18 for some reason even when I set the settings lower

dim bronze
#

is not

tender shard
dim bronze
#

running 16

tender shard
#

their only problem is the server runing java 16 instead of 17

eternal oxide
#

can you try this...double click on Package, not using any of yoru other bits.

dim bronze
#

the problem is that maven isn't targetting java 17

wet breach
wet breach
#

in order to fix that, I need to see their pom

dim bronze
#

think the version has been bumped since

#

that's the only difference

tender shard
#

they compiled a plugin for java 17 but their server runs java 16. that's the problem. so either update the server's java or downgrade the compiler target in your pom

digital basin
dim bronze
#

they haven't compiled for java 17

dim bronze
#

they've compiled for 18

#

thats the problem

tender shard
#

oh yeah

digital basin
#

Yeah it's compiling through java 18 despite changing all the settings

tender shard
#

youre right

eternal oxide
#

The problem is teh pom says its compiling for 16 but its not

#

which means he can;t be using the pom

dim bronze
#

personally, i would download maven separately

#

and run it in the command line

#

remove intelij from the equation

eternal oxide
#

he has to be building using artifacts

dim bronze
#

or intellij is using some other weird option in its maven settings

eternal oxide
#

possible

dim bronze
#

ctrl ctrl and type mvn package

worldly ice
#

should have a config section like that

river oracle
#

not necessarily required :s

eternal oxide
worldly ice
#

ah, mb

wet breach
river oracle
#

really O.o

#

oh boi

wet breach
#

at least not for targeting java versions

eternal oxide
dim bronze
#

used to work in intellij with me?

wet breach
tender shard
dim bronze
#

but this is why i haven't used maven in a long time

wet breach
#

Well I fixed it for you, should work now for the version you are wanting

dim bronze
#

multiple places to define everything

digital basin
dim bronze
#

btw Klaustrix is the one with the issue, not me

wet breach
#

ah

digital basin
#

πŸ‘‹

wet breach
#

well either way

digital basin
#

Uploading and testing now

dim bronze
#

so

<properties>
    <maven.compiler.release>17</maven.compiler.release>
</properties>

standalone doesn't work anymore?

outer river
#

hello, why i have this signs pls ?

wet breach
#

maven stopped using the properties for java version targeting because it was getting too confusing when the compiler plugin already accepts a tag for it

#

eclipse has its own compiler and they do their own thing

river oracle
eternal oxide
#

do you know the version?

outer river
river oracle
#

I don't fucking know

#

you have provided 0 info on your IDE or anything

#

how am I supposed to help you

wet breach
dim bronze
#

shouldn't matter what java version

outer river
#

i mean, i was expecting for a misclick combination of keyboard

eternal oxide
#

I guess I never noticed as I use Eclipse

river oracle
desert frigate
#

how would i remove just 1 item from a players inventory?

wet breach
desert frigate
river oracle
dusk flicker
#

set an amount to the itemstack iirc

digital basin
#

Wow still getting the error I'm just genuinely cursed

dim bronze
#

which ide?

dusk flicker
#

looks like eclipse

dim bronze
wet breach
dim bronze
outer river
#

yup, eclipse

dim bronze
wet breach
#

the only other thing I can think of is that you are making IntelliJ build it and not maven

dim bronze
#

staight from stack overflow

digital basin
#

I can try downloading and installing maven, while I try that, how do I clean build?

drowsy helm
#

Mvn clean

dim bronze
desert frigate
#

setting it needs the index

river oracle
#

ItemStack#setAmount

dapper pond
#

my server is paper 1.19.2, and i keep getting that chat message validation failure so i decided to try and go back to a later version like 1.19. Except now it makes my server crash because its trying to load chunks from 1.19.2, is there anyway to go back a version and not have it crash like this?

river oracle
drowsy helm
#

You dont need to package if you’re just cleaning

river oracle
#

they are pretty fucking awesome

dapper pond
#

should that be in help server

wet breach
dim bronze
drowsy helm
#

Ah

drowsy helm
dapper pond
quaint mantle
#

I want a solution

dim bronze
#

πŸ˜„

river oracle
#

use java

outer river
#

@dim bronze in wich section ?

quaint mantle
dim bronze
#

the response was quite old so might have changed

drowsy helm
river oracle
dim bronze
desert frigate
river oracle
#

np πŸ‘

quaint mantle
#

I use GeyserMC In Java server but It does not work

river oracle
#

well not sure what to do then

#

dope

quaint mantle
#

Znpcs

dim bronze
river oracle
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

digital basin
#

IT WORKED

quaint mantle
river oracle
#

ask your question 0 provided 0 context 0 possible solutions

wet breach
dim bronze
#

no way was a clean package the solution πŸ˜‘

#

thats annoying

digital basin
#

Frostalf's pom + clean package

shy rock
#

could anyone help me with some playerInteractionEntityEvents ?

outer river
#

@dim bronze thx, i foud it

quaint mantle
sharp heart
#

do someone know how to calculate the angle (-180 to 180) between player direction and a location ?

digital basin
#

Well I super appreciate all the help guys

quaint mantle
#

πŸ₯²

river oracle
digital basin
#

Thanks for sticking with me ❀️

river oracle
#

you just sent a video

dim bronze
#

i mean it makes sense. no code changes so maven doesn't recompile

#

so class version never changes

#

should have seen that coming

river oracle
#

?paste

sharp heart
#

do someone know how to calculate the angle (-180 to 180) between player direction and a location ?

undone axleBOT
river oracle
#

please

shy rock
#

oh

shy rock
river oracle
worldly ice
sharp heart
#

πŸ‘‰ do someone know how to calculate the angle (-180 to 180) between player direction and a location ? πŸ‘ˆ

worldly ice
#

remove getClickedEntity after event

shy rock
worldly ice
#

what's your new code

river oracle
#

bruh don't know how to fix a syntax error πŸ’€ please see what your IDE is telling you and fix it its very descriptive

dim bronze
#

take the location as vector, subtract the players location as a vector

#

and get the direction of the vector

quaint mantle
# river oracle you just sent a video

my problem is in plugin znpcs

When I write command

/znpcs create

And write the requirements, the red letter appears to me, and it does not spawn the npc

drowsy helm
quaint mantle
river oracle
#

plus go bug gyser / plugin creator

sharp heart
#

I need to know if the location is at the left or the right of the player

#

so -90 or 90 in example

quaint mantle
river oracle
#

if its not an issue with them ask geyser

#

if geyser says not our problem than figure it out yourself someone is lying spigot isn't the issue here

quaint mantle
river oracle
quaint mantle
#

How πŸ€”

wet breach
#

generally located on most plugin resources these days

#

for the authors discord

river oracle
#

don't ask me I don't own the plugin If its not on their plugin page dm them on spigot

wet breach
#

or how to get a hold of them

iron glade
#

Anyone knows if there is a plugin that makes inventories "stackable", e.g. you open a chest, and there is a chest inside, if you idk, right click? that chest it opens that chest's inventory, etc

quaint mantle
river oracle
#

I mean equally speaking no one in help server will also beable to help you

drowsy helm
#

that would cause so many issues

wet breach
iron glade
#

yeah something like that

dim bronze
drowsy helm
#

shulkers dont stakc inside of eachother

river oracle
iron glade
#

Do you guys think it would be even possible to do smth like that?

river oracle
drowsy helm
#

yes, with nbt easily

iron glade
#

and when you close that inventory, the previous inventory opens (if there was any)

#

idk, was just something that came to my mind :d

drowsy helm
#

are you talking about a physical chest

#

or just a gui

river oracle
#

just a gui I'm assuming

drowsy helm
#

because if its a physical chest you're asking for a bookban chunk

river oracle
#

didn't mojang fix book banning

wet breach
drowsy helm
#

did they?

river oracle
iron glade
#

Well, let's say you have a chest with items inside, you destroy that chest and have it in your inventory, if you place that chest into another chest now and right click on the chest that you just put inside another chest it opens a gui with the stuff stored in that chest

drowsy helm
#

ah

#

what does it do, throw an error?

#

or just cut off data

river oracle
#

I'm not sure tbh

wet breach
#

better to use something like vaults

sharp heart
wet breach
#

where there isn't a physical chest required

drowsy helm
#

just sounds like a vault with extra steps

stuck flax
#

is there a way to get the player's client brand using the Spigot API? If not, how else could I do it?

dim bronze
#

what this information is, however, i have no idea

#

i don't think its intended to be public knowledge because it can be faked but its probably been reverse engineered

river oracle
#

Client signatures can indeed be faked very easily

stuck flax
#

Many plugins like an anticheat I know will show you the client brand, I wanna know how to get that

river oracle
#

if your using it to prevent hackers don't bother

stuck flax
#

I know it can be faked, I just want to be able to get it

dim bronze
#

which is why intended to be public

dusk flicker
#

I dont think you can easily with the spigot api

dim bronze
#

it probably is

dusk flicker
#

but Paper has a method for it

river oracle
dim bronze
#

but you just have to find it online

dusk flicker
#

I would recommend you dig into their implementation and see how they did it

dim bronze
dim bronze
#

i don't think most alter this?

stuck flax
#

I saw on a thread that it's possible to do it with ProtocolLib, is this true?

dim bronze
#

iirc its sent in the handshake packet

#

i didn't realise you meant this information

#

so yes, possible with protocol lib

stuck flax
#

πŸ‘ thanks

dim bronze
dusk flicker
#

it might be through messaging channels now that im thinking of it

dim bronze
#

hard to read the patch without surrounding code

sharp heart
dim bronze
#

seems like a common enough question, had any luck with google?

sharp heart
#

nobody have a solution

#

something that work

dim bronze
#

what do you need this angle for

sharp heart
dim bronze
night torrent
#
    public void onPlayerWearsItem(PlayerInteractEvent event)
    {
        Player player = event.getPlayer();
        player.sendMessage("Checking for helmet on player " + player.getDisplayName());
        if(player.getInventory().getHelmet().getItemMeta().getLore().get(0) == "Β§2These goggles grant you the")
        {
            player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 1, false, false));
            Bukkit.broadcastMessage("PotionEffects!");
        }
    }```
I'm trying to make it so when you wear a specific helmet (custom ItemStack) you get night vision, but this code doesn't work. Any suggestions?
#

right now im checking if the lore on the helmet being worn matches the custom helmet i made

#

and i tried checking to see if ItemMetas matched and if they were the same ItemStack

#

but its not working

dusk flicker
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

worldly ingot
#

Don't compare strings with ==. Use .equals()

#

Surely we have a command for that, no?

dusk flicker
#

?comparestrings

#

not that im aware of

#

You should make one Choco :p

night torrent
#

ok well thats not the problem because i tried by checking if itemmetas matched

eternal oxide
#

?strings

night torrent
#
        {
            player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 1, false, false));
            Bukkit.broadcastMessage("PotionEffects!");
        }```
#

ItemManager is a seprate class and Goggles is the static ItemStack

dusk flicker
#

You would probably not want to compare itemmeta

#

Rather use something like PDC

night torrent
#

?

eternal oxide
#

why not just ItemManager.Goggles.isSimilar(player.getInventory().getHelmet())

topaz patio
#

hi

eternal oxide
#

it will compare meta too

dusk flicker
#

Doesn't isSimilar only check the amount tho

eternal oxide
#

everything except amount

dusk flicker
#

ye

#

im just concerned if this helmet can take dura/have diff enchantments

night torrent
dusk flicker
undone axleBOT
topaz patio
#

@dim bronze hi can you do a voicechat real quick? i'm in hokib's team and we've been trying to figure this out for 3-4 hours

night torrent
dusk flicker
#

ive been in here for a long ass time

#

at some point they just come naturally

#

I have 32k+ messages lol

topaz patio
#

@worldly ingot can i get some helps please its very urgent

dusk flicker
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

dusk flicker
#

you havent even asked a question

night torrent
#

also, is their anyway to tint the screen a color?

drowsy helm
#

finally figured it out

spiral birch
#

Hey guys, i'm trying to show to players an arrow in their actionbar pointing them to a block location, according to the direction their looking at
i'm struggling a lot with vectors and I would like to know if someone could help me doing this
by the way, as I need to convert angle to arrows, a basic angle will not be enough since I need to tell to the players which way they need to turn

drowsy helm
#

and get the pitch which you convert into an arrow

glossy scroll
#

what

#

that is

#

not true

#

First: get the displacement vector

#

blockDir = blockLoc - playerLoc

#

then get the facing director

#

playerLoc.getDirection

spiral birch
#

yeah but then how can i get the angle ?

glossy scroll
#

Vector.angle

spiral birch
#

since I need to know like if the player needs to turn to the left or the right i would need something negative or positive

glossy scroll
#

yes exactly

spiral birch
#

and vector.angle is always positive

glossy scroll
#

you can use blockDir.dot(playerDir)

#

that will give you a vector that is positive (to the right) or negative (to the left)

spiral birch
#

can I use > / < on a vector tho ?

glossy scroll
#

huh?

spiral birch
#

how can i check if the vector is positive or not

glossy scroll
#

oh

#

the y value

#

of the dot product

#

will be positive/negative

#

or you could just use a compass

#

i should also mention

outer river
#

hello, what should i put here to target a method pls ?

glossy scroll
glossy scroll
#

@spiral birch see above btw

worldly ingot
outer river
#

trying to get a list of command from a category of my config and link him to my categor'ys name

glossy scroll
#

not even

#

just use the list as the value of the hashmap

#

and then do Dispatcher(map.get(key)) or whatever

#

and also lowercase Dispatcher

outer river
#

thx

sinful rapids
#
  loc.getBlock().setTypeId(31:2);

I can't put this id, can I how to solve?

silent wave
#

hi i have issues with a plugin
i had a tab list plugin and when i delete this plugin the tab list dont disappear
what can i do to fix it?

slate mortar
#

wdym

sinful rapids
outer river
#

loc.getBlock().setTypeIdAndData(31, 2, false);

#

@sinful rapids

sinful rapids
#

ok

#

thanks

outer river
#

np

coarse finch
#

what would be the best way to save boolean data about the player

dry forum
#

how can i create a fallingblock using nms? using new FallingBlock it asks for a properties object, what is that and how do i make it

eternal night
#

Why

#

Nms should be the last answer

dry forum
#

because only 1 person see it

eternal night
#

That spawns them for everyone tho

dry forum
#

that isnt nms

gaunt relic
#

oh, you want just one person to see it?

dry forum
#

also am i missing smthn why does Material. in NMS only have like 15 materials

#

yhes

gaunt relic
#

you need to send the spawn packet to just that person

eternal night
#

Well, generally falling block entity is what you wanna base your stuff on

gaunt relic
dry forum
#

umm it doesnt work like that

#

im using nms

gaunt relic
#

yea, what I mean is you should look in the source code how it is done

#

and instead of sending to everyone in the world, just send to the player you want to see

dry forum
#

theres hundreds of files in the source code idk what 1 its in

gaunt relic
#

look in CraftWorld class

quaint mantle
#

Just a yes or no, should I run database "preparedStatements" async?

eternal night
#

Yes

drowsy helm
#

most database stuff should be done async

eternal night
#

Technically not too needed

gaunt relic
eternal night
#

But like

#

Shove all dB interactions onto their own tbrssd

dry forum
#

alright thanks ill look at it

eternal night
#

Thread

quaint mantle
#

I see then, thanks! =)

dry forum
gaunt relic
#

yea i looked up on latest source code of spigot

#

?stash

undone axleBOT
gaunt relic
dry forum
#

that didnt work on 1.19.2 BlockPosition doesnt exist but i fixed that but the method is completely different and i dont rly understand it FallingBlockEntity entity = FallingBlockEntity.fall(s, new BlockPositionSource(loc.getX(), loc.getY(), loc.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState(), CreatureSpawnEvent.SpawnReason.CUSTOM); the loc.getX() y and z and all of that says its unrecognized

river oracle
#

is there any way to put a player in a sort of spectator state in survival. The main issue I'm theorizing is the restriction of hitting another player if the player in "spectator" is in the way. There are a couple ways I could think of doing this, but I'm not positive

  1. Player#hidePlayer(Plugin plugin, Player, Player) hide the player for all online players
  2. Player#setInvisible() my note on this one is the possibility they can still be interacted with.
  3. Packets (I would like to not do this), but I know its possible

Now this is one of those things I wish i could try and see, but I don't have enough resources to run 3 minecraft clients and a server on my pc

gaunt relic
gaunt relic
#

that class is in net.minecraft.world.entity.item.EntityFallingBlock

dry forum
#

huh?

gaunt relic
#

you gonna have to decompile the nms and look on it

hushed pawn
river oracle
#

or cause collision to a player running across a bridge and throwing them off into the void

#

hmmm I actually should beable to pull off tests with another mob and 2 clients I should be fine catually for trying and seeing this

hushed pawn
coarse finch
#

i have a few questions about persistent data storage.

  • does it save when the server reboots?
  • can i store data on offline players?
  • are there better methods?
drowsy helm
#

but yes it does save over reboots

worldly ingot
drowsy helm
#

and no, i dont think you can set pdc on offline players. I may be wrong

glossy scroll
#

to confirm, is tehre something like EntityShootBowEvent but for all projectile items?

novel kite
#

Is there any way to find if there are any data packs installed?

drowsy helm
#

can make your own custom event out of it

river oracle
#

Use it to store small bits of data on things like items players etc

coarse finch
#

im using it to store mute data

vocal cloud
#

Well if you want to be able to mute offline players you will absolutely want to use a db

coarse finch
#

eh it doesnt matter much

#

also can someone reset my nickname, its set to my old username

#

hos something in java changed where if you do like if (null) it throws an error?

#

because im getting all sorts of errors i didnt used to get

outer river
#

Hi, i'm trying to return a list of string (commands in a config) while key is called (with an hashmap) and executes theses commands in the consol but actually, only the first message is spaming in the consol without never stop (until the serv crash) do you see something that goes wrong in my code pls ? :

#

    String rewardname1 = getConfig().getString("Rewards.1.name");
    String rewardname2 = getConfig().getString("Rewards.2.name");
    String rewardname3 = getConfig().getString("Rewards.3.name");
    String rewardname4 = getConfig().getString("Rewards.4.name");
    String rewardname5 = getConfig().getString("Rewards.5.name");
    List<String> rewardcommand1 = getConfig().getStringList("Rewards.1.command");
    List<String> rewardcommand2 = getConfig().getStringList("Rewards.2.command");
    List<String> rewardcommand3 = getConfig().getStringList("Rewards.3.command");
    List<String> rewardcommand4 = getConfig().getStringList("Rewards.4.command");
    List<String> rewardcommand5 = getConfig().getStringList("Rewards.5.command");
    
    public Map<String, List<String>> reward = new HashMap<>();
    
    public void configAddList() {
        if (rewardname1 != null && rewardcommand1 != null) {
            reward.put(rewardname1, rewardcommand1);
        }
        if (rewardname2 != null && rewardcommand2 != null) {
            reward.put(rewardname2, rewardcommand2);
        }
        if (rewardname3 != null && rewardcommand3 != null) {
            reward.put(rewardname3, rewardcommand3);
        }
        if (rewardname4 != null && rewardcommand4 != null) {
            reward.put(rewardname4, rewardcommand4);
        }
        if (rewardname5 != null && rewardcommand5 != null) {
            reward.put(rewardname5, rewardcommand5);
        }
    }
    
    public void Dispatcher(List<String> list) {
        while (list.iterator().hasNext()) {
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), list.iterator().next().replace("%player%", player));
        }
    }```
#
public class Event implements Listener {
    
    
    @EventHandler
    public void onKill(PlayerDeathEvent death) {
        String player = death.getEntity().getPlayer().getName();
        Main.instance.grabPlayer(player);
        
        if (Main.instance.lever == true) {
            if (Main.instance.args.equalsIgnoreCase(Main.instance.rewardname1)) {
                Main.instance.Dispatcher(Main.instance.reward.get(Main.instance.rewardname1));
            }
            if (Main.instance.args.equalsIgnoreCase(Main.instance.rewardname2)) {
                Main.instance.Dispatcher(Main.instance.reward.get(Main.instance.rewardname2));
            }
        }
        else {
        }
    }
    
}
#

(args is my args[0] of my command)

novel kite
#

wait actually

#

maybe im a dumbass

outer river
novel kite
outer river
#

ahah np x)

novel kite
#

try this, hopefully my tired brain didnt screw this one

    public void Dispatcher(List<String> list) {
        for (String command : list) {
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), command.replace("%player%", player));
        }
    }
#

im headed to bed my brain is shutting down as i type

outer river
rough basin
#

Can I make block items that cannot be placed by modifying MetaData?

native edge
#

command /clearchat:
trigger:
loop 100 times:
broadcast ""
broadcast "chat cleared!"
command /mutechat:
trigger:
if {chat::mute} isn't set:
set {chat::mute} to true
send "chat muted!"
else:
delete {chat::muted}
send "unmuted chat!"
on chat:
if {chat::muted} is true:
cancel event
send "chat is muted!"

drowsy helm
ancient plank
#

skript more like

#

lol

quaint mantle
#

Hello, im trying to code a gmc command,

 @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0 && command.getName().equalsIgnoreCase("gmc")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if (!player.getGameMode().equals(GameMode.CREATIVE)) {
                    if (player.hasPermission("pvessentials.creative")) {
                        player.setGameMode(GameMode.CREATIVE);
                        player.sendMessage(ChatColor.WHITE + "Set gamemode to Creative");
                    } else {
                        player.sendMessage(ChatColor.RED + "You do not have permission for this command!");
                    }
                }
            }
        }
        else if (args.length > 0 && command.getName().equalsIgnoreCase("gmc")) {
            if (sender instanceof Player player) {
                String playerName = args[0];
                Player target = Bukkit.getServer().getPlayerExact(playerName);
                if (target == null) {
                    player.sendMessage(ChatColor.RED+"That player does not exist!");
                }
                else {
                    if (!player.getGameMode().equals(GameMode.CREATIVE)) {
                        if (player.hasPermission("pvessentials.creative.other")) {
                            target.setGameMode(GameMode.CREATIVE);
                            target.sendMessage(ChatColor.WHITE + "game mode changed to Creative");
                            player.sendMessage(ChatColor.YELLOW + "Set " + target.getDisplayName() + "'s gamemode to" + ChatColor.WHITE + " Creative");
                        } else {
                            player.sendMessage(ChatColor.RED + "You do not have permission for this command!");
                        }
                    }
                }
            }
        }
        return true;
    }```
#

This works while im op but doesnt work when i deop myself? I tried adding a no permission message in plugin.yml but the command itelf just doesn't work, it says "Unkown or incomplete command "

glossy lily
#

?whereami

floral drum
floral drum
#

...

lost matrix
quaint mantle
#

like if the player doesn't have x permission then u cant do x command so you get the "You don't have permission for this command!"

lost matrix
quaint mantle
#

it doesnt work

#

it doesn't give me the no permission message

unique bronze
#

Hey what's a good example of getting the horn type from a item stack is?

drowsy helm
#

does actionbar not send in adventure mode?

frank compass
#

does anyone know how to code flying boots basicly when you put on boots that are named "Flying boots" you are able to fly like in creative mode can anyone help?

lost matrix
rough basin
#

How do I save int-type values in Custom Item?

lost matrix
rough basin
#

I've already read the document, but I don't know if it can store different numbers for each custom item.

lost matrix
#

Yes it can

rough basin
#

Thanks, I will try it :)

sturdy frigate
#

Easy way to setup a navigator through diff worlds with a compass?

lost matrix
sturdy frigate
#

Teleport across different worlds like a lobby and whatnot

lost matrix
#

And whats the point of the compass?

sturdy frigate
#

No point, just as an item that'd be immediately noticible

#

Since a lot of servers use that

#

You know how you can right click on it and it displays a GUI that you can select different worlds from

lost matrix
#

Well then you give the compass some pdc data, prevent people from dropping it,
listen for the interact event and open a GUI that lets you click on different worlds...

sturdy frigate
#

Okay will check those out thanks

drowsy helm
#

anyone know what the clientbound message packet is called for protocol lib

#

there is PacketType.Play.Server.CHAT but that doesnt work

#

as in, i want to listen to all messages being sent to the player's chat (including plugins)

sturdy frigate
#

Hey guys is there a good API/Lib for scoreboards?

boreal sparrow
#

Hey, my friend has this minigame that has three maps in three seperate world. Is there a better way than constantly going:
switch(args[0]){
case "World1":
//teleport to world 1
break;

case "World2" etc.
}

#

I could have a seperate command for each map/world, but is there a streamlined way of doing this?

lost matrix
boreal sparrow
#

this is brilliant

buoyant viper
drowsy helm
#

i think chat is supposed to work, just doesnt look like it does on latest version of protoocl lib

buoyant viper
#

u usign the dev vers?

drowsy helm
#

yeah

#

wait let me double check

#

yeah i am

boreal sparrow
#

whats the best way to separate different worlds/maps for a minigame?

lost matrix
#

Separate in which context?

frosty tinsel
#

Hi, I wanted to ask. You know how many people use Pterodactyl, to run their networks, which uses Docker to run each minecraft server in a docker container. Isn't it kinda ineffective, when there are running multiple JVM instances along each other? (when there are 2+ servers on one machine)

boreal sparrow
# lost matrix Separate in which context?

for example: lets say I have an enum that has game states like IN_GAME, WON etc.
I really dont want to go IN_GAME_MAP_1, WON_MAP_1, IN_GAME_MAP_2...
So is there a way to handle every world on it's own?

frosty tinsel
#

and a GameManager

#

for example

lost matrix
frosty tinsel
#

that makes sense now

rough basin
#

What should I do to remove off hand and else?
I just want only Main hand

drowsy helm
#

the jvms for two servers are separate anyway, yeah theres the headroom for the container but its really not much

lost matrix
lost matrix
frosty tinsel
#

The worst thing in making minigames is handling Events

#

with Bukkits imo bad event API

lost matrix
#

Whats so bad about that? Sounds quite simple to me...

frosty tinsel
#

you don't really have much control over it

lost matrix
#

It does not break any oop concept. And you have full control over it.
What more control do you need?

glass mauve
#

hey :D
I used ProtocolLib to spawn Item Frames (entities) for a specific player
and I stored the entityID, how can I remove these Item Frames later with the entitiyID

rough basin
rough basin
#

oh bruh why i'm seeing methods

#

Sorry

glass mauve
glass mauve
#

ty

lost matrix
glass mauve
#

ty

drowsy helm
#

anyone else available to pull the 5.0.0 snapshot?

#

idk if im typing it wrong

drowsy helm
#

        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>5.0.0-20220727.143709-4</version>
            <scope>provided</scope>
        </dependency>```
does this look correct?
#

i tried with every combination of version and public/releases/snapshots on repo

glass mauve
#

btw someone know when protocolLib comes to 1.19?

drowsy helm
#

snapshots are out

#

thats whawt im talking about rn

glass mauve
#

oh lol xDDDD

#

didn't saw it

#

but how can I download it for my server?

lost matrix
lost matrix
drowsy helm
#

i tried with 5.0.0-SNAPSHOT aswell

lost matrix
#

Just use 5.0.0-SNAPSHOT

drowsy helm
#

was just throwing stuff at it to see if it works

lost matrix
#

Ah i see

drowsy helm
#

omg

#

smile

#

im dumb

#

i was in offline mode

lost matrix
rough basin
#

How much is player's default movement speed

#

nasusQMeta.addAttributeModifier(Attribute.GENERIC_MOVEMENT_SPEED,new AttributeModifier(UUID.randomUUID(), "MovementSpeed", -0.5, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND));

#

-0.5 just stops player

glass mauve
river oracle
rough basin
#

thanks :)

drowsy helm
#

just change the version

glass mauve
#

yea but I also need it in my plugin folder

drowsy helm
#

hold up i gotchu

glass mauve
#

ty

rough basin
glass mauve
#

hm with 5.0.0 I get problems using WrapperPlayServerSpawnEntity
cause it imports com.comphenix.protocol.reflect.IntEnum;
what is the equivalent?

glass mauve
river oracle
#

That's a new one

rough basin
#

?paste

undone axleBOT
rough basin
crude charm
#

Is 1.19 spigot working and stable to large scale development? Or would it be worth using something like purpur for newer versions as I have in the past?

lost matrix
drowsy helm
#

anyone ever tried converting a string with chat color to grayscale

crude charm
lost matrix
#

spigot 1.19.2 is stable and released

crude charm
#

Tbh idek when 1.19 or even 18 released, don't usually use / work on newer version, but for this project it makes sense to

crude charm
glass mauve
#

OOF the plib wrapper dont work for 1.19

crude charm
#

Last update I followed was 1.10, know nothing about everything after that

lost matrix
glass mauve
#

I get this
FieldAccessException

lost matrix
#

Oh you mean the wrapper classes... yeah they are outdated for years now

glass mauve
#

yea

#

so I need to do everything manually?

glass mauve
hushed pawn
#

How to check if some players from List are close enough to some locations? (every tick)

lost matrix
hushed pawn
#

What is the best way?

crude charm
#

Do newer versions of spigot have a way to set the defense value of armour without giving it protection 1000000?

rough basin
#

How to add values in persistentData?

glass mauve
# lost matrix Go to wiki.vg and look at the fields

yea and then? I have:

PacketContainer packet = PROTOCOL_MANAGER.createPacket(PacketType.Play.Server.SPAWN_ENTITY);

which methods do I need?
for these:

        WrapperPlayServerSpawnEntity entity = new WrapperPlayServerSpawnEntity(packet);

        entity.setType(EntityType.ITEM_FRAME);
        entity.setUniqueId(UUID.randomUUID());
        entity.setEntityID(ID_GENERATOR.getAndIncrement());

        entity.setX(x);
        entity.setY(y);
        entity.setZ(z);

        entity.setObjectData(direction);
        entity.setYaw(YAW[direction]);
        entity.setPitch(PITCH[direction]);
#

how do I know which fieldIndex for example Type -> VarInt is?
is it 2? or 3?

#

or can I use packet.setMeta method?

drowsy helm
#

should just use mojang mappings

glass mauve
#

nah

glass mauve
crude charm
#

Do newer versions of spigot have a way to set the defense value of armour without giving it protection 1000000?

glass mauve
boreal sparrow
#

I still can't warp my head around how to seperate worlds efficiently, should I create a new object for each world?

#

Like if I have an enum of gamestates, could I create a gameMap object that has it's own gamestate? I'm really confused

crude charm
boreal sparrow
#

for minigame maps

crude charm
#

Could take the hypixel approach and have minigame servers

hushed pawn
#

Bungeecord is the most effective way i believe

boreal sparrow
#

yea i know servers are way easier, but is there a way to do this with worlds?

crude charm
#

ofc there is a way to do it all in one world as well

#

Just depends what u wanna make and stuff

#

if its like uhc or smth then u kinda need multiple servers for performance

#

if its tnt tag then u can do it on one

#

assuming ur code isn't shit

boreal sparrow
#

Yes, all I want to do is handle all the events/game states for the worlds seperatly. But I also want to minimize duped code, what's the best way of doing this?

crude charm
#

For gamestates, enums

#

what is the minigame?

boreal sparrow
#

a simple minigame that has parkour, and two players with bows trying to shoot them off, I already got that mostly sorted, but now I need to add more maps so the whole thing kinda breaks down

#

there is only one world, (ie. one game at a time, dumb, I know, but it's a really small server)

crude charm
#

It's probs because you hardcoded alot of it around one map

#

I can't see your whole project so idk how to help you but you should be able to figure it out yourself, just use enums for gamestates and you can have a var in the enum for the world or smth and use that

boreal sparrow
#

that might work

#

thanks for your help

crude charm
#

All good

echo basalt
glass mauve
echo basalt
#

you gotta send like 3 different packets

glass mauve
#

nah 2

#

SPAWN_ENTITY + ENTITY_METADATA

echo basalt
#

MapItemData too

#

to render the map

glass mauve
#

and for destroying:
ENTITY_DESTROY

glass mauve
echo basalt
#

otherwise you'll have an empty itemframe

#

I guess that can work

glass mauve
#

I alr. got it to work for 1.18 but 1.19 packet wrapper doesn't work anymore

echo basalt
#

Mine's funky

glass mauve
#

you send the mapPacket yourself?

#

can't I get the Array of VarInt EntityID's using
packet.getIntegerArrays().write(0, ...);

#

or is it IntLists?

hushed pawn
#

Automatic creation of different runnables for every player, and deleting it when they leave, is it good idea?

lost matrix
lost matrix
#

Version?

#

And you are using ExactChoice for ingredients?

glass mauve
lost matrix
#

Well then its a simple ingredient missmatch. Make sure to never reload your server because it almost always breaks something

hushed pawn
lost matrix
#

Why do you need a hashmap for this??

boreal sparrow
#

Ok this is a really dumb question, but I've gone to StackOverflow at least 6 times now, why can't I call this?

public class WorldManager {
    public List<String> worlds = new ArrayList<String>();

    public void setWorlds(List<String> worlds) {
        this.worlds = worlds;
    }
    
    setWorlds() //Can't call? Invalid method declaration return type required??
}
lost matrix
#

And i hope that you are always cloning the item and never use the original, right?

lost matrix
echo basalt
#

this isn't python

lost matrix
#

An i hope that this "item" is never given to a player. Only a clone of it.

echo basalt
#

bruh hypixel wannabe hackers are forking my skyblock core thinking it's the real shit

#

mutability

echo basalt
#

well you gotta save your recipes

#

it adds to the recipe iterator thing

#

the server doesn't save recipes

#

it just has a registry that fills up with contents during startup

lost matrix
#

No. You are adding it on every restart no reason to save them.

echo basalt
#

make your own config or something yeah

hushed pawn
# lost matrix What are you trying to do?

I have option to hit player from certain location
I need to hit certain players when they get close enough to that location so i have to check player location every tick

glass mauve
lost matrix
echo basalt
#

calling EntityType.WHATEVER.getTypeId returns the wrong id when it comes to protocol

#

you either mess with the registry or hardcode it

glass mauve
echo basalt
#

hm

#

You're using protocollib right

glass mauve
#

yep

echo basalt
#

show code

glass mauve
#
    private static void setItemFrameData(@NotNull PacketContainer packet, int entityID, double x, double y, double z, int direction) {
        packet.getIntegers().write(0, entityID);
        packet.getIntegers().write(1, 45);
        // packet -> set unique id

        packet.getDoubles().write(0, x);
        packet.getDoubles().write(1, y);
        packet.getDoubles().write(2, z);

        packet.getIntegers().write(4, direction);
        packet.getIntegers().write(3, (int) (YAW[direction] * 256.0F / 360.0F));
        packet.getIntegers().write(2, (int) (PITCH[direction] * 256.0F / 360.0F));
    }
echo basalt
#

yeah that's not gonna awork

glass mauve
#

whats wrong

echo basalt
#

are you using SPAWN_ENTITY or are you using SPAWN_ENTITY_LIVING?

glass mauve
#

SPAWN_ENTITY

echo basalt
#

pass an entitytype

#

and not the type id

glass mauve
echo basalt
#

the entitytype gets converted to type id when writing

#

packet.getEntityTypes() ...

glass mauve
#

like this?

echo basalt
#

Yeah

glass mauve
#

is it field index 0?

echo basalt
#

yeah

glass mauve
#

ty let me test

echo basalt
#

you only need to pass a type id for SPAWN_ENTITY_LIVING

#

type thing

glass mauve
echo basalt
#

somewhat

#

0 -> id
1 -> xVel
2 -> yVel
3 -> zVel
4 -> pitch?
5 -> yaw
6 -> data (entity type specific)

fiery prairie
#

in PlayerQuitEvent, if i set the player's health to 0 using setHealth, will it actually kill him? well since he logged out already

echo basalt
#

yes

glass mauve
echo basalt
#

well

#

the packet stores it as ints internally

#

but serializes it as shorts

#

xRot and yRot are serialized as bytes

#

still stored as int

fiery prairie
# echo basalt yes

okay, and if someone was during combat (more like the built-in system of minecraft) would the death message still be like the person died because the other guy killed him or is it just gonna be "Player died."?

echo basalt
#

Try it and see

glass mauve
fiery prairie
echo basalt
glass mauve
#

🀑

echo basalt
#

protocollib just writes the fields

#

I have a guide that does a basic demo on how it worky

#

wrote it a while ago when 1.17 was the latest ver

glass mauve
#

but when I use getIntegers.write(); which index do I need? the same as nms stuff

echo basalt
#

starts from 0

#

and it's the order where it's declared in the class

glass mauve
#

with class you mean this? from top to bottom? thats what I did

echo basalt
#

wiki.vg doesn't reflect the nms format

#

but it's useful for cross-referencing unknown variables

glass mauve
#

this shit so confusing

echo basalt
#

wiki.vg reflects the true protocol, and not how nms handles it

#

ProtocolLib just grabs the objects you're writing and uses reflections to write it to the internal nms packet "handle"

#

Let's take a basic example

#

and make our own bootleg packet

#

in pseudocode because I can't bother

glass mauve
#

np thanks :D

echo basalt
#
ClientboundWhateverPacket {

  x : int
  y : int
  z : float

  write(buffer) {
    writeLong(x)
    writeInt(y)
    writeFloat(z)
  }
}
#

wiki.vg will say:

  • x is a long
  • y is an int
  • z is a float

ProtocolLib will say:

  • x is int id 0
  • y is int id 1
  • z is float id 0
glass mauve
#

ok so if I want to know index I need to decomp and look myself

echo basalt
#

yeah

glass mauve
#

there is no list online?

#

why not?

echo basalt
#

but it reflects the contents that are serialized and not the fields in the packet class

#

It's also quicker to decompile

#

you can just middle-click on intellij

#

or Ctrl+B iirc

glass mauve
echo basalt
#

I honestly just use wiki.vg to see what packets I can mess with

#

There is a way to create packets the wiki.vg way

#

and it's to like

#

create a bytebuf

#

write the contents with the wiki.vg format

#

and use the bytebuf constructor

#

Example

ByteBuf byteBuf = Unpooled.buffer();
FriendlyByteBuf buffer = new FriendlyByteBuf(byteBuf);

buffer.writeVarInt(123);

PacketWhatever packet = new PacketWhatever(buffer);
sendPacket
#

tho it's hacky

#

and I've only seen it use in a plugin once

glass mauve
#

ok thank you very much, let me try to

fiery prairie
#

in EntityDamageByEntityEvent, e.getEntity is the entity who attacked and e.getDamager() will be the one who got attacked, right?

#

or is it the exact opposite

echo basalt
#

getDamager is the damager

#

getEntity is the victim

fiery prairie
#

thanks

glass mauve
#

this should work if yours would be true but I get this error:

Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 6 is out of bounds for length 5
        at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:289) ~[?:?]
        at com.squidxtv.frameui.packets.PacketManager.setItemFrameData(PacketManager.java:56) ~[?:?]
        at com.squidxtv.frameui.packets.PacketManager.sendItemFrame(PacketManager.java:36) ~[?:?]
        at com.squidxtv.frameui.core.Screen.loadItemFrames(Screen.java:70) ~[?:?]
        at com.squidxtv.frameui.core.Screen.<init>(Screen.java:49) ~[?:?]
        at com.squidxtv.frameui.commands.ScreenCommand.onCommand(ScreenCommand.java:36) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        ... 23 more
#

or did I smth wrong

echo basalt
#

uhh it's version specific

#

just check the nms packet

glass mauve
#

oh ok

#

where can I find it in my ide?

#

nvm found

#

nvm I found the spigot api but where can I find this nms stuff

echo basalt
#

did you import spigot-api

#

or did you import spigot?

#

or are you using mojmappings?

glass mauve
#

uh

#
plugins {
    id 'java'
}

group = 'com.squidxtv'
version = "${version}"

repositories {
    mavenCentral()
    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven { url "https://repo.dmulloy2.net/repository/public/" }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
}

dependencies {
    implementation 'org.jetbrains:annotations:23.0.0'
    compileOnly "org.spigotmc:spigot-api:${spigot_version}"
    compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "${protocollib_version}"
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}
echo basalt
#

yeah you importing spigot-api

glass mauve
#

spigot-api

echo basalt
#

change it to spigot

#

if it doesn't recognize, run buildtools

#

or you can just run mojmappings

glass mauve
#

ok ty

echo basalt
#

mojmappings build.gradle

#

add

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven { url = "https://repo.papermc.io/repository/maven-public/" }
    }
}

to your settings.gradle to access it

#

and change the version as well

glass mauve
echo basalt
#

if you want to

#

it uses paper tho

glass mauve
#

no I want to stay with spigot,
I actually started with PaperMC for this project but I wasn't sure if spigot server could use paper plugins

echo basalt
#

they can for the most part

#

if you want to stay with spigot, change spigot-api to spigot

#

and maybe run buildtools

#

you'll have obfuscated nms

#

which is a pain but I'm used to it

#

Then the packets will be like PacketPlayOutWhatever

glass mauve
#

ok and where can I find it in nms

#

nvm it's in net.minecraft.network.protocol?

opal juniper
#

network

#

yes

glass mauve
#

and why is it called nms?

opal juniper
#

its the package, net.minecraft.server - initials are n.m.s

crude charm
#

Do newer versions of spigot have a way to set the defense value of armour without giving it protection 1000000?

crude charm