#help-development

1 messages · Page 35 of 1

cunning canopy
#

good idea

#

Iiiiits refactor time

tardy delta
#

me the whole day already 🥺

#

soo many errors

#

opened a 2nd project just to test stuff lol

cunning canopy
#

would having a #tick method in that class, then calling the tick every tick from a runnable be a good idea, or is there something better I should do

tardy delta
#

implement Runnable

#

or BukkitRunnable

#

i had some related errors and i just choose another jdk and compiled with that and it worked fine

#

is it the first time you get this when compiling plugin?

cunning canopy
tardy delta
#

idk

native bramble
#

how to take a book without PlayerTakeLecternBookEvent?

#

i need smth like this:
player with custom item right click on lectern with book
after that book author changing and book drop

tardy delta
#

probably taking another sdk will resolve it

#

anyways, is there a real profit by choosing the right eventpriority for a listener?

glossy venture
#

bro what the fuck

tardy delta
#

what if you make it private?

glossy venture
#

wtf

#

that fixed it

#

well thanks i guess

#

it worked before idk why it broke

tardy delta
#

lol

glossy venture
#

no bruh it broke

#

again

#

what the fuck is this now

#

NO WHAT THE FUCK

#

bruh i swear if invalidate caches doesnt fix it

eternal oxide
#

clear cache

tardy delta
#

that ide is fucked up i swear

#

😂

glossy venture
#

yeah wtf

#

indexing jdk 16? shouldnt it have shared caches

tardy delta
#

my ide is just using all my power lol

glossy venture
#

ayyyyyyy it fixed it

#

finally

#

fucking twat ide

tardy delta
#

ij be like fourteen paid for the whole psu, imma use the whole psu

#

What a beast lmao

#

some power thing on my laptops cable lol

#

ye

#

i hope i wont be able to bake an egg on it like the prev one

#

use the maven shade plugin

#

doesnt alex has some guide on his website thing?

#

uh oh

eternal oxide
#

you are clearly using Maven as you have maven dependencies. You should be using the pom/maven not exporting

modest garnet
#

anyone know what this means

tardy delta
#

db not opened ig?

#

connection or smth

river oracle
gray merlin
#

What does the BukkitObjectInputStream add over ObjectInputStream?

tardy delta
undone axleBOT
misty ingot
#
    public void mySqlSetup() {
        try {
            File file = new File(getDataFolder(), "config.yml");
            host = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file).getString("database.host");
            port = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file).getInt("database.port");
            database = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file).getString("database.database");
            username = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file).getString("database.username");
            password = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file).getString("database.password");
        }
        catch (IOException e) {
            e.printStackTrace();
        }

        try {
            synchronized (this) {
                if (getConnection() != null && !getConnection().isClosed()) {
                    return;
                }

                Class.forName("com.mysql.cj.jdbc.Driver");
                setConnection(DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password));

                getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS villagerPark_players (UUID varchar(50), NAME varchar(100), ECO int, STREAK int, LastStreakGiven DATETIME").executeUpdate();
                ProxyServer.getInstance().getConsole().sendMessage(new ComponentBuilder("Successfully connected to the MySQL database").create());
            }
        } catch (SQLException | ClassNotFoundException e) {
            ProxyServer.getInstance().getConsole().sendMessage(new ComponentBuilder("Error connecting to the MySQL database").create());
            e.printStackTrace();
        }
    }

what did I do wrong?

gray merlin
tardy delta
#

check your sql syntax with some online tool

opal juniper
#

shade it?

brittle copper
#

https://pastebin.com/BTvvpzVy

Can anyone help me with this? I have no idea what to do, I need both plugins and they worked fine before but now they dont

opal juniper
#

change the scope to compile and shade with maven shade plugin

misty ingot
#

tried Timestamp and TIMESTAMP too

undone axleBOT
silent wave
#

i have issues when i try to join to the server and i have the console server open

gray merlin
#

@tender shard Small question, in your library, you seem to use Base64Coder#encodeLines preferentially (In the ItemSerializer) part. Why's that?

#

The documentation for that one says it splits the output into lines of 74 characters, but surely each item can't be 74 characters long?

silent wave
#

someone can help me pls

delicate lynx
#

1.8 :(

cunning canopy
#

this bad practice? ```java
final boolean lostAllSheep = this.playerSheepCount.get(playerId) == 0;
if (lostAllSheep)

misty ingot
cunning canopy
#

well is it good practice or just neutral?

tardy delta
#

hoping there is a first player

#

or it will throw a npe

silent wave
tender shard
#

the base64 decoder doesn't really care about newlines iirc

gray merlin
tardy delta
cunning canopy
#

soon ~= 30 mins

#

why?

silent wave
#

its a plugin or other thing

tardy delta
#

just wanted to know

#

nearly refactored my whole storage design

sterile token
#

I have a fast dought paginated/paged menu/guis create a new inventory per page or just use the same inv but ordering the items?

cunning canopy
#

if I pass an arraylist to a function and modify it, will it be changed in the other scope? Is the argument the same object?

tardy delta
#

the list will be changed yes

cunning canopy
silent wave
#

com.comphenix.net.sf.cglib.proxy.Enhancer what can i do

tardy delta
#
class Test {
  List<String> strings = Lists.newArrayList("one", "two", "three");

  void something(List<String> strings) {
    strings.add("four");
  }
}``` strings will be changed yes
tardy delta
#

if you mean smth like that

tender shard
tardy delta
#

List.newArrayList :( 🔫

cunning canopy
#

if I do entity.remove() will it also be removed as a passenger of another entity automatically?

torn shuttle
#

does anyone happen to have a code snippet where they get the generic_attack_damage attribute from an itemstack? I think I have it right but my code looks like it's trying to summon Cthulhu

#

itemStack .getItemMeta() .getAttributeModifiers() .get(Attribute.GENERIC_ATTACK_DAMAGE) .stream() .findFirst() .get(). getAmount();
not sure about that stream

silent wave
#

i dont know how to repair it

tender shard
tender shard
silent wave
#

i'm gonna try

torn shuttle
#

so the attack speed could have multiple attributes affecting it? Is there a way for me to just get the final result?

tender shard
#

unless I misunderstood what attributes are

silent wave
civic apex
#

I'm trying to display a scoreboard to a player using packets. I have to send a ScoreboardObjective, but I cant cast Objective to CraftObjective

#

because its not public

#

I tried using reflection but it throws this
java.lang.RuntimeException: java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_18_R2.scoreboard.CraftObjective.getHandle()

torn shuttle
silent wave
civic apex
#

also Im using a paper jar for my server

tender shard
eternal night
#

I mean, the API already has support for per-player scoreboards

civic apex
#

im trying to send 2 different sb

#

tablist and sidebar

tender shard
#

why don't you just create an NMS objective if you don't wanna use the API?

#

it's pointless to create a bukkit objective if you don't wanna use bukkit to send it

civic apex
#

but why doesnt my code work? does paper use a different craftbukkit

civic apex
#

because it throws NoSuchMethodException when the method (in the BuildTools CraftBukkit jar) clearly exists

undone axleBOT
sterile token
#

Mfalex did you ping me my mate?

tender shard
sterile token
#

Allr thanks dont worry

tender shard
#

like this

sterile token
#

Oh I really having issue with páginated menus. Do they create a new inventory for each page or how does they work?

tender shard
tender shard
#

getMethod always only gets public methods (or the closest accessible one) because otherwise there'd be visibility problems if e.g. a class overrides a private method of any super class, etc whatever

cunning canopy
#

this a bad idea? import org.bukkit.*;

tender shard
tender shard
#

in bytecode, there are no imports anyway

torn shuttle
#

ok so let me see if I am understanding this correctly, items have attribute modifiers but the attribute that gets modified is stored player-side?

#

because it looks like I can get a final attack speed attribute from a player

digital rain
#
``` this is the line where i set custom player skulls, but i forgot where do i get those skins in this form
cunning canopy
tender shard
cunning canopy
#

because of the memes

eternal night
#

its about recompilation that would fuck it up

#

generally with any wildcard import

#

was a mistake to ever have those in the first place smh

tender shard
#

recompilation? wdym?

misty ingot
#

CREATE TABLE IF NOT EXISTS villagerPark_players (UUID varchar(50), NAME varchar(100), ECO int, STREAK int, LastStreakGiven varchar(100);
can someone please tell me what the HECC is wrong with this sql syntax?

tardy delta
#

) at the end

torn shuttle
#

any ideas of how the ADD_SCALAR operation for attribute modifiers works?

native bramble
#
@EventHandler
    public void craftItem(PrepareItemCraftEvent event) {
        CraftingInventory craftingInventory = event.getInventory();
        ItemStack[] list = craftingInventory.getMatrix();
        if(list[0] != null && list[1] != null && list[0].getType() == Material.WRITTEN_BOOK && list[1].hasItemMeta() && list[1].getItemMeta().hasCustomModelData() && list[1].getItemMeta().getCustomModelData() == 1213){
            ItemStack book_new = new ItemStack(Material.WRITTEN_BOOK);
            BookMeta book1_meta = (BookMeta) list[0].getItemMeta().clone();
            String str = list[1].getItemMeta().getLore().get(0);
            ArrayList<String> lore = new ArrayList<String>();
            lore.add(colorFormat("&d" + str));
            book1_meta.setLore(lore);
            book_new.setItemMeta(book1_meta);
            event.getInventory().setResult(book_new);
        }
    }
public String colorFormat(String s) {
        s = ChatColor.translateAlternateColorCodes('&',s);
        return s;
    }

i dont know why, but book lore is not colored

torn shuttle
#

I see that Papple, I also don't know what adding a scalar amount looks like

tender shard
torn shuttle
#

uh

#

really?

waxen plinth
#

Add?

ornate patio
#

How do I change the text of a tag above a player?

I've tried mounting an invisible armor stand on the player, but the name tag ends up being too low and hard to see.
I've also tried rapidly teleporting the armor stand to the player, but then the player can see their own name tag.

Anyone have any ideas?

waxen plinth
#

Add scalar is +0.5 to the multiplier

#

1.5 * 5, no?

torn shuttle
#

I mean why offhand in the first place?

tender shard
#

ADD_SCALAR with 0.5 with "halfen" the value

torn shuttle
#

halved

tender shard
#
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
ItemMeta swordMeta = sword.getItemMeta() == null ? Bukkit.getItemFactory().getItemMeta(Material.NETHERITE_SWORD) : sword.getItemMeta();
AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "test", 0.5, AttributeModifier.Operation.ADD_SCALAR, EquipmentSlot.OFF_HAND);
swordMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
// "sword" will now deal only 50% of damage when in offhand. Unless I'm totally stupid right now
#

this is at least how I understood it

#

let me just try it quickly

torn shuttle
#

this is pretty whacky

waxen plinth
#

Are you sure it wouldn't be 5 + 0.5 in that case

tender shard
obsidian drift
#

Is there any way to set an attribute modifier to a specific value?

ornate patio
tranquil viper
#

I'm trying to modify the damage on EntityDamageEntityEvent. My idea is to make some sort of method that calculates a modified damage, although I'm horrible at math. Anyone know how I should approach this?

My idea was:

public double getModifiedDamage(double orgValue, double percentage) {
   return (double)(value*(percentage/100.0f));
}

I'm not positive this would work, thoughts? For exampe if orgValue was 30 and the percentage was 20 than it should return 80% of the original value (24).

gray merlin
#

Hm. I tried doing this, but it seems like I can't cast CustomCraftInventory to PlayerInventory, even if it looks like I should be able to.

PlayerInventory playerInventory = (PlayerInventory) Bukkit.createInventory(null, InventoryType.PLAYER);
#

How would I create an instance of an empty PlayerInventory?

tender shard
#

lol yeah you are right that 0.5 with ADD_SCALAR gives +50%

#

but now the weird thing comes:

#

using MULTIPLY_SCALAR_1 with 0.5 also gives +50%

torn shuttle
#

ah of course

tender shard
#

and so, it's pointless to have two enums if they both to the same thing

#

like whut

torn shuttle
#

so uh

#

multiply scalar doesn't do what's documented then huh

#

multiply after adding 1

#

so something like damage += damage * 0.5?

tender shard
#

yeah, add_scalar with 0.5 doesnt do x*0.5 but it does x+x*0.5

torn shuttle
#

sick

tender shard
#

to get -50%, one can use -0.5 for ADD_SCALAR

ornate patio
#

How do I tell if an entity is a mob or monster?

tender shard
#

check if the entity is instanceof mob or monster

ornate patio
#

I want to exclude armor stands, minecarts, etc

ornate patio
torn shuttle
#
    /**
     * Gets the GENERIC_ATTACK_SPEED {@Attribute} from any item - for players assuming a default {@Player} attack speed!
     *
     * @param itemStack ItemStack to analyze
     * @return Attack speed value
     */
    public static double getAttackSpeed(@Nullable ItemStack itemStack) {
        double defaultAttackSpeed = 4.0;
        if (itemStack != null &&
                itemStack.getItemMeta() != null &&
                itemStack.getItemMeta().getAttributeModifiers() != null &&
                itemStack.getItemMeta().getAttributeModifiers().containsKey(Attribute.GENERIC_ATTACK_SPEED)) {
            for (AttributeModifier attributeModifier : itemStack
                    .getItemMeta()
                    .getAttributeModifiers()
                    .get(Attribute.GENERIC_ATTACK_SPEED)) {
                switch (attributeModifier.getOperation()) {
                    case ADD_NUMBER:
                        defaultAttackSpeed += attributeModifier.getAmount();
                        break;
                    case MULTIPLY_SCALAR_1:
                    case ADD_SCALAR:
                        //Yes, these two do the same thing. No, they shouldn't.
                        defaultAttackSpeed += defaultAttackSpeed * attributeModifier.getAmount();
                        break;
                }
            }
        }
        return defaultAttackSpeed;
    }

so am I on the right track then

tender shard
#

monsters are always mobs too

ornate patio
#

Well

#

Is there any mob in the game that is not a subclass of Mob by Spigot

ornate patio
#

Which ones

tender shard
#

Monster extends Creature extends Mob extends LivingEntity extends Damageable extends Entity

tender shard
torn shuttle
#

^

ornate patio
#

ok wait

tender shard
#

mobs are basically all "living" entities that have at least basic AI

ornate patio
#

By Mob

#

i mean like

#

animals, monsters

#

things that move

tender shard
#

yes

#

armor stands do not move

#

hence they are no mobs

torn shuttle
#

if your armorstands aren't moving you're just not trying hard enough

ornate patio
#

okay then

tender shard
torn shuttle
#

pretty sure minecarts aren't mobs

tender shard
tender shard
torn shuttle
#

also falling entities

tender shard
#

everything that has pathfinding is a mob

ornate patio
#

its jsut weird

placid fog
#

Location location =e.getClickedBlock().getLocation(); is this correct to get the location of a block i clicked on

tender shard
#

it makes perfect sense. Mob = has pathfinding

#

Creature = has complex pathfinding

ornate patio
#

because EntityDeathEvent only triggers on mob kills, plus armor stands for some reason

torn shuttle
#

falling is a type of pathfinding, you're just jealous of how optimized it is

tender shard
torn shuttle
#

you can also "kill" them

ornate patio
#

but boats and minecarts dont count though

#

minecart chests

torn shuttle
#

though tbf the same can be said of ender crystals and those are not living

tender shard
#

because boats can't have equipment etc, mojang didnt make them extend LivingEntity

tardy delta
ornate patio
#

How do I change the text of a tag above a player?

I've tried mounting an invisible armor stand on the player, but the name tag ends up being too low and hard to see.
I've also tried rapidly teleporting the armor stand to the player, but then the player can see their own name tag.

Anyone have any ideas?

tender shard
#

just hide the armor stand to that player

#

or just directly use packets instead of real armor stands

ornate patio
tender shard
#

Player#hideEntity(theirOwnArmorStand)

ornate patio
ornate patio
#

Will it affect join/death messages

#

and stuff

tender shard
ornate patio
#

what else does it do then

tender shard
gray merlin
#

Is there really no way to get a PlayerInventory without a Player? It would let me avoid some more lines of code...

ornate patio
#

i'll try again

quaint mantle
#

i need help

#

mc mc crash

gray merlin
#

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

river oracle
quaint mantle
ornate patio
#

For some reason mojang mapped doesn't deobfuscate the packet classes

gray merlin
quaint mantle
# quaint mantle

is just use this Bukkit.getWorlds().get(0).playEffect(event.getPlayer().getLocation(), Effect.NOTE,1);

river oracle
gray merlin
#

But thanks.

tender shard
#

just serialize the armor contents manually yourself as array or sth

ornate patio
#

It still deobfuscates entities and stuff though

gray merlin
#

It's pain.

tender shard
tender shard
#

NO PACKET ever is named PacketPlayOutWhatever... they called ClientboundWhateverPacket

ornate patio
#

idk it's only deobfuscated half the stuff..

#

oh

#

lmao

tender shard
#

these are the proper packet names

tender shard
ornate patio
#

for some reason i could view the PacketPlayOut stuff and ClientBount stuff

gray merlin
#

I'm assuming that the last four slots on a player.getInventory().getContents() are the armour slots, right?

ornate patio
# tender shard looks like you added both remapped and spigot mappings to your pom.xml

does this look normal?

<dependency>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot-api</artifactId>
  <version>1.18.2-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot</artifactId>
  <version>1.18.2-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
  <classifier>remapped-mojang</classifier>
</dependency>
tender shard
#

no, this looks shitty lol

#

you added both remapped and not remapped

#

oh wait

#

first one is only the api

ornate patio
#

well funnily enough...

tender shard
#

then it's fine

ornate patio
#

i copied this from your blog lmao

tender shard
#

you probably added spigot.jar manually in intelliJ

#

yeah having the api and remapped is fine

ornate patio
#

dont argue

#

i like it

tender shard
#

no idea but obviously it has problems with using only the remapped names

ornate patio
#

either way no I haven't added any reference jars

tender shard
#

idk then

#

the spigot-api will definitely not cause problems, it does not contain ANY nms stuff

ornate patio
#

hmm ok

tender shard
#

no idea why vscode still suggests you both class names

#

does it have something like "invalidate caches", like intelliJ has?

void isle
#

How can i send a message to my server tchat when a button is pressed on my website ?

tender shard
tardy delta
#

ah i misspelled persistance

tender shard
#

just pretend that its dutch

tardy delta
#

it isnt?

tender shard
#

only the dutch will know

#

to those you can pretend it's german, idk

tardy delta
#

probably

#

smh tihs keyboard sucks

#

kinda proud of the code uwu

crisp steeple
tardy delta
#

some chinese dude

tender shard
opal juniper
#

honestly, just a simple http request would work. WS seems a bit overkill

#

a simple http server on the server on a separate thread and then just sending POST requests from the webpage would work

ornate patio
#

how do i change the name of a player using packets

#

ive been on this for 2 days now

#

I don't have much experience with how they work

grim ice
#

u actually can use it?

#

thats pretty cool

#

well even forgegradle has a runtask for vscode

#

so ig its possible

gray merlin
#

Can we develop plugins for 1.7.10 in JDK 9 or is it 8 only?

boreal seal
#

it will give you an very clear answer instatly

#

idk i use 8 when i code plugins for 1.7-1.8

eternal night
#

you can code your plugin in whatever java version you can run your server with

#

i have no idea what 1.7.10 uses

boreal seal
#

8

tender shard
eternal night
#

probably the feeling of death ?

#

and the souls of security issues

gray merlin
#

In the sense that I asked something stupid, that I could've googled.

#

And was asking for the "maybe use google this time"

tender shard
#

as said, as long as you use java9+ to actually run the server, then you can also compile your plugins for java 9

gray merlin
#

I'll just... do what I need in a more roundabout way, cause Java 8 is the standard in many places.

tender shard
#

yeah well java 9 is dead since 20818

eternal night
#

java 8 is still the standard ? maybe in legacy enterprise code bases o.O

gray merlin
tender shard
#

many people still use java 8 as it has by far the longest extended support

eternal night
#

I mean, bstats I guess is not what you are getting your data from then

tender shard
eternal night
#

I presume for 1.7.10 it is

#

lol

tender shard
# tender shard

the last column is "Extended Support Until", the second last is "End of Free Public Updates"

eternal night
#

so basically java 8 is dead 😛

#

outside of enterprise

#

well 2030 for paying customers

tender shard
cunning canopy
#

can you make a nogravity entity have a walking animation while mounted?

eternal night
#

ohhh

#

you read that wrong

#

lmao

tender shard
#

yeah it's very confusing

eternal night
#

sadness

#

kill that thing already

tender shard
#

i wish they'd always only support the 2 latest LTS

#

and that an older LTS isnt longer supported than a newer one

#

because that makes no sense lol

eternal night
#

ngl, with like 19, 20, 21 they will make so many huge additions, not using them is just shooting yourself in the foot

torn shuttle
#

the way the attribute modifiers work make me want to punch an ostrich

cunning canopy
#

um

#

spigot website down for u too

#

its 502 bad gateway for me

ornate patio
#

How do I change a player's nametag with nms

eternal night
#

google

ornate patio
#

i did

eternal night
#

this question is like, the second most asked NMS question out there

ornate patio
#

It's all outdated though

tranquil viper
#
  private static final Pattern pattern = Pattern.compile("&#[a-fA-F0-9]{6}");

    public static String hexColor(String message) {
        Matcher matcher = pattern.matcher(message);

        while (matcher.find()) {
            String color = message.substring(matcher.start(), matcher.end());
            message = message.replace(color, "" + ChatColor.of(color));
            matcher = pattern.matcher(message);
        }

        return ChatColor.translateAlternateColorCodes('&', message);
    }

Error log: https://hastebin.de/wurebubina.properties

Anyone know what's going on?

eternal night
#

I mean

#

not really

#

the core concept still works

ornate patio
#

also is it just me or is the spigot website down

tranquil viper
quaint mantle
lilac pier
#

hey guys i don't find how to use CustomModelData for superiorskyblock2 i already try this

ornate patio
eternal night
#

Well that is too bad for them xD

tranquil viper
#

idk

quaint mantle
#

everything that ive tried to do with spigot has been helped with by the internet when ive found it difficult

digital lynx
#

Is spigotmc down?

quaint mantle
#

the core concpets always work

tender shard
sonic tiger
digital lynx
#

Mefci

#

Merci

#

Thank you

lilac pier
#

c'est tellement dur de dire comment je peux l'utiliser sérieusement

#

il se casse pas le cul ici

lilac pier
#

go ask on the plugin's discord 😉

ornate patio
#

how do I send a packet to a player

eternal night
#

gooooogleeee

ornate patio
#

rrrrrrr

#

okay yeah that was obvious lol

tender shard
ornate patio
#

im just slowly losing it

#

been trying to do this for 2 days

eternal night
#

like, I googled your "how to change player name over head" question for a single minute

#

and I already ran into the right solution

gaunt relic
#

!google

eternal night
#

mostly because it has been the same 4 packets to send

#

for like, the past 5, 6 years maybe

ornate patio
eternal night
#

indeed

ornate patio
#

because I have no idea how packets work

#

i dont know what this even means

crimson relic
#

so learn

eternal night
#

Then maybe learn about NMS and packets first

ornate patio
#

from where though

gaunt relic
eternal night
#

there are videos, written tutorials

#

wikis

tranquil viper
#

I've never used NMS in 4 years of Spigot dev, while I probably could have to save time it's not necessary for 99% of stuff imo

eternal night
#

Well for this it is rather required

tranquil viper
#

And NMS is fairly hard to learn

#

What is he doing

ornate patio
#

im trying to rename players

tranquil viper
#

Oh, yea you need NMS 😂

ornate patio
#

i've also done pathfinding with nms before which is also required

eternal night
#

or like, look for a library that does it for you

ornate patio
#

not sure why these arent part of the spigot api though

tranquil viper
eternal night
#

well, there is a server software out there that has all of that as API 😛

gaunt relic
eternal night
#

wiki.vg is not really a good place to start imo

eternal oxide
#

you don;t even need that

eternal night
#

it is the low level structure of packets

ornate patio
#

yeah i noticed

eternal oxide
#

you ran buildtools remapped, you have all the source

eternal night
#

^

tender shard
gaunt relic
#

the way i learn is just decompiling spigot and looking through Mojang code

eternal night
#

yes, that is basically how you do it

eternal oxide
#

literally open teh relevant class and see what it takes

ornate patio
#

hold on why do I have 1.18 and 1.19 lmfao

#

I don't have the string "1.19" in my pom.xml

tender shard
#

maybe just ?paste your complete pom

ornate patio
tranquil viper
#

How do I change "+1 Armor" to something like +3, or just outright copy the stats of a netherite helmet?

torn shuttle
#

I can feel myself balding over just calculating dps for minecraft items

tender shard
quaint mantle
#

anyone know what version it changed from being Bungeecord to bungeecord:main in the messaging channel

ornate patio
#

damn

#

I'm pretty sure it's lib's disguises

#

is there something I can do about it or no

tender shard
eternal night
#

you can exclude a dependency

eternal night
#

beyond that mvn dependency:tree

ornate patio
eternal night
#

please run the command i pointed out

eternal night
#

yes lib disguises indeed does something dumb

#

google how to exclude transitive dependencies in maven

tender shard
#

basically you need to add this to your libsdisguises dependency

      <exclusions>
        <exclusion>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot</artifactId>
        </exclusion>
ornate patio
#

oh okay

quaint mantle
#

Ive been trying for a few mins to fix my messaging channel , im using bungeecord and ive tried both bungeecord:main and Bungeecord channels, i have players connected to both servers im trying to use and they are connected via bungeecord. any idea whats going wrong?

#

i followed the spigot guide

tender shard
#

i wonder why libsdisguises isn't using remapped 🥲

sterile token
tender shard
#

btw I wonder how they even made spigot 1.19 show up for people who just use their API

sterile token
#

Ok lol

tender shard
#

my dependency tree for jefflib is huge, but when including that in another project it doesn't show ANY transitive dependencies (as it should be)

#

what does one have to do to "break it"?

sterile token
#

Oh gradle 🤢

ornate patio
#

what is a transitive dependency

tender shard
tranquil viper
#

also hey Alex!

tender shard
#

hi

sterile token
tranquil viper
#

Oh I mean other alex

#

But there are 2 here

#

XD

ornate patio
#

oh ok

sterile token
#

Hahaha hi Pray

tender shard
sterile token
#

They are a lot hahaha

eternal night
ornate patio
#

i find it dumb that it imports it into my own project too though

eternal night
#

it is the lazy mans approach

torn shuttle
#

I haven't checked yet but do bows use the generic attack speed attribute at all? Is that wired to be the drawing time or not at all?

ornate patio
#

does "PacketPlayOutPlayerInfo with action REMOVE_PLAYER" effectively mean

((CraftPlayer) player).getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER));
eternal night
#

that packet is missing something

#

but yea

torn shuttle
#

looks like bows don't use attack speed

#

nor damage

ornate patio
#

missing what

torn shuttle
#

hilarious

eternal night
#

well the player xD

#

that you want to remove

ornate patio
#

well

torn shuttle
#

guess damage makes sense anyway since arrow damage is a function of velocity

ornate patio
#

the guy didnt say what player to remove

#

uh

eternal night
#

the one you want to rename

ornate patio
#

I'm assuming

ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle();
serverPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, serverPlayer));

then

eternal night
#

well

#

not really

#

you have player A. The one you want to rename. And then you have every other player

#

the packet would take player A but would be sent to every other player

tender shard
ornate patio
#

havent done that yet

ornate patio
#

so I need to send the packet to everyone except the player being renamed?

tender shard
ornate patio
#

🤔

#

hold on i'll be back

shadow vine
#

I used set cancell to cancel a damage event but I want to show hit effect how do I do that

shadow vine
#

Which packet

tender shard
#
Player playerToChangeName = (Player) sender;
ServerPlayer nmsPlayerToRemove = ((CraftPlayer) playerToChangeName).getHandle();
GameProfile newGameProfile = new GameProfile(playerToChangeName.getUniqueId(), "NewName");
ServerPlayer nmsPlayerToAdd = new ServerPlayer(nmsPlayerToRemove.server, (ServerLevel) nmsPlayerToRemove.level, newGameProfile);
for(Player otherPlayer : Bukkit.getOnlinePlayers()) {
    ServerPlayer otherNMSPlayer = ((CraftPlayer) otherPlayer).getHandle();
    otherNMSPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, nmsPlayerToRemove));
    otherNMSPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, nmsPlayerToAdd));
}

This will basically tell all players "mfnalex has left", then tell them "NewName has joined"

#

might wanna adjust that a bit ofc. e.g. you don't need to send it to yourself, I guess

sterile token
sterile token
#

Because im thinking ways for tricking bungeecord

#

Oh ok

tender shard
#

it simply sends a packet to all online players

sterile token
#

I suppouse haha just but want to check it

#

I wont stop thinking ideas for tricking bungeecord PMC

#

It must should be a way for tricking it

fair acorn
#

how could i teleport a specific player to cords?

tender shard
tender shard
#

for example

myPlayer.teleport(someLocation);
fair acorn
tender shard
#

no. If you'd check the javadocs, you'd see that the teleport(...) method requires either a Location, or an entity as first parameter

#

or if you'd just use your IDE's auto completion

opal juniper
#

like Player#teleport(Location)

tender shard
#

every IDE shows you the proper method signatures

#

I think it's pretty self explanatory

sterile token
#

Agree with you mfalex

swift spear
#

How can i keep the content of a sign if i use player#openSign(sign)

tender shard
#

or do you want to prevent players from changing the opened sign?

swift spear
#
public static void openNewSign(Player player) {
        player.getWorld().getBlockAt(player.getLocation()).setType(Material.OAK_SIGN);
        Sign sign = (Sign) player.getWorld().getBlockAt(player.getLocation()).getState();
        sign.setLine(0, "Test1");
        sign.setLine(1, "Test2");
        sign.setLine(2, "Test3");
        sign.setLine(3, " ");
        sign.update();
        player.openSign(sign);
    }```
i got this but i want the text I put in the sign to be in the opened Sign,
idk how to explain
it just opens an empty sign
arctic moth
ornate patio
#

is that basically this approach?

arctic moth
#

faq

#

whatever

#

ran clean package, didnt work

#

says the poms are missing, anyone know a way to make it work?

old geyser
#

How can I make players not release specific enchanted items when they die

arctic moth
arctic moth
old geyser
#

the pl is 1.19

somber sequoia
#

Hey, I need to stop a crafting if there is a certain item in it how would I do that?

somber sequoia
arctic moth
old geyser
#

mh

arctic moth
somber sequoia
#

yeah it probably should but it says that those 2 are missing

#

idk i never used EssentialsXDiscord

arctic moth
#

ig i can try adding them directly and seeing what happens

somber sequoia
#

try adding their repo

#

and i think that might work

arctic moth
#

uhh what are the repos

somber sequoia
#

i have no idea

#

try googling

arctic moth
#

weird, only see dependency imports on google but not repo

#

downloads anyways lol

#

ig it doesnt need repo

#

just dependency

#

worked

#

i have no idea why i just needed dependency

#

maybe its part of spigot-repo or smth

arctic moth
#

idk where jda came from

somber sequoia
regal anchor
#

hey guys I just saw someone writing if (sender instanceof Player player) and then use player is it something a Java version greater than 8 is allowing ?

full forge
#

Yes that's legal code

regal anchor
#

what's the Java version ?

#

doesn't work with java 8

full forge
#

17 I'm guessing

#

Why are you doing stuff in 8 lmao

regal anchor
#

always used Java 8

full forge
#

Updating to the newest version is nice, lots of useful features like the instanceof one

onyx fjord
regal anchor
#

My server is 1.12

onyx fjord
#

I think limit for you would be like 11

#

Idk

regal anchor
#

So I can't use java 17 and spigot 1.12 together ?

lament moon
#

Hi! How can I code potion stacker command?

tender shard
somber sequoia
#

i was running a 1.8 server with java 17

tender shard
#

but probably not

somber sequoia
#

i mean

#

why would it not run with a higher version

lament moon
tender shard
tender shard
# lament moon I thought that with command example /stackpotions

well simply collect all potions from the inventory, add them one by one to a temp inventory. loop over the potions in the temp inventory, and if any of those "isSimilar", then +1 the stacksize. if not, use a new slot. then add those items back to the original inv

somber sequoia
tender shard
#

hm then it only requires these specific versions for compiling

#

yeah then you can of course also compile your plugin for 1.17

#

I thought that if buildtools requires java 8 - java 10, then the actual spigot.jar would require one of those versions too

#

weird

somber sequoia
#

doesnt look like it

tender shard
somber sequoia
#

unless im using some weird version

tender shard
#

1.16.5 does NOT run on java >16

#

so yeah it's weird lmao

eternal oxide
#

?paste

undone axleBOT
regal anchor
#

for now eclipse doesn't allow me to write that recent java stuff and I don't think that's related to spigot yet

#

I changed the JRE home to /usr/lib/jvm/java-18-jdk

#

previously it was /usr/lib/jvm/java-8-openjdk

#

eclipse just says "delete token player" in if (sender instanceof Player player)

tender shard
#

you also need to change the language level in the project settings

#

right click project in package explorer -> properties -> java compiler -> set it to 17

#

set this to 17

#

if you're using maven, you probably also wanna change your pom.xml, or build.gradle if using gradle

regal anchor
#

the maximum is 13 with my "Compiler compliance level"

#

and also in my Execution Environments the maximum is JavaSE-13

tender shard
#

what does Help -> About Eclipse say?

sterile token
#

Also did you install jdk 18 right?

tender shard
#

as version

sterile token
#

Oh eclipse 🤢

#

Not bullying you

#

I just remember how much work i used to have using that shity IDE

tender shard
#

yes eclipse takes so much effort to just use it

regal anchor
#

then makepkg

sterile token
#

U are on linux i suppouse

#

If you run: java -v

#

Does tell you running jdk-18?

#

or java -version

tender shard
#

with this version, it supports up to java 15

#

so I guess yours is even older?

sterile token
regal anchor
sterile token
tender shard
sterile token
#

Also how you mate? I forget to ask you!

regal anchor
#

2019

sterile token
tender shard
regal anchor
#

but intellij isn't free

tender shard
#

it is

#

the community edition

sterile token
#

You have a community version

#

Which is free

ornate patio
tender shard
regal anchor
#

okay I'll try intellij thanks

ornate patio
sterile token
tender shard
#

being a student gives you the ultimate version

sterile token
#

Ahh that was

#

I forget haha

ornate patio
#

ty

sterile token
#

mfalex do u still selling your studen emails?

#

I think someone from this server offered me students email to get intellij ultimate

ornate patio
#

then why is this guy saying the last two steps

eternal night
#

isn't there an EDU eddition or smth

sterile token
ornate patio
#

they dont look necessary

eternal night
#

yea iirc there is a custom build for jetbrains academy

sterile token
#

Here only development questions

velvet oxide
ornate patio
#

player.getName() will still return the player username?

tender shard
sterile token
sterile token
#

There was another alex

tender shard
#

i can create unlimited @wwu.de and @still fulcrum-muenster.de email addresses, but I never said that I sell them haha

#

i dont think that would be legal 😄

sterile token
#

I know idk

#

But you know that "Whoever is afraid to die should not be born"

#

Not asking you for one, just mention it

ornate patio
sterile token
#

YOu are not PaYiNg hIm

ornate patio
#

okAy

eternal oxide
#

You could easily test it

tender shard
shut field
#

I have a map with a list in the config but it is returning null?

#

It looks like it is saving to the config properly

sterile token
#

Use this url for sending the code and yaml

shut field
#

My dad just stole the computer right when I was about to send it

sterile token
#

Allright dont worry

#

Just send it when you are done

shut field
#

It’ll only be like 2 min

sterile token
#

Allr have a good night

ornate patio
shut field
#

the stuff being put() and get() are lists

sterile token
#

1 sec

shut field
#

and the map is a map of the class so it is being saved to the config

sterile token
#

I mean you are using the map for serialization

sterile token
#

Allright can you send the full class?

shut field
sterile token
#

I think its easy to help

sterile token
#

What is the isue you are getting?

#

Any exception

shut field
#

so I use a function from the ItemClass on it and it gives nullpointerexception

#

"Cannot invoke <random function from the class> because the return value of "java.util.List.get(int)" is null"

sterile token
#

Okay its weird how you code

#

You put all in one line

ornate patio
#

accounts just get randomly kicked when other ones join

shut field
shut field
stiff dock
#

I'm currently running bungeecord on my network with luckperms bungee on my proxy and luckperms on my spigot/paper servers however the bungee commands for neither the default group or admin group are displaying that they don't have permission to execute. The permissions are set to the default group with the correct server permissions, so I'm really baffled as to what is preventing them from working. Any help would be appreciated.

sterile token
#

Please use #help-server for server or plugins questions non related to programming

stiff dock
#

development of server?

vocal cloud
#

Development of plugins

sterile token
stiff dock
#

ah this is java and c++ use

sterile token
#

Yes mostly programming

stiff dock
#

👍

sterile token
#

No problems mate have a good day

#

@stiff dock Just copy-paste the issue there and i try to help

#

What its better for registering a class and for calling some methods?

torn shuttle
#

I know this is a hard to answer question but does anyone have any idea of how item plugins usually mess with damage reduction derived from protection in terms of customizing it? The math behind damage reduction is so insane I have a hard time believing there's plugins out there seriously messing with the toughness and protection attributes

ornate patio
#

anyone have any idea what the constructor argument for ClientboundRemoveEntitiesPacket is?

ornate patio
#

nvm it turns out i dont even need to pass in a param

sterile token
#

Because that why they are for sorry if sound rude

ornate patio
#

javadocs?

sterile token
#

Yeah

ornate patio
#

it's an NMS class

sterile token
#

Oh NMs doesnt have javadocs right?

ornate patio
#

yeah

sterile token
#

As far as i know NMS is from minecraft and is obfuscated not from spigot right?

ornate patio
#

spigot is built on nms

#

and nms is a completely mess, you mainly have to reverse engineer everything

sterile token
ornate patio
#

yes

sterile token
#

I never touched NMS

#

That why sorry for ignorance

ornate patio
#

its fine

sterile token
#

Also i think i know you from somewhere else

ornate patio
#

hm?

#

where

#

anyways

#
// player is the joining player
// name is the name i want to rename the player to

ServerPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
ServerPlayer newNmsPlayer = new ServerPlayer(nmsPlayer.server, (ServerLevel) nmsPlayer.level, new GameProfile(player.getUniqueId(), name));
nmsPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, nmsPlayer));
nmsPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, newNmsPlayer));

// the code below doesn't even run yet because a single user gets kicked immediately from the lines above
for (Player otherPlayer : Bukkit.getOnlinePlayers()) {
    if (otherPlayer.getUniqueId().equals(player.getUniqueId())) {
        continue;
    }
    ServerPlayer otherNMSPlayer = ((CraftPlayer) otherPlayer).getHandle();
    otherNMSPlayer.connection.send(new ClientboundRemoveEntitiesPacket());
    otherNMSPlayer.connection.send(new ClientboundAddPlayerPacket(newNmsPlayer));
}
#

Does my code not reflect what this guy said to do?

#

The function is called when a player joins, but I get immediately disconnected:

ornate patio
#

(ping me if respond ty)

lethal coral
#

So let's say I'm making a plugin that uses mojang mappings... Am I allowed to put the source of that plugin on github?

eternal oxide
#

but yoru client will be kicked if you attempt to chat with the wrong profile

#

"Chat message validation failure"

#

Well it does work once portaled away and back

wide oracle
#

how do i get all entities in a specified radius of another entity

kind hatch
wide oracle
#

did not know that existed

ornate patio
sterile token
#

You can also search on google that what you mention

eternal oxide
#

You can;t send it in the login event as you are not fully logged in yet. The client is not ready to accept those packets at that stage

sterile token
#

I think

#

@ornate patio try sending the packet on PlayerJoinEvent but with a delay of 30 seconds

#

Or something like that

ornate patio
eternal oxide
#

more than 1 tick

#

Client has to finish joining and notify the server it has

#

I've got it all working, including chatting, except for it updatign without having to portal away and back

sterile token
#

You can change the skin using the GameProfile object if im not wrong

eternal oxide
#

Yeah, I've got skin changing a while back

sterile token
#

Wait how does player skin works?

#

Now i want to read how they works

#

In they way of rendering because i know that they have to be signed or something like that+

#

I have find that

#

OH ok

#

I have read and skin must be signed by mojang

#

In other words a user must have to upload it

#

And they yes you can get the signature and set it to players

#

yes i just realized

#

Okay try it

#

I never used it

#

I think it should works

granite burrow
#

Is there a way that I can detect if a player is being rode

granite burrow
#

like if someone is sitting on their head

sterile token
kind hatch
eternal oxide
#

This is not so easy as sending a respawn packet to the client with a replaced GameProfile causes it to goto the world spawn as if it was killed.

eternal oxide
#

Sorry still talking about changing player name

sterile token
eternal oxide
#

Thinking out loud

sterile token
#

Maybe tell him to open a thread

granite burrow
sterile token
main dew
#
World#notifyAndUpdatePhysics``` anyone know how work flag in this method? 😅
sterile token
#

Have you read the javadocs?

sterile token
sterile token
#

Is it possible?

main dew
sterile token
lethal coral
sterile token
# main dew NMS method 😅

I wont never mix with NMS because if that type of things are not consider by the api its becaue they are dangerous or can cause other issues

ornate patio
eternal oxide
#

no

ornate patio
#

but what if some computers are slower than others than

eternal oxide
#

You can;t do it at login/join

kind hatch
#

Isn't that the whole point of the PlayerJoinEvent? Is that it fires after they are done logging in?

eternal oxide
#

Kinda, but teh client is not out of the login protocol phase yet

echo basalt
#

it fires before the client loads their world which is kinda meh

#

I'd rather wait for the first PlayerMoveEvent they fire

ornate patio
echo basalt
#

check yaw

#

or inc packets

ornate patio
#

huh

ornate patio
echo basalt
#

ye

ornate patio
#

okay

subtle folio
#

Is it possible to fully modify the tablist like MCC?

buoyant viper
#

well if mcc did it

dusk flicker
#

that isnt the scoreboard

#

thats the tab list

subtle folio
#

thats what i meant

dusk flicker
#

ah

subtle folio
dusk flicker
#

Well yes, you would require a resource pack for it to look that good without lines and such

subtle folio
#

of the server jar

dusk flicker
#

You shouldent have to modify the jar at all

subtle folio
#

oh really?

dusk flicker
#

Should just be creating fake player objects that register in the tab list

subtle folio
#

But how would I make the players inline?

#

and have headers over them?

dusk flicker
#

basically everything is a fake player on that, so its just applying headers & footers to set the size of it, and just adding fake accounts *or similar to it, with custom names, some being blank resulting in that

#

Personally I know just a bit of the backend, but not enough to fully make it

#

I would recommend finding some plugins that do it, and looking at their source

quaint mantle
#

is this done correctly?

#

or by a bad way

dusk flicker
#

you're nesting some if statements which could be removed

eternal oxide
#

yay got name changing workign

hidden kestrel
#

Am I doing anything wrong or is my server too small? I have a smaller which 3 gb of ram.

It's using a custom plugin, in which it creates 6 worlds in onEnable.

        new WorldCreator("community").createWorld();
        new WorldCreator("community_nether").environment(Environment.NETHER).createWorld();
        new WorldCreator("community_end").environment(Environment.THE_END).createWorld();
        new WorldCreator("immersive").createWorld();
        new WorldCreator("immersive_nether").environment(Environment.NETHER).createWorld();
        new WorldCreator("immersive_end").environment(Environment.THE_END).createWorld();

The server's tps immediately tanks after start up, before anyone has even joined. The 'immersive' worlds are very small worlds. What am I doing wrong?

dusk flicker
#

what version

kind hatch
#

You could try changing your plugin's yml startup flag to run ON_LOAD instead of STARTUP.

dusk flicker
#

also, run a timings report and send it

hidden kestrel
hidden kestrel
dusk flicker
#

then add more memory

hidden kestrel
#

But I don't see why I'd have to when it runs out before anyone is even on the server??

#

If the issue persists I could keep shovelling money into more memory but that doesn't fix my issue

kind hatch
# hidden kestrel What's that do??

Sorry, I was using the wrong variables. What you would want is the load variable and the variable to be STARTUP. It basically makes your plugin execute it's onEnable method before the worlds load.

drowsy helm
hidden kestrel
#

That's what I mean

#

and that's why I'm asking here

drowsy helm
#

wait are you creating a brand new world on start up?

#

6 brand new worlds*

hidden kestrel
#

Do I not do that in order to load them in ??

#

That's what I was told

quaint mantle
drowsy helm
#

nah it is

hidden kestrel
# kind hatch Sorry, I was using the wrong variables. What you would want is the `load` variab...

Does that make a difference if I have

        new WorldCreator("community").createWorld();
        new WorldCreator("community_nether").environment(Environment.NETHER).createWorld();
        new WorldCreator("community_end").environment(Environment.THE_END).createWorld();
        new WorldCreator("immersive").createWorld();
        new WorldCreator("immersive_nether").environment(Environment.NETHER).createWorld();
        new WorldCreator("immersive_end").environment(Environment.THE_END).createWorld();
``` in my `onEnable`?
hidden kestrel
#

Though the worlds have obvs already been generated

drowsy helm
#

spigot or paper?

hidden kestrel
#

Paper

#

asking here because the code is spigot 🥴

dusk flicker
#

?whereami

dusk flicker
#

code might be spigot but its having an error on a paper server

#

ask them

drowsy helm
#

allegedly they load async so i dont know why it would tank so much

hidden kestrel
#

oke

#

I have no clue either, especially because I have another server with the exact same plan

#

with more worlds

placid fog
#

i want to tilt a 3x3 area with a hoe what is the best way to select the location of the 3x3 area?

hidden kestrel
#

and that rocks a steady 20 tps

#

as soon I as I comment out the world load on this one though, tps goes back to 20 so it must be that part

#

Anyway, I'll hop on over to the paper folks and ask those guys

subtle folio
#

DOUBLE B

eternal oxide
#

@ornate patio Was it you trying to do an animated skin the other day?

#

I remember workign with someone

ornate patio
#

i'm just trying to rename players

eternal oxide
#

ok

#

I have renaming working if you want it.

#

However I don;t have renaming and changing skins working at teh same time yet

#

either/or

placid fog
drowsy helm
#

yeah

#

im assuming you mean till not tilt right?

placid fog
#

oh yeah mb

ornate patio
eternal oxide
#

I'm just seeing if I can get it to preserve the skin changes with the name

ornate patio
#

okay

#

I don't really need skin changing though

eternal oxide
#

yep, its just for completeness

#

I don;t like it losing teh skin when I change name

ornate patio
#

yeah i understand

eternal oxide
#

Almost there. It is keeping the skin now, just losing the second layer

placid fog
eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

it changes the name above their head and in tab

ornate patio
#

tysm 🙏

eternal oxide
#

it does not change their name in chat

ornate patio
#

I'll let you know if I get it working

#

@eternal oxide wait what is NMSUtils

eternal oxide
#

ah my helper class... sec

#

its just so I don;t need CB imports

ornate patio
#

alright

#

@eternal oxide ran into an error

#

the method is called on move not player join

#

I'm on 1.18.2 btw if that makes any difference

eternal oxide
#

very probably

#

that code is for 1.19.1

ornate patio
#

well

eternal oxide
#

stick it in a command

ornate patio
#

the change i made is this

eternal oxide
#

to test

ornate patio
#

ServerPlayer nmsPlayerToAdd = new ServerPlayer(nmsPlayerToRemove.server, nmsLevel, newGameProfile);

eternal oxide
#

just to be certain you are eliminating all possible causes

ornate patio
#

okay

ornate patio
#
[18:11:48] [Server thread/INFO]: no_hom0 issued server command: /test
[18:11:48] [Netty Server IO #1/ERROR]: Error receiving packet 54
java.lang.NullPointerException: null
[18:11:48] [Server thread/INFO]: no_hom0 lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException
[18:11:48] [Server thread/INFO]: no_hom0 left the game
eternal oxide
#

no clue, you'll have to check each of the packets to see which is causing it

ornate patio
#

alright

eternal oxide
#

theres only 5 in total

#

just comment them out one by one to see

#

in the for loop

ornate patio
#

doing that

#

oh my god wait

#

i think i figured it out

#

I was using Player#setPlayerListName right after

#

i guess that screws it up

#

although i would like to have a seperate player list name though

#

is that possible or no?

eternal oxide
#

player list? you mean tab?

ornate patio
#

yeah

eternal oxide
#

the connection.send(playerInfoAdd); sets both the name above their head and the name in tab

ornate patio
#

yeah but using Player#setPlayerListName after that causes a kick

#

is it possible to seperate the name above head and the name in tab?

eternal oxide
#

um, you can remove them from Tab, not sure you can have both different without handling all teh tab list

ornate patio
#

well I mean spigot has a built in api method to do that

eternal oxide
#

was that error in the server console or teh client?

#

You could try getting a fresh Player instance before setting the tab

ornate patio
eternal oxide
#

Well good luck. I've got to turn in for the night.

ornate patio
#

thats fine

#

thanks so much, wouldn't have been able to do this without you 🙂

fierce dock
#

Is there an event that allows me to see if a player starts to mine a block, or do I have to work with packets.