#help-development

1 messages Β· Page 1060 of 1

blazing ocean
#

wtf

kindred sentinel
#

yes it does

#

and f3+b

#

removes

pseudo hazel
#

well yeah

#

but thats client sided

blazing ocean
#

there is no fucking way that that isn't handled client side

pseudo hazel
#

but ganerule is server side

kindred sentinel
#

but for some reason

#

this command can handle

#

this

lilac dagger
#

a mod can overcome this tho

#

the client has to know the cords

kindred sentinel
lilac dagger
#

otherwise it doesn't know where to put the chunks

kindred sentinel
#

lol

lilac dagger
#

then if there's a gamerule use it

kindred sentinel
#

mhm

sterile flicker
#

something like this? ```kotlin
class Husk(world: World) : EntityZombieHusk(EntityTypes.HUSK, (world as CraftWorld).handle) {
fun spawn(loc: Location) {
this.setPositionRotation(loc.x, loc.y, loc.z, loc.yaw, loc.pitch)
this.bukkitEntity.persistentDataContainer.set(NamespacedKey(MobWars.instance, "custom"), PersistentDataType.BYTE, 1.toByte())
world.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM)
}

pseudo hazel
#

or its probably just all relative

sterile flicker
#

is it possible to store Player objects in mutablelist?

ivory sleet
#

yes

eternal oxide
#

Don;t store Player objects unless you have no other way to do it.

lilac dagger
#

i have some classes that use player as field but the underlying structure is held in a map via uuid that are then cleaned on quit / leave

echo basalt
#

my boy using kotlin πŸ™

blazing ocean
#

!

echo basalt
#

If you do have a leak the scope gets minimized

blazing ocean
#

custom player objects πŸ™

blazing ocean
#

(i store way too much shit in there)

echo basalt
#

class MyPlayer(player: Player) : Player by player

shadow night
#

This reminds me of when I did not clean up my buttons in my mod after removing some objects that were inside of those buttons causing mc to go crazy lmao

#

Idk why I forcefully removed objects tho, some dumbass shit

blazing ocean
echo basalt
#

p much yeah

shadow night
echo basalt
#

fun Player.sendPacket(packet: BedrockPacket) my beloved

pseudo hazel
#

oh finally a packet to give a player some bedrock

blazing ocean
#

!

echo basalt
#

new job put me doing 2 very different things at once:

  • Java -> kotlin
  • Java Edition? Nah we doing bedrock boy
blazing ocean
#

hehe

shadow night
#

Yeah kotlin extension functions or whatever they called are handy as fuck

blazing ocean
#

fr tho

echo basalt
#

inline fun <reified T> is also goofy

#

no more random Class<T> params

blazing ocean
#

reified my beloved ❀️

shadow night
#

tf is reified

echo basalt
#

basically every call to the method results in the method being copied to the caller class

#

Meaning you can do shit like

sterile flicker
echo basalt
#

val components = entity.getComponentsOfType<MyComponent>()

blazing ocean
#

those are not a thing in vanilla πŸ€”

shadow night
#

I think they mean usernames

echo basalt
#

Any reason for living in fear of Player UUID's

blazing ocean
#

yea uuids >>>

echo basalt
#

brb making a pizza before my dough turns sour

shadow night
#

I remember I once wrote a plugin for a friend and it had some websocket stuff, for auths and sessions I used UUIDs kek

shadow night
blazing ocean
#

i thought he was portuguese

echo basalt
#

I am portuguese but have some italian influence in my life

shadow night
#

understandable

echo basalt
#

I was given an italy gold chain when I was like 1 years old that I still wear to this day

shadow night
#

wow

echo basalt
#

and I have the stereotypical italian godfather in the mafia

#

or something

shadow night
#

wtf

sleek estuary
#

why this happens?

tardy delta
#

cuz you initialize it again somehwer else?

umbral ridge
#

Store players in barrels if your basement is full

sleek estuary
#

i forget final

#

thx

echo basalt
shadow night
#

Lmao

#

Brother that's wild

torn shuttle
echo basalt
#

Yes

torn shuttle
#

I knew it

#

the greasemaster is in the pizza business

#

also explains why you dodge taxes

echo basalt
#

Just took one out of the oven right now

torn shuttle
#

put pineapple on it and become a target for your own family

grim hound
#

does anyone here know a bit of blender?

torn shuttle
#

a bit

shadow night
#

I indeed do know a bit, a bit about how to fuck up stuff

grim hound
#

aight then

#

I want to do this basically

#

roughening up

shadow night
#

Looks like a sphere to me

torn shuttle
#

decimate

grim hound
#

I want to get the rougher one to the right

torn shuttle
#

imagine giving the answer but people don't know enough blender to know that it is the answer

#

use a modifier to decimate it

torn shuttle
#

there's a bunch of different methods for it

grim hound
#

so uh

alpine urchin
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!

sterile flicker
# lilac dagger yeah
class Husk(
    world: World, val plr: Player,
) : EntityZombieHusk(EntityTypes.HUSK, (world as CraftWorld).handle) {
    fun spawn(loc: Location) {
        this.setPositionRotation(loc.x, loc.y, loc.z, loc.yaw, loc.pitch)
        this.goalTarget = (plr as CraftPlayer).handle
        this.bukkitEntity.persistentDataContainer.set(NamespacedKey(MobWars.instance, "custom"), PersistentDataType.BYTE, 1.toByte())
        world.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM)
    }

    public override fun initPathfinder() {
         goalSelector.a(0, DefaultPathfinderGoal(this, 1.0, plr.location.distance(bukkitEntity.location).toFloat()))
    }
}                           val husk = Husk((map as CraftWorld).handle, p)
                            husk.spawn(positions.blueMobSpawn)
````still won't spawn)
sterile flicker
shadow night
obtuse hedge
#

ew

#

kotlin

#

i hope it rots rotlin

sterile flicker
#

Why do you hate kotlin?

blazing ocean
#

i think people would appreciate that when you're using kotlin, people wouldn't start talking shit about it instead of just helping

sterile flicker
shadow night
#

Pretty sure that isn't the api, but rather nms

sterile flicker
hard socket
#

I sat a password and everything broke

#

using XAMPP

blazing ocean
#

phpmyadmin
xampp
mysql
bro is using the 2005 stack

pseudo hazel
#

I mean mysql isnt too bad right?

hard socket
#

if so whats the 2024 stack?

pseudo hazel
#

I think there are like a billion

split tinsel
#

!nms

#

?nms

ocean hollow
#

who can help me to write an algorithm to check whether it is possible to add items to the inventory in the range of slots 28-34? the list of items has different amounts, so you need to check it with getMaxStackSize().

hard socket
pseudo hazel
#

idk im not a stack person

shadow night
pseudo hazel
#

you should be asking rad since he seems to know more about this stuff

#

my maxStackSize is 1

pseudo hazel
#

try root password, maybe the permissions arent set up correctly or smth

blazing ocean
#

what

hard socket
#

whats a better stack to use

blazing ocean
#

really depends on what you're making

hard socket
#

I just need a sql database

pseudo hazel
#

then why do you have php

blazing ocean
#

i mean you are free to use mysql and that stack, i just pointed out that that stack is pretty old

hard socket
pseudo hazel
#

hmm

#

well anyways im pretty sure its a pure sql issue

hard socket
pseudo hazel
#

regarding the password you set up

hard socket
#

but its broken

rare ridge
#

how can I speed up the process of drinking the potion?

#

are there any ideas?

split tinsel
#

How do I fix

Source option 5 is no longer supported. Use 8 or later.

Language level is invalid or missing in pom.xml. Current project JDK is null.
potent atlas
#

am I allowed to post my question again if it's been like 12 hours?

eternal oxide
#

lol yes

potent atlas
#

ok sweet

pseudo hazel
#

yeah you;re good, most people repost after 2 mins xD

potent atlas
#

I'm working on a plugin that has particle wings. I'm trying to keep the rotation relevant to the player's -body- not the head. I've tried some math and vectors and rotations, I even tried packets. the body rotation is not handled by the server. The idea is to start rotating the wings when the body begins to rotate which it does after the head rotates a certain amount. I've been trying the math to figure out that angle. I tried with movement listener, packets, vectors, and math but I can't quite get it

eternal oxide
#

The players body facing (yaw) is on teh Player.getLocation().

potent atlas
#

yaw refers to the direction a player is looking in

eternal oxide
#

head is getEyeLocation()

#

body has a yaw too

potent atlas
#

you cannot get the body's yaw though location

eternal oxide
#

yes you can

potent atlas
#

ugh, please go check your facts

eternal oxide
#

ok you do you and don;t listen

potent atlas
#

are you kidding me right now?

#

look, let me explain

#

the body and head have their own rotation, right?

eternal oxide
#

Yaw of head and Yaw of Body are two different Locations and yaw

potent atlas
#

yep

#

I am trying to get body, but it's client sided

eternal oxide
#

no its not

#

the Player#getLocation() has a yaw, which is the facing of teh BODY

potent atlas
#

we're wasting so much time arguing

eternal oxide
#

Player#getEyeLocation() has a yaw which is of the HEAD

potent atlas
#

and player.getLocation also has yaw of the head

eternal oxide
#

no

potent atlas
#

dude

#

yesss

eternal oxide
#

dude

#

no

eternal night
potent atlas
#

can anyone help me with this guy?

#

pleeease

#

you're going to get us both muted

wet breach
eternal night
#

I mean, elgar sadly is not correct

eternal oxide
#

oh wow

#

I'm not?

wet breach
#

here is some things you should note of who you been conversing with. ElgarL has helped maintain or worked on towny, and is the author/maintainer of Group manager and some other plugins

eternal night
#

you are not

#

setEyeLocation just copies location and adds the eye height

eternal oxide
#

well thats new to me.

wet breach
#

but, that said lynx is correct here before I could say anything XD

eternal night
#

at least we all learned things today omegaroll

pure iris
#

is there a way to disable the anti cheat for paper?

eternal oxide
#

Then I apologize. I was absolutely certain body kept its own Yaw

slender elbow
#

πŸ˜”

potent atlas
#

honestly, I am so disappointed in all this

sterile flicker
lilac dagger
eternal oxide
#

In which case, what you want is impossible as it's client side

lilac dagger
wet breach
eternal oxide
#

they could, If they use mods

#

it sounds like its just client extrapolation, like walking

wet breach
#

however, the body rotation though I don't think is shown to other players

#

I think that is just a view only you can see

lilac dagger
blazing ocean
blazing ocean
#

this is the third time i've used this today

sterile flicker
blazing ocean
#

wth is going on

eternal oxide
#

?stash

undone axleBOT
eternal oxide
#

for me

lime wave
#

how could I set e.g. a player with nick "Test" a value 3 on the dummy scoreboard called IDs?

pure iris
eternal night
#

let me quickly grab my paper salesman outfit

warm mica
pure iris
warm mica
#

Only anti spam and anti flight that is a vanilla thing

pure iris
#

i tryied making a string duper in my server and it didnt work

#

;c

potent atlas
#

that's good

sterile flicker
eternal night
lilac dagger
#

yeah

#

that's not an issue

warm mica
lilac dagger
#

in previous versions you had to register your custom class before adding entities

eternal night
#

and enough paper selling

wet breach
lilac dagger
#

if the server has body yaw then you should be able to get it via nms as well

eternal night
#

Yea you can

sterile flicker
wet breach
eternal oxide
#

So its just an API issue? Probably be breaking to fix it

potent atlas
#

I tried messing with nms but I'm still a beginner with that

eternal night
#

Well, you can't just update the yaw on the locations no

#

which is why paper has it as its own method

#

which is kinda ugly

wet breach
eternal night
#

but yea, would break too much otherwise

echo basalt
#

weren't eyeLocation and location using different yaws or am I tripping?

eternal night
#

uh

#

lets find out if that ever was the case

eternal oxide
sterile flicker
lilac dagger
#

I dunno, the code looks okay to me

wet breach
wet breach
#

oh wrong person

#

my bad >>

lilac dagger
#

Try spawing a non modified nms husk @sterile flicker

eternal night
#

mandela effect I guess

sterile flicker
lilac dagger
#

As in a husk from nms without you extending it

wet breach
lilac dagger
#

I think addfresh is md mapping

echo basalt
#

nope

lilac dagger
#

He has addentity spawn reason

potent atlas
#

I had one more idea for the body yaw. It updates and aligns when the player punches. Is it possible to send that packet without the player actually moving or hurting something?

sterile flicker
lilac dagger
echo basalt
#

yikes 1.16.5

lilac dagger
#

If you don't send it to the player in question is fine

sterile flicker
echo basalt
#

Have you tried calling spawn manually outside of initPathfinder?

#

It could be that it gets called when you add it to the world

lilac dagger
#

It's not in init path

#

I was confused too

echo basalt
#

difficulty peaceful?

lilac dagger
#

For a second, then i saw there is the spawn method above

echo basalt
#

Yeah but it can be that initPathfinder only gets called when you call addEntity on the world

#

And addEntity only gets called when you spawn

#

which gets called on initPathfinder

#

which means it never gets called

low marlin
#

I need help with pathfinding, I want to have a wither skeleton mob where there will be 4 skeletons following him and whenever they see a player they all start attacking him
I tried

this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[] {magmaMinions.class, magmaCaptain.class})).setAlertOthers(new Class[0]));
        this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Chicken.class, true));
        
        this.goalSelector.addGoal(3, new FollowMobGoal(this, 1, 3f, 10f));

But they just follow the leader until the leader dies and then they attack me

echo basalt
#

You might want a custom goal

low marlin
#

how do I make a custom goal

echo basalt
#

extend the goal class and do stuff

#

Either that or use the same goal selector for everything

low marlin
#

okie

#

I'll try that

#

ty

lime wave
#

how could I set e.g. a player with nick "Test" a value 3 on the dummy scoreboard called IDs?

lime wave
echo basalt
#

?jd

undone axleBOT
gilded granite
#

How do I automaticaly export the jar to my server plugins's folder?

worthy yarrow
#

Change the ouput path

gilded granite
#

yes but how

hard socket
#

Go to maven tab then package then edit configuration

worthy yarrow
#

Project structure should have the option

gilded granite
#

no I dont find it

worthy yarrow
hard socket
#

Well thats for artifact

#

Not maven compilrr

worthy yarrow
#

I thought he meant project specific, but yes go to your maven options if you want every other project to also follow that path by default

hard socket
#

Yeah

gilded granite
#

how do I set the output in the pom.xml

worthy yarrow
#

I'm not sure if you can?

gilded granite
#

yes I've done it long time ago

slender elbow
#

Alex has a guide for that

worthy yarrow
#

Idk I don't see any information (at least in my pom) that relates to compiler pathing

slender elbow
#

I don't remember the command

worthy yarrow
#

So you might have to add your own stuffs I dont actually know, emily if you can grab that guide...

#

you'd be the best

hazy parrot
#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

gilded granite
#

thx

lilac dagger
#

or look into sym link

#

you can basically link the jar location onto your server and act as if it exists in 2 places

hard socket
#

You can just modify it in the maven settings

#

I think its better than adding it to each project

worthy yarrow
#

^ this is the best option considering you might not want to add this configuration to every single pom for every single project

worthy yarrow
#

No reason to manually add a compiler path to your project if it's only every supposed to compile to one place

#

Just define that in the proj structure or like we've said maven settings

wet breach
alpine urchin
lilac dagger
#

i think it worked well for me

alpine urchin
#

yup

#

and since i have multiple server versions, many folders, i symlink packetevents

#

and it works perfectly on all of them

#

reloads work well

wet breach
alpine urchin
#

there’s two options in the synlink thing

#

one is file path

#

and one is something else

#

but ik what i do works

gilded granite
#

what is this error ? Caused by: java.lang.UnsupportedOperationException: Not supported yet.

alpine urchin
#

any more context?

wet breach
#

there is two types of symlinking. Hard linking and soft linking

lilac dagger
#

i haven't tested but the link is basically a shortcut only more real to apps

gilded granite
#

Im making an anvil GUI

alpine urchin
#

ok

alpine urchin
worthy yarrow
wet breach
#

hard linking, is where what happens to the file from the other directory it is linked, applies to the original file

lilac dagger
#

as long as i don't delete the file the link is there even if i delete the og and recreate it

wet breach
#

soft linking is where it won't alter the original file

gilded granite
wet breach
#

however for either, if the original file is altered the linking is removed and needs to be re-applied

alpine urchin
#

it works

#

for me

#

it doesn’t need to be reapplied

#

i’ve done it for a year probably

#

and still do

gilded granite
#

public void openAnvil(Player player) {
Inventory anvil = Bukkit.createInventory(player, InventoryType.ANVIL);
player.openInventory(anvil);
}
}

#

why is This not working

#

like it opens the gui but I can rename items etc

worthy yarrow
#

As far as I can tell you never populate this inventory with any items

#

Oh it's an anvil

#

What exactly is not working?

gilded granite
#

I cant rename items apply enchanting books etc

#

I can only put item in the anvil but the reset themselves automaticaly

worthy yarrow
#

Do you get any errors in console when putting items in / trying to rename or enchant or wtv

gilded granite
#

oh I know

#

when I open the gui its only says Repairing but with the normal one it says Repair & Name

worthy yarrow
#

That sounds quite odd

gilded granite
#

how do I make it Repair & Name?

sterile flicker
#
class Husk(world: WorldServer?, private val plr: Player) : EntityZombieHusk(EntityTypes.HUSK, world) {
    fun spawn(loc: Location) {
        this.setPositionRotation(loc.x, loc.y, loc.z, loc.yaw, loc.pitch)
        this.goalTarget = (plr as CraftPlayer).handle
        bukkitEntity.persistentDataContainer.set<Byte, Byte>(
            NamespacedKey(MobWars.instance, "custom"),
            PersistentDataType.BYTE,
            1.toByte()
        )
        (world as WorldServer).addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM)
    }

    override fun initPathfinder() {
        goalSelector.a(
            0, DefaultPathfinderGoal(
                this, 1.0, plr.location.distance(
                    bukkitEntity.location
                ).toFloat()
            )
        )
    }
}val husk = Husk((map as CraftWorld).handle, p)
                                husk.spawn(positions.blueMobSpawn)``` Cannot invoke "org.bukkit.entity.Player.getLocation()" because "this.plr" is null
[22:23:00 WARN]: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getLocation()" because "this.plr" is null
[22:23:00 WARN]:        at com.sumeru.mobwars.entities.Husk.initPathfinder(Husk.kt:29) why?
#

I am sure that p is not null until the moment when I passed it as an argument to the husk class

gilded granite
worthy yarrow
#

From what I just researched, it's not supported in 1.21 apparently for anvil operations through a non placed anvil ig?

devout kite
#

Hey i try to catch when a player rightclicks a armorstand but i dont get any output in the console:

    @EventHandler
    public void InertactEntity(PlayerInteractEntityEvent event) {
        System.out.println(event.getRightClicked().getType());
        if (event.getRightClicked().getType() == EntityType.ARMOR_STAND) {
            ArmorStand entity = (ArmorStand) event.getRightClicked();
            String Name = entity.getName();
            System.out.println(Name);```
worthy yarrow
#

You registered your listener in main class yes?

devout kite
#

yaa i have a other event in this class with PlayerInteractEvent and that works

worthy yarrow
#

And it doesn't even print the first sout?

devout kite
#

nope

worthy yarrow
#

lets see the other playerInteract method

devout kite
#
@EventHandler
    public void RightClickEvent(PlayerInteractEvent event){
        Block block = event.getClickedBlock();
        if(block!=null) {
            ItemStack itemInHand = event.getPlayer().getInventory().getItemInMainHand();
            switch (itemInHand.getType()) {
                case SHEARS -> {
                    switch (block.getType()) {
                        case LARGE_FERN -> {
                            Bisected bisected = (Bisected) block.getBlockData();
                            if (bisected.getHalf() == Bisected.Half.BOTTOM) {
                                block.setType(Material.FERN);
                                ItemStack weed = new ItemStack(Material.FERN);
                                ItemMeta weedmeta = weed.getItemMeta();
                                if (weedmeta != null) {
                                    weedmeta.setDisplayName("Cannabis");
                                    weed.setItemMeta(weedmeta);
                                    block.getWorld().dropItem(block.getLocation(), weed);
                                    RegenerateFarm(block);
                                    event.getPlayer().playSound(block.getLocation(), Sound.ENTITY_SHEEP_SHEAR, 1, 1);
                                }
                            } else event.setCancelled(true);
                        }

                    }
                }
                default -> {
                    switch (block.getType()) {
                        case PLAYER_WALL_HEAD -> {
                            String headid = Main.headapi.getBlockID(block);
                            System.out.println(headid);
                            switch (headid) {
                                case "4570": {
                                    block.getWorld().dropItem(block.getLocation(), new ItemStack(Material.APPLE));
                                    RegenerateFarm(block);
                                    Main.headapi.setBlockSkin(block, "445");
                                }
                            }
                        }
                    }
                }
            }
        }
    }```
worthy yarrow
devout kite
worthy yarrow
#

Idk try a simpler print statement ig? Like just a basic "" output

#

See if it will actually output something

shadow night
#

Why'd you println "" when you can just not pass any args

worthy yarrow
#

Well put something inside

#

I just don't understand how the first print isn't outputting anything

#

But at least to verify the listener is being called, then "something" will hopefully verify that

devout kite
#

could it be that a plugin that i use for costumatiation armorstands catches that event somehow ?

shadow night
#

Btw why is the method name not in camelCase

worthy yarrow
#

Anytime the event is called if a plugin is listening to that event then something will probably happen

devout kite
devout kite
devout kite
#

i tryed System.out.println("s"); now but still nothing

#

and i changed something in the other event and that worked

worthy yarrow
#

Alright then I guess just separate the events to a class per listener

#

even if they are the same

devout kite
#

well i kinda did since the other event in the same class worked πŸ˜„

silk mirage
#

most random question but, what is the maximum amount of packet that can be processed in one tick?

#

if that makes any sense

worthy yarrow
#

Uh

#

It's not like a fixed number

silk mirage
#

but like yk

worthy yarrow
#

It depends on like server performance and the connections of the client -> server

worthy yarrow
#

Still not a fixed number bud

silk mirage
#

how many packets can a vanilla client send per tick at max?

worthy yarrow
#

I mean as many as needed

silk mirage
devout kite
worthy yarrow
silk mirage
#

i wanted to calculate smth

#

i just wanted to know

#

the highest limit kind of number

#

per tick per player

worthy yarrow
#

Again, theres no fixed number

silk mirage
#

no upper limit?

#

maybe therotical?

#

or practical

worthy yarrow
#

Packets can be sent as needed

devout kite
#

as i sad no change so still not working not eaven System.out.println("s")

silk mirage
#

So you're saying that a vanilla client is able to send 100000000 packets in a tick?

worthy yarrow
silk mirage
#

in the normal default conifugration

silk mirage
devout kite
#
package de.zyrox.farming;

import de.zyrox.Main;
import org.bukkit.Material;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.inventory.ItemStack;

public class farmingEntityEvent implements Listener {

    @EventHandler
    public void inertactEntity(PlayerInteractEntityEvent event) {
        System.out.println("s");
        System.out.println(event.getRightClicked().getType());
        if (event.getRightClicked().getType() == EntityType.ARMOR_STAND) {
            ArmorStand entity = (ArmorStand) event.getRightClicked();
            String Name = entity.getName();
            System.out.println(Name);
            switch (Name) {
                case "Apple":
                    event.setCancelled(true);
                    String headid = Main.headapi.getItemID(entity.getEquipment().getHelmet());
                    System.out.println(headid);
                    switch (headid) {
                        case "4570": {
                            entity.getWorld().dropItem(entity.getLocation(), new ItemStack(Material.APPLE));
                            RegenerateFarm.regenerateFarm(entity);
                            ItemStack greenapple = Main.headapi.getItemHead("445");
                            entity.getEquipment().setHelmet(greenapple);
                        }
                        break;
                    }
            }
        }

    }
}
worthy yarrow
#

I don't believe there is

silk mirage
#

alr

worthy yarrow
#

This is to prevent clients from malicious behavior such as sending too many packets too frequently, that being said there's still no hardcoded limit to how many packets can be sent by a client that'd be kinda dumb considering the client/server need to send as many packets as needed which is hard to determine a "limit" for anyway

devout kite
#

okey lets try PlayerInteractAtEntityEvent

tardy delta
worthy yarrow
#

I mean hey if it works it works kek

#

We're actually trying to get the less confusing method to work which is... odd to say the least

remote swallow
#

if (event.getRightClicked().getType() == EntityType.ARMOR_STAND) { paper?

worthy yarrow
#

Maybe thats the issue

#

using paper lib instead of spigot

remote swallow
#

i thought it was a different event kekw

devout kite
#

i dont have paper in my pom.xml only spigot

devout kite
#

i dont know why spigot only tiggers on that event for Armorstands but okey πŸ˜„

clear elm
#

how can i get the nul error in line 34 if im checking if the player is null in line 24?

remote swallow
clear elm
#
org.bukkit.command.CommandException: Unhandled exception executing command 'tpacancel' in plugin ZenTP v1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:987) ~[paper-1.20.1.jar:git-Paper-196]
        at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.1.jar:git-Paper-196]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[paper-1.20.1.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:324) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:308) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2354) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$21(ServerGamePacketListenerImpl.java:2314) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1338) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1315) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1308) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1286) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1174) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-196]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.HashMap.containsKey(Object)" because "tpahere" is null
        at eu.zenaria.zentp.commands.Tpacancel.onCommand(Tpacancel.java:34) ~[ZenTP-1.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more```

thats the error im getting
vast ledge
#

?paste

undone axleBOT
vast ledge
#

For the love of god

blazing ocean
#

because "tpahere" is null

remote swallow
#

this is null

clear elm
#

ah

#

ty

slender elbow
#

tpahere is null

#

not p or ptp

#

Cannot invoke "java.util.HashMap.containsKey(Object)" because "tpahere" is null

remote swallow
#

emily read up

slender elbow
#

no

lime wave
#
private static int nextSb_ID() {
        int N = 0;
        File file;
        do {
            file = new File("plugins" + File.separator + "clanSB" + File.separator + "clan"+(++N)+".txt");
        } while (file.exists());
            try {
                file.createNewFile();
            } catch (IOException e) {}
        return N;
    }
```anyone knows why this could not be working?
lilac dagger
#

Let's see

lilac dagger
#

Negate file exists

lime wave
#

I'm also quite new to that, so sorry

remote swallow
#

you dont do anything with the exception is why theres no errors

lilac dagger
#

Also your do while seems to be out of place

remote swallow
#

most likely it gets an npe on the first run attempt and doesnt create the file

lilac dagger
#

Use a while instead

lime wave
lilac dagger
#

Then you don't need do whole for this

#

Just increment n

#

N has to be a field

lime wave
#

not quite getting it

blazing ocean
#
var file = new File(plugin.getDataFolder(), "clan" + n + ".txt");
file.createNewFile();
return file;

shouldn't this just be enough

lime wave
#

I'll try explaining

#

My English iis not that good

lilac dagger
#

N is id

lime wave
#

nextSb_ID is called for the first time

lilac dagger
#

And each clan has an id

#

No?

lime wave
#

ig

#

but each time nextSb_ID is called it needs to create a new file on the plugin folder

#

with the name being: clan(prevID+1).txt

#

if it's called one time, clan1.txt

#

two times:
clan1.txt
clan2.txt

hazy parrot
#

your N is local variable

#

it will be reinirialized every time you call that function

#

so it will be 1 every time

lime wave
#

my goal is to check if the file clanN already exists

#

if so, increase N and try again

blazing ocean
#

doesn't createNewFile just ignore if it already exists

lime wave
#

but wouldn't it only fall on createNewFile() if it doesn't exists?

#

because of the do while?

lime wave
#

but it's simply not creating anything

#

and doesn't give me errors too

lilac dagger
#

Try if file doesn't exist
File create new

#

N increment

lime wave
#
private static int nextSb_ID() {
    int N = 0;
    File file;
    do {
        file = new File(MyPlugin.getInstance().getDataFolder().getPath() + File.separator + "clanSB" + File.separator + "clan"+(++N));
    } while (file.exists());
    try {
        file.createNewFile();
    } catch (IOException e) {}
    return N;
}
```this is working, just needed to create clanSB folder first
hazy parrot
#

You don't need that File.separator thingy

obtuse hedge
#

.toArray(new byte[] {}));

Error: Cannot resolve method 'toArray(byte[])'

#

why

young knoll
#

Use new byte[0] or byte[]::new

#

Or new byte[<collectionSize>]

obtuse hedge
#

still error

#

Cannot resolve method 'toArray(byte[])'

young knoll
#

What are you calling this on

obtuse hedge
#

a List of byte

eternal night
#

That'll be a list<Byte>

obtuse hedge
worldly ingot
#

Java introducing primitive collections when

#

Or, better yet, Java supporting primitive generics when

#

Hell they're introducing Markdown Javadoc comment support. Literally nobody was asking for that PES_HyperReee JUST GIVE US PRIMITIVE GENERICS

blazing ocean
#

meanwhile kotlin users

#

we have had both of those for a while now

river oracle
blazing ocean
#

what

worldly ingot
#

They're not "generics"

#

In the same way that C++ doesn't have generics. It has templates

obtuse hedge
#

dude im gonna cry

#

why cant i do a basic javascript task in java

#

aka making a array

eternal night
#

Valhalla when

blazing ocean
#

stop using java πŸ—£οΈ

obtuse hedge
#

you are so right rad

eternal night
#

Well a Byte is not byte

obtuse hedge
#

i should use rust

worldly ingot
#

You can make an array just fine, but JavaScript's arrays are very different from Javas :p

blazing ocean
#

use rust and kotlin combined !

eternal night
#

Idk if Apache has some util

worldly ingot
#

JS arrays are akin to ArrayList

eternal night
blazing ocean
obtuse hedge
#

i just need a array of byte, that i can add stuff to at the beginning

blazing ocean
eternal night
#

A weapon of war to burn out the eyes of the victims??

blazing ocean
#

just use groovy bro

obtuse hedge
#

so

#

am i gonna have to ask chat gpt

blazing ocean
eternal night
#

I don't think spigot exposed fastutil does it

#

So, well, rip I guess

#

Idk maybe apache has conversion tools

obtuse hedge
#

ah ByteArrayOutputStream exists

#

just what I need

river oracle
eternal night
#

That does not allow you to write at the beginning tho?

#

ByteArrayOutoutStream only let's you append, not pretend

#

Prepend

remote swallow
obtuse hedge
#

well

obtuse hedge
river oracle
obtuse hedge
#
ByteArrayOutputStream x = new ByteArrayOutputStream();
for (let i = 0; i < in.length; ++i) {
  x.write(in[i]);
}```
worldly ingot
#

If you want to write at the beginning, don't you just want a Deque of some sort?

blazing ocean
river oracle
blazing ocean
#

what ones

eternal night
river oracle
#

when I topple the bukkit ecosystem you are to thank

eternal night
eternal night
river oracle
#

@eternal night OrbitMC aka CabernetmC aka KryptideMC aka LynxPlayzMC aka Y2KMC aka MilesMC in a nutshell

remote swallow
#

no there is only 8 competeing standards

#

because you are like 6 of them

young knoll
#

I’m not sure that’s how it works

remote swallow
#

yes it is

worthy yarrow
#

New standard: Chaos

#

Every single bad habit in one standard practice

blazing ocean
worthy yarrow
#

kek

river oracle
blazing ocean
#

krita >>>

fallow kraken
#

Hi, someone know how spigot 1.21 source work, bcs, i want to edit class block but it doesn't exist like 1.8

obtuse hedge
#

why does java print 255 as -1 in byte form

drowsy helm
fallow kraken
# chrome beacon ?nms

But dont want to do minecraft plugin, directly modify spigot source, to run my own server jar based on spigot

worthy yarrow
#

yay another spigot fork

drowsy helm
#

Oh he asked why lmao

undone axleBOT
river oracle
#

follow the steps in Spigot repo

#

you need to use BuildTools to generate work/decompile/decompile-latest

#

so you can run applyPatches and rebuildPatches

fallow kraken
fallow kraken
river oracle
#

for 1.8?

#

you're on your own

#

you aren't getting help or support here

#

well thats a lie someone might help, but I guarentee a vast majority won't

obtuse hedge
#

I did something super cursed

wet breach
#

So if you exclude the most significant bit you get the right number

#

Well keeping in mind if its set it should be negative of course

hollow cliff
#

would love some help :D

https://mcpaste.io/ddbb7b24a53b3fa2

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.mandomc</groupId>
    <artifactId>MandoMCRemade</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>

    <name>MandoMCRemade</name>

    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

cant show respositories and dependencies due to discord space limit

#

plugin wont compile due to

org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: net/mandomc/mandomcremade/MandoMCRemade has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0

kind hatch
#

?paste

undone axleBOT
hollow cliff
#

i have a pastebin of the console above

dawn flower
#

how do i get a player's action bar

young knoll
#

You can’t

#

It’s not something that the server stores

#

I guess you could use a packet listener to read the outgoing packets

dawn flower
#

how long do action bars last

young knoll
#

A few seconds

worldly ingot
#

Last I recall looking at the code I think it's 1s fade in, 3 seconds stay, 1s fade out

dawn flower
worldly ingot
#

Yeah

worthy yarrow
#

Don’t you love accidentally shading world edit so it outputs a jar 47,000 kb large

#

I do because it makes me feel like I did more… a lot more

pseudo hazel
#

it makes me feel like I fucked up somewhere xD

dawn flower
#

do i need to lsiten for system chat or chat packet

young knoll
#

I think you mean 47 mb

#

You silly

pseudo hazel
#

why

#

you send a message to the action bar

#

thats all there is to it xD

dawn flower
pseudo hazel
#

player.sendActionMessage I think

dawn flower
#

or when any action bar is sent

pseudo hazel
#

why

#

are you not the one sending it?

worthy yarrow
dawn flower
#

so i can know if the player has an action bar now?

dawn flower
pseudo hazel
#

I dont think you can just grab the contents of the action bar

young knoll
#

Apparently 2 packets can be used to send an action bar

pseudo hazel
#

you would have to snipe the outgoing packet from the server

young knoll
#

Idk which one the api uses :(

#

Guess I can go look

pseudo hazel
#

probably both

dawn flower
pseudo hazel
#

or

#

?tas

undone axleBOT
worthy yarrow
#

My prebuilt structures system is getting there πŸ˜„ finally got the visual indicator working but still kinda bugged

young knoll
#

The api uses the system chat packet

#

Granted other plugins may be special and use the set action bar text packet

lyric jay
#

Hey, I'm currently making a SMP and I wanna know, how can I stop people from entering spawn in combat. I added PvPManager plugin.

mortal vortex
#
World world = chunk.getWorld();
Location spawnLocation = world.getSpawnLocation();

int spawnChunkX = spawnLocation.getBlockX() >> 4;
int spawnChunkZ = spawnLocation.getBlockZ() >> 4;

int chunkX = chunk.getX();
int chunkZ = chunk.getZ();

int distanceSquared = (chunkX - spawnChunkX) * (chunkX - spawnChunkX) + (chunkZ - spawnChunkZ) * (chunkZ - spawnChunkZ);

return distanceSquared <= radius * radius;
lyric jay
#

What do i do with this

mortal vortex
#

what ever you want I guess,

lyric jay
#

I didn't understand, how does this help me

young knoll
mortal vortex
#

OH.

#

I added PvPManager plugin.
I thought he was making a plugin, because this is that channel.

torn shuttle
#

but which channel do i go to if I want to develop my gains?

mortal vortex
#

I was wondering if it's possible, with something like ProtocolLib, to inject shader packets to the client?

#

to force the player into using a glsl shader

torn shuttle
#

you can distribute a rsp that has a shader in it

#

sending packets to it based on triggers is an exercise left to the reader

mortal vortex
#

Ah

#

I was looking at this repo and was trtying to implmenet the scoreboard shader into a plugin.

young knoll
#

Yeah just send them a resource pack

torn shuttle
#

fun fact 1.21 seems to have broken some aspects of old shader code

#

so good luck

young knoll
#

Or update to 1.20.6 and use the built in feature to hide scoreboard numbers

mortal vortex
# torn shuttle you can distribute a rsp that has a shader in it

I have no experience using resourcepacks, I understand how to do it, but I'm more concerened if they can be stacked?

A plugin on a server I'm developing already uses it's own resource pack provided by another plugin (not the server), so can they both be applied, or do they need to be merged?

young knoll
#

Yes

torn shuttle
#

I can't believe we have the technology to do that

#

what's next, a round cube?

#

heresy

mortal vortex
#

or is it a built in client feature

young knoll
#

Spigot

mortal vortex
#

Got a link? I couldn't find anything about it

mortal vortex
#

uwu tysm

young knoll
#

Ah wait that’s not it

#

Hold on

mortal vortex
#

oop

#

we do a little misinformation spreading

torn shuttle
#

I always knew col was a russian plant hired by paper to spread misinfo about spigot docs

mortal vortex
#

real

mortal vortex
#

objective.setScoreFormat(ScoreFormat.blankScore());

young knoll
#

That’s it

torn shuttle
#

he fell for the second russian plant

#

classic

young knoll
#

Ah wait no that’s not using the api

#

The heck

mortal vortex
#

check the class I linked to

young knoll
#

It was never merged

mortal vortex
#

LOL

young knoll
#

I blame @worldly ingot

mortal vortex
#

Real

young knoll
#

I swear it was merged and I used it

mortal vortex
#

Anyways, for now, packets seem to do the trick:

@Override
    public void onPacketSend(PacketSendEvent event) {
        if (event.getPacketType() != PacketType.Play.Server.SCOREBOARD_OBJECTIVE) return;
        WrapperPlayServerScoreboardObjective objective = new WrapperPlayServerScoreboardObjective(event);
        objective.setScoreFormat(ScoreFormat.blankScore()); // BLANK NUMBERS
}
young knoll
#

But I guess I’ve gone insane

mortal vortex
#

I could've sworn I used a method for something once and turned out it never existed. Spent days hunting for it

young knoll
#

Well at least packetevents means you can avoid NMS for it

mortal vortex
#

Which was what I was hoping to do anyhoo!

#

Thanks though, you pointed me in the right direction!

wet breach
torn shuttle
#

this is fine

#

maybe too short actually

#

there we go once every three days seems good

worthy yarrow
worthy yarrow
#

Unintentional, it's based off what the player is currently looking at hence the left corner starting at the players current view

#

The paste was supposed to be within the particle box but I think that's a bit obvious

agile anvil
#

Why not using displayentity?

worthy yarrow
#

Because you just now mentioned it and I just now remembered these are a thing psh

#
public void displayStructureOverlay(Player player, Location targetLocation, int width, int height, int depth) {
        Location[] corners = new Location[]{
                targetLocation.clone().add(0, 0, 0),
                targetLocation.clone().add(width, 0, 0),
                targetLocation.clone().add(0, height, 0),
                targetLocation.clone().add(0, 0, depth),
                targetLocation.clone().add(width, height, 0),
                targetLocation.clone().add(width, 0, depth),
                targetLocation.clone().add(0, height, depth),
                targetLocation.clone().add(width, height, depth)
        };

        drawLine(player, corners[0], corners[1]);
        drawLine(player, corners[0], corners[2]);
        drawLine(player, corners[0], corners[3]);
        drawLine(player, corners[1], corners[4]);
        drawLine(player, corners[1], corners[5]);
        drawLine(player, corners[2], corners[4]);
        drawLine(player, corners[2], corners[6]);
        drawLine(player, corners[3], corners[5]);
        drawLine(player, corners[3], corners[6]);
        drawLine(player, corners[4], corners[7]);
        drawLine(player, corners[5], corners[7]);
        drawLine(player, corners[6], corners[7]);
    }```

The fuckery I am doing with particles lol
floral drum
#

what the fuck mate

tardy inlet
#

i have a plugin which is thorwing error when compiling so is the url changed for repository?

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>
    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.14-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>```
floral drum
tardy inlet
#

its a very old plugin, i need to update something in it

#

dev didn't set correct perms for it

if ((!player.hasPermission("fastplace.max.5") || amount > 5) && (!player.hasPermission("fastplace.max.10") || amount > 10) && (!player.hasPermission("fastplace.max.15") || amount > 15)) {
                           player.sendMessage(Fastplace.getInstance().getConfigHandler().getNoPermissionMessage());```
sullen marlin
tardy inlet
#

ah ok

floral drum
#

hi md

tardy inlet
#

i never coded any plugins, i just wanted to update those perms

worthy yarrow
floral drum
#

you're going to get particles originating from the corner to the other corners now lol

worthy yarrow
#

Yeah thats

#

not what we want..

floral drum
#

hm

worthy yarrow
astral pilot
#

is there a buit in function to combine 2 ItemStacks[] together

sullen marlin
#

Wdym? Array copy?

tardy inlet
#

how do i add spigot into intelij with old code

lilac dagger
drowsy helm
astral pilot
sterile flicker
#
fun spawn(loc: Location) {
        this.setPositionRotation(loc.x, loc.y, loc.z, loc.yaw, loc.pitch)
        bukkitEntity.persistentDataContainer.set(
            NamespacedKey(MobWars.instance, "custom"),
            PersistentDataType.BYTE,
            1.toByte()
        )

        if (loc == MobWars.positions.blueMobSpawn) this.setGoalTarget((Bukkit.getPlayer(MobWars.blue.shuffled().first()) as CraftPlayer).handle as EntityLiving, EntityTargetEvent.TargetReason.CUSTOM, true)
        else if (loc == MobWars.positions.redMobSpawn) this.setGoalTarget((Bukkit.getPlayer(MobWars.red.shuffled().first()) as CraftPlayer).handle as EntityLiving, EntityTargetEvent.TargetReason.CUSTOM, true)
        val provider = p().a(GenericAttributes.ATTACK_SPEED, 0.5).a()
        val base = AttributeMapBase(provider)
        val map = CraftAttributeMap(base)

        try {
            val attributeMapField: Field = EntityLiving::class.java.getDeclaredField("attributeMap")
            val craftAttributeMapField: Field = EntityLiving::class.java.getDeclaredField("craftAttributes")

            attributeMapField.setAccessible(true)
            attributeMapField.set(this, base)

            craftAttributeMapField.setAccessible(true)
            craftAttributeMapField.set(this, map)
        } catch (ex: Exception) {
            ex.printStackTrace()
        }
        for (p_ in MobWars.players) {
            val p = Bukkit.getPlayer(p_)!!
            val packet = PacketPlayOutSpawnEntityLiving(this)

            val packet2 =
                PacketPlayOutEntityMetadata(bukkitEntity.entityId, this.dataWatcher, false)
            val connection = (p as CraftPlayer).handle.playerConnection
            connection.sendPacket(packet)
            connection.sendPacket(packet2)
        }```` is it possible to spawn an entity in this way instead of world.addentity, why does it just hang in the air?
floral drum
#

what are you trying to do? What you're basically doing there is only spawning the entity on the client's screen instead of the server, so the server has no idea that the entity actually exists. Only the client does.

astral pilot
floral drum
#

I'm pretty sure that's what I'm getting from this anyway

sterile flicker
floral drum
#

huh?

sterile flicker
#

addEntity will send the packet PacketPlayOutSpawnEntityLiving?

floral drum
#

basically adding an entity to the world, normally, will add it to the existing entities inside of the server, including game ticks, ai execution, movement handling, cross world teleporting, etc. Basically making it so it can be interacted by players.

Doing it with just plain packets will tell the player there's an entity where you specified it should spawn, with what type it is, but the server doesn't know about the entity at all, because all you're doing is sending the information to the client and no information about the entity is being stored inside of the server.

sterile flicker
#

how do I find out the bat id in 1.16.5?

lilac dagger
#

it's stored in the entity types no?

#

actually by the looks of it, there's no longer an id associated with it

#

i think the id in this case is 'bat'

young knoll
#

minecraft:bat to be specific

lilac dagger
#

well there you have it

astral pilot
#

which function handles the exp amount calculation in CraftBukkit

drowsy helm
#

Has anyone here ever tried hosting a react site on a mc server similar to dynmap but with react

#

Ig node modules would take too much space

ocean gorge
#

can i send pictures?

#

i need help

eternal oxide
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

drowsy helm
#

Unless you use some shit like thymeleaf

#

No ty

blazing ocean
blazing ocean
#

wtf

ocean gorge
#
private void setATM(Inventory inventory, double balance){
        List<String> lore = new ArrayList<>();
        lore.add(Banks.format(""));
        lore.add(Banks.format("&2&oIstituto Bancario NovaCredit"));

        ItemStack one = createCustomItem(0, "&f€1", lore);
        ItemStack two = createCustomItem(0, "&f€2", lore);
        ItemStack five = createCustomItem(fiveModel, "&f€5", lore);
        ItemStack ten = createCustomItem(tenModel, "&f€10", lore);
        ItemStack twenty = createCustomItem(twentyModel, "&f€20", lore);
        ItemStack fifty = createCustomItem(fiftyModel, "&f€50", lore);
        ItemStack hundred = createCustomItem(oneHundredModel, "&f€100", lore);
        ItemStack twoHundred = createCustomItem(twoHundredModel, "&f€200", lore);
        ItemStack fiveHundred = createCustomItem(fiveHundredModel, "&f€500", lore);

        ItemStack money = new ItemStack(Material.GOLD_NUGGET);
        ItemMeta moneyMeta = money.getItemMeta();
        assert moneyMeta != null;
        moneyMeta.setDisplayName(Banks.format("&6Credito residuo"));
        List<String> moneyLore = new ArrayList<>();
        moneyLore.add(Banks.format("&e€" + balance));
        moneyMeta.setLore(moneyLore);
        money.setItemMeta(moneyMeta);

        inventory.setItem(10, one);
        inventory.setItem(11, two);
        inventory.setItem(12, five);

        inventory.setItem(19, ten);
        inventory.setItem(20, twenty);
        inventory.setItem(21, fifty);

        inventory.setItem(28, hundred);
        inventory.setItem(29, twoHundred);
        inventory.setItem(30, fiveHundred);

        inventory.setItem(24, money);
    }```

in this code i set CustomModelDatas but his not works 😦
hazy parrot
#

have some precompile script to compile react to uber js into your resources folder

quaint mantle
hazy parrot
#

and shade some webserver

#

into jar

blazing ocean
#

okay but hear me out

drowsy helm
#

Whats in createCustomItem

ocean gorge
#

😦

drowsy helm
drowsy helm
undone axleBOT
hazy parrot
ocean gorge
#

why has not models?

drowsy helm
#

Your resource paxk is incorrect then

quaint mantle
acoustic pendant
#

What's the best way to support custom enchants across different versions? Just PDC? (Yes i want to give support to old versions xd)

acoustic pendant
river oracle
#

If you hate yourself use NBT for before that

acoustic pendant
#

na na, just for 1.16.5 support

river oracle
#

Already way to early now qdays imho

#

Supporting 1.20.4 plus gives you 60% of the market share

#

Supporting 1.20.1 plus gives you over 75%

acoustic pendant
#

We will need the code for that

#

just the listener ig

dawn flower
#

how do i copy an entity without it mirroring its nbt to the original entity?

eternal oxide
#

full code

river oracle
#

Just spawn a new one

dawn flower
#

u didnt understand what i meant

dawn flower
#

if i copy an entity, then change the nbt of the copied entity, it mirrors the new nbt to the original entity

river oracle
#

Ohhh I see. That's quite an odd change.

#

That seems so weird

acoustic pendant
#

are you sure inv is not null?

river oracle
#

Every player shares the same inventory

#

It's not going to be tailored to each player

wooden frost
#

How can one damage an entity with a damage cause?

acoustic pendant
#

i believe

river oracle
#

Further I'd say it's likely the equality changes probably

wooden frost
river oracle
#

?jd-s

undone axleBOT
acoustic pendant
#

oh

river oracle
wooden frost
#

oh i forgot to build it, nvm

river oracle
#

Damage cause is an archaic and doesn't cover every case

sterile breach
#

Hi with NMS how I can get all packets sended by the server? there is packets listeners?

wooden frost
#
p.damage(40d, DamageSource.builder(DamageType.FREEZE).build());
hot rover
#

Hi guys, got a question!
When my players type a command /level they open a custom GUI that works perfectly. I have listened to the onClick and blocked it / made it do things, and that all works fine. I just added it to my public server and we figured out that as soon as someone else types the command, your inventory is just that, a inventory. It no longer has any functionality for the person that first typed the command.

I believe this has to do with the way i store the inventorys but i cant rap my head around it. Its been a while since i coded spigot plugins.
Can someone help?

Code below:

#

RuneMC.java (Main Class)

public class RuneMC extends JavaPlugin {

    @Override
    public void onEnable() {       
        LevelCommand levelCommand = new LevelCommand();
        getCommand("level").setExecutor(levelCommand);

        File f = new File(this.getDataFolder() + "/");
        if(!f.exists())
            f.mkdir();
    }
}

LevelCommand.java

public class LevelCommand implements CommandExecutor, Listener {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {

        LevelInventory levelInventory = new LevelInventory();
        Bukkit.getServer().getPluginManager().registerEvents(levelInventory, RuneMC.getPlugin(RuneMC.class));
        
        Player p = (Player) sender;
        levelInventory.SetupInventory(p);
        p.openInventory(LevelInventory.inv);
        
        PlayerData playerData = new PlayerData();
        playerData.CreateNewPlayerSaveData(p);
        
        return true;
    }
}

LevelInventory.java

public class LevelInventory implements Listener {

    public static Inventory inv;
    
    public void SetupInventory(Player p){

        inv = Bukkit.createInventory(null, 27, "Level");
        InventoryTools.InitializeDefaultInventory(inv, 27);

        String LeftClickMessage = ChatColor.GREEN + "Left-click to open skill menu";
        InventoryTools.SetupPlayerHeadItem(p, inv,  4);
        InventoryTools.SetupSkillItem(p, inv, 10, Values.MiningIdentifier, Material.DIAMOND_PICKAXE, " ", LeftClickMessage);
    }

    @EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {
        if (!e.getInventory().equals(inv)) return;
        e.setCancelled(true);
    }
velvet prawn
#
ArrayList<Map<String, Object>> items = new ArrayList<>();

event.getPlayer().getInventory().forEach(itemStack -> {
  if (itemStack != null) {
    var item = itemStack.serialize();
    items.add(item);
  }
 });

MongoDB.getCollection("inventories").insertOne(new Document("uuid", event.getPlayer().getUniqueId().toString())
  .append("date", TornadoCityBuild.getInstance().getTimeUtils().getFormattedTimeNow().replaceAll(" ", ""))
  .append("items", items)
);

items with itemsmeta or with enchantments wont be saved, somebody knows a fix?

drowsy helm
#

And reintialising it each time a player opens the inv

hot rover
#

Should that not be bypassed because i create a new instance of LevelInventory when the command is executed?

drowsy helm
#

No

#

Static is shared between all class instances

#

Thats what static means

#

And btw creating a new listener per player will cause lag

#

Make a singleton manager class

#

Removing the static should fix it if you’re making a new instance, but you should definitely refactor the structure of it

sterile breach
#

Hi with NMS how I can get all packets sended by the server? there is packets listeners or a like this thing?

drowsy helm
sterile breach
grim hound
#

like you wanna know how do it raw?

sterile breach
grim hound
#

depends on whether you wanna intercept ALL packets (handshake included)

#

or just packets the player sends after joining and spawning in the world

sterile breach
grim hound
#

first of all you need to find the server Channel Handler

#

that's what's responsible for injecting other channel handlers

#

into the Channel of the user

#

a Channel is basically the worker object that allows reading and writing in the connection

sterile breach
#

channel is a communcation client/server?

grim hound
#

yep

#

that's how it is in netty

#

the library used by minecraft for I/O

sterile breach
#

ah yes I know

grim hound
#

this is how I find the server channel

#

it's positioned in the ServerConnection nms class

#

as a ChannelFuture

#

it's only a List because of reused code from singleplayer

#

you can get the server's channel by doing

#

ChannelFuture#channel

sterile breach
#

getDeclaredFields are a list of all channels?

grim hound
#

fields are variables held within the class

grim hound
#

but since it's name isn't static we search it by type

grim hound
# grim hound

the future here is the future that's completed when the server is ready to accept connections

#

so pretty much you always get it already completed

tardy delta
# grim hound

guess they never heard of static variables in unloaded inner classes

grim hound
#

pretty useless

tardy delta
#

kotlin has a by lazy delegate :)

sterile breach
#

if I understand, there is a list who store all registred channels (for all players) ?

grim hound
#

the most bottom one

#

it stores the nms object

#

that contains the Channel

#

as I don't think netty stores all of the channels in an accessible way

sterile breach
#

ah yes

#

then, after having get channel, how to listen packets (outgoing and incoming)?

grim hound
#

for the most useable way you do it with one handler

sterile breach
#

into?

grim hound
#

this way: Channel#pipeline().addBefore("packet_handler", handlerName, handler);

#

before packet handler as only there are the packets in the form of NMS packet classes

#

later they turn into ByteBufs

grim hound
grim hound
sterile breach
#

ah channel have some method to handle passing packets, we need to add our handler?

grim hound
grim hound
#

that's the API

sterile breach
#

spigot api do this?

sterile breach
pseudo hazel
#

yes spigot does packet stuff too, to function

grim hound
#

I mean

#

ye

grim hound
sterile breach
#

ah yes

grim hound
#

(this is the user's channel)

sterile breach
#

you said handshaking channels are "specials" ?

#

why

grim hound
#

never said that

sterile breach
#

different

#

I think

sterile breach
#

yes

grim hound
#

well what I meant is that handshake is the very first packet sent by the client

#

so handshake included meant all, all packets

sterile breach
#

ah so channels are not again initalized

grim hound
#

they are relocated during compression set

#

(some of them)

#

kind of

#

when compression is used plugins need to relocate their handlers when the compression set packet is sent and indicates that compression will be used

sterile breach
#

I imagine that all connections arrive via a global entry point that divides them into channels?

grim hound
#

as then another channel handlers handling compression (for outgoing) and decompression (for incoming) are added

grim hound
#

or maybe

#

uh depends

#

on where you are asking

grim hound
#

you will have a Channel

#

so a channel is associated with an IP the moment the connection is accepted

#

but each channel channelRead and write only handle the packets that are related to the connection of that very player (when speaking of a player's Channel)

#

but in the server Channel, all player Channels arrive in the very same handler

sterile breach
#

I thought that when a client contacts the server he doesn't actually specify his channel, he gives an id or something like that and it's the server that defines that such id corresponds to such channel

grim hound
#

a channel is just a class that allows for communication

#

it simplifies sending and receiving bytes

sterile breach
#

yes

#

so at the "entry point connection" channel class are not defined that's what I thought

grim hound
#

depends on what you are speaking exactly

#

like what entry point?

#

a server internally associates a Channel to an IP

#

a client also internally associates his own channel when connecting

sterile breach
#

first method called in nms when the server got connection I don't know exactly how it works but there is probably a first method

#

I'm sorry, I'm going to have to leave. I'll let you know as soon as I get back, if that's okay

grim hound
sterile breach
#

yes

grim hound
#

first channel handler in the server channel's pipeline

grim oak
#

Hi, is it good practise to run SQL queries async when they can be, or not?

grim oak
#

Would i use bukkit scheduler for that

grim hound
#

definitely

#

not

grim oak
#

How would u do it

grim hound
#

not their async or their sync

grim hound
#

I'd either create a ThreadPoolExecutor

#

or a ForkJoinPool

grim hound
#

this one is supposed to have a work divided input

ivory sleet
#

If you run a modern java version u might be blessed w a virtual thread executor

ivory sleet
#

πŸ™

grim hound
#

what version is that?

ivory sleet
#

21 iirc

#

just so happens to be on an LTS version as well :)

grim hound
#

which packet is used for when the player clicks on air or a block?