#help-development

1 messages Β· Page 566 of 1

remote swallow
#

why convert it to epoch in the first place

river oracle
#

ugh

tardy delta
#

System.currenttimemillis()

remote swallow
#
Instant cooldown = map.get(key);
        Instant now = Instant.now();
        if (cooldown != null && now.isBefore(cooldown)) {
            return Duration.between(now, cooldown);
        } else {
            return Duration.ZERO;
        }
river oracle
#

this is annoying fuck Instant

#

I'm just going back to System.currentTimeMillis

remote swallow
remote swallow
trim creek
river oracle
#

I'm starting a scheduler

pseudo hazel
#

wait am I the only that just likes to do simple math with currenttimemillis?

trim creek
#

That's why I need Loader instances in all my fucking classes...

remote swallow
#

still use instants

#

just use that as an example

pseudo hazel
#

instead of all these weird api

tardy delta
#

longs are meaningless

#

and i am still waiting for type aliases in java

river oracle
trim creek
#

I swear, Spigot should make their site DARK THEMED ALREADY

#

GOD DAMN IT

pseudo hazel
#

you mean the docs?

river oracle
#

it has a dark theme

trim creek
#

no

#

literally all the fucking sites

river oracle
#

just gotta donate :P

trim creek
#

REEEEEE

pseudo hazel
#

thats the best reason to pay for anything

remote swallow
#

just use darkreader

river oracle
remote swallow
#

should do

river oracle
#

or is it reversed

remote swallow
#

i think its like that

tardy delta
#

dark reader

remote swallow
#

try it and see if my brain blanked

river oracle
#

yeah its like that

trim creek
#

imagine paying for themes πŸ’€
cringe

peak jetty
#

now when i try to add it to another player it says its still a Collection though

river oracle
tardy delta
#

what themes

pseudo hazel
#

I would guess a duration between now and some time in the future would be positive

trim creek
#

dark mode

river oracle
tardy delta
#

ah fun πŸ’€

peak jetty
#
final Player player = e.getPlayer();
            final PotionEffect killedPlayerPower = player.getActivePotionEffects().stream()
                    .filter(effect -> effect.getDuration() <= PotionEffect.INFINITE_DURATION)
                    .findFirst()
                    .orElse(null);
            if(killedPlayerPower == null) {
                return;
            }
tardy delta
#

dark magic is a fact

#

im sorry guys but i want to use rust now

peak jetty
#

what?

flint coyote
#

probably sharing the wrong snippets

remote swallow
#

?paste the full class

undone axleBOT
peak jetty
#

oh nvm i fixed it

#

it was something wrong in the global area

#

i had this set to collection πŸ’€

remote swallow
#

do you ever set that

zenith gate
#

@echo basalt So all the players vaults their spawn is set to not save in memory, but should I have the world that is being copied saved in memory or should i disable that too?

echo basalt
#

set the session to expire after like 15 minutes

echo basalt
#

Just less latency

#

If the template is small enough

#

Look at the settings I use

#

I gotta push some stuff to cosmos

zenith gate
#

I mean like my world is maybe like 60 blocks width wise. build limit is 512 i think, and its just void for the rest.

echo basalt
#

it just uses your schematic's size

#

Feel free to pull and build from sources

#

or I can just make a new release and push it on my repo

zenith gate
#

No no dont worry about it haha, I'll look into and take some ideas. you just let me know when you get to a stable production plan. Cosmos looks really good and promissing.

echo basalt
#

I did production testing

#

it's stable

tardy delta
#

hows your number parsing thing going

pseudo hazel
#

is it bad to have a lot of yml files? I find myself using a lot of data files for additional config done in game (like via menus and stuff such as player kits and whatnot) I am slowly crawling past 10 of these separate files and I dont know if hey should be combined even if it doesnt make logical sense

#

they arent all big

zenith gate
zenith gate
tardy delta
#

only 400

pseudo hazel
#

well yeah

#

I think only like 2 of those actually reach that 500 mark

#

which i would still consider small

#

so I guess its normal then

zenith gate
#

mine never reach 300+

pseudo hazel
#

its becoming quite a big plugin I guess so it kinda makes sense

zenith gate
#

Yeah, its alright to have multiple configs.

pseudo hazel
#

im talking about generated config things as well

#

like I only have a single config.yml that users should touch

flint coyote
pseudo hazel
#

well its not a per player thing

#

only really 1 or maybe 2 files manage any player state

flint coyote
#

you said their kits etc

pseudo hazel
#

yes

#

I mean the kits themself

#

I am making a minigame

#

I dont have persistent player information

flint coyote
#

Oh alright then

pseudo hazel
#

like I am making a bingo plugin so I also have a way to create cards, which get saved in a config file

#

stuff like that

tardy delta
#

probably want a database at that point

pseudo hazel
#

yeah maybe

flint coyote
#

yeah that's fine to have seperate files for configuration

pseudo hazel
#

a database does not sound like a bad idea

#

but like

#

my files are already acting like a database, just very decentralized xD

flint coyote
pseudo hazel
#

there is

#

like I said my users dont really edit these configs

#

they are more just to store information

#

I only have one actual config.yml file which I use for settings

#

but maybe using a database can clean up my plugin folder

#

idk if you have any good resources on setting that kind of thing up

#

idk if its even something you can do per like plugin

#

I dont really know how databases work in regards to plugins

#

whats the skull for

#

i said like 10 things

timid bridge
#

If anyone here is experienced with developing plugins, please DM me. I'm looking to commission for a simple job.

zenith gate
#

you can use MySQL for a database. basically keep things stored locally you dont have a need for it to be accessed in the cloud, if this is just for mini games.

pseudo hazel
#

?services

undone axleBOT
tardy delta
#

?services

undone axleBOT
quaint mantle
#
    @EventHandler
    public void sapling(StructureGrowEvent e) {
        System.out.println("test0");
        if (e.getSpecies() == TreeType.DARK_OAK) {
            System.out.println("test1");
            e.setCancelled(true);
            File schem = new File(plugin.getDataFolder() + "/WorldEdit/schematics/test.schem");
            ClipboardFormat format = ClipboardFormats.findByFile(schem);
            World world = new BukkitWorld(e.getWorld());
            if (format != null) {
                try (ClipboardReader reader = format.getReader(new FileInputStream(schem))) {
                    Clipboard clipboard = reader.read();
                    try (EditSession editSession = WorldEdit.getInstance().newEditSessionBuilder().world(world).build()) {
                        int x = e.getLocation().getBlockX();
                        int y = e.getLocation().getBlockY();
                        int z = e.getLocation().getBlockZ();
                        Operation operation = new ClipboardHolder(clipboard)
                                .createPaste(editSession)
                                .to(BlockVector3.at(x, y ,z-1))
                                .ignoreAirBlocks(true)
                                .build();
                        Operations.complete(operation);
                    } catch (WorldEditException exception) {
                        throw new RuntimeException(exception);
                    }
                }
                catch (IOException exception) {
                    exception.printStackTrace();
                }
                System.out.println("test2");
            }
        }
    }``` i did schematic spawn when sapling grow but i have a problem if there are blocks around of sapling my schematic pasting
u guys give me idea for prevent this ?
im i need loop blocks around of sapling ?
pseudo hazel
#

you mean a database thats actually in the plugin itself?

#

or what do you mean by locally

#

like can I set it up so users dont notice the difference?

zenith gate
#

yes you can put it in the plugin. you'll have a folder in the servers directory to hold all your data. it could be in the plugins data folder or somewhere else.

#

basiclly you keep all your data stored locally on the machine the server is running on.

#

locally hosted database.

pseudo hazel
#

oh so its just like a blob of all the data basically

zenith gate
#

yes

flint coyote
#

no o.o

#

A database is not a file

#

I mean a database also stores in files at the end but theres a lot more to it

tardy delta
#

heehee

zenith gate
pseudo hazel
#

well frankly I dont care about how its implemented

#

I just wanted to know what it would roughly look like

flint coyote
pseudo hazel
#

where will the database be

flint coyote
#

On any server. Can be the same one or another one

#

Your plugin just requires the url, user and password to access it

pseudo hazel
#

okay

#

well

echo basalt
#

in the main thread

#

is a bit intensive

pseudo hazel
#

so what does the server owner have to do then

#

because I assume I cant just will a database into existence from my plugin

flint coyote
#

he requires a set up database and he has to add the credentials and maybe the database schema to your config file

pseudo hazel
#

okay

#

I see

#

sounds like ill just put all my configs into a separate folder xD

tardy delta
#

people actually knowing how to setup databases πŸ€“

atomic swift
#

why it doing this

tardy delta
#

getStringList

flint coyote
#

You can do that, too xD unless your files are huge a database is overhead anyway

pseudo hazel
#

I mean I am not against learning how to set it up, its just that i dont want it to be annoying for users of my plugin

#

yeah they are small atm

#

unless there is a smaller scope way of centralizing data other than just using system folders then im good

atomic swift
#

i have a database class

flint coyote
pseudo hazel
#

well I know databases

#

just not in the context of minecraft plugins

#

sorry if I confused you

atomic swift
pseudo hazel
#

well like setting it up

#

like ideally the server owner will just have to put teh jar file into the pluginsfolder and then the plugin works

quaint mantle
#

can i change this ?

flint coyote
pseudo hazel
#

yes im sure that does not change

#

yeah noted

#

thanks for your suggestions though

atomic swift
#

depends whether u want sql or mysql

tardy delta
remote swallow
#

mysql is still sql

tardy delta
atomic swift
pseudo hazel
#

xD

#

thats like the last choice I would think about when adding a database

atomic swift
#

i have an entire class just for mysql and sqlite which i use for discord bots and mc plugins

quaint mantle
tardy delta
#

isnt that with resourcepacks too ;-;

pseudo hazel
#

xD

remote swallow
#

you can rename a chest item

quaint mantle
remote swallow
#

and have it keep the name

quaint mantle
#

not work

tardy delta
#

ah right you can rename a chest

#

silly game

remote swallow
quaint mantle
#

u guys can give me idea ? for custom sapling

#

i did with schematics

#

but if there are blocks around

#

still pasting

dusty dagger
#

What event fires when a dropped item falls into the void? Does it just stop and then eventually despawn from timeout? Or does it get disappeared? Thanks πŸ™‚

quaint mantle
#

am i need loop blocks of around sapling ?

sinful matrix
#

I need help with my plugin
I want to block the Endportal until a specific date / time in the real world and if this date / time is over the players should be able to enter the Endportal

quaint mantle
flint coyote
tardy delta
quaint mantle
dusty dagger
sinful matrix
flint coyote
#

Is the event firing? Did you try adding a debug message?

sinful matrix
quaint mantle
flint coyote
dusty dagger
timid bridge
sinful matrix
pseudo hazel
sinful matrix
# flint coyote hardcoded? Repeated?

I wanna use a config file

# Date and time when the end portal will be accessible
date: "2023-06-15"
time: "22:27:50"

# Block access to the end portal frame
blockEndPortal: true
flint coyote
#

Do you have that values as LocalTime and LocalDate already? Or you take a LocalDateTime and only need one config entry

#

We are here to help people with writing code not spoonfeeding them - doesn't matter if you pay or not

eternal oxide
#

runs every Monday at midnightjava LocalDate nextDate = LocalDate.now().with(TemporalAdjusters.next(DayOfWeek.MONDAY)); Long midnight = LocalDateTime.now().until(nextDate.atStartOfDay(), ChronoUnit.MINUTES); ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); scheduler.scheduleAtFixedRate(()-> { /* Code here */ }, midnight, TimeUnit.DAYS.toMinutes(7), TimeUnit.MINUTES);

sinful matrix
# flint coyote Do you have that values as LocalTime and LocalDate already? Or you take a LocalD...

I read the date and time from the config and then put it in a date

public class EndHandler implements Listener {
    private final Plugin plugin;
    private final String date;
    private final String time;
    private final boolean blockEndPortal;

    public EndHandler(Plugin plugin) {
        this.plugin = plugin;

        this.date = plugin.getConfig().getString("date");
        this.time = plugin.getConfig().getString("time");
        this.blockEndPortal = plugin.getConfig().getBoolean("blockEndPortal");

        try {
            Date dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(date + " " + time);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        Bukkit.getScheduler().runTaskTimer(plugin, () -> {

        }, 0, 20);
    }

    @EventHandler
    public void onPlayerTeleport(PlayerTeleportEvent event) {
        if (event.getCause().equals(PlayerTeleportEvent.TeleportCause.END_PORTAL)) {
            if(blockEndPortal)
                event.setCancelled(true);
        }
    }
}
eternal oxide
#

you cna adjust to run as often as you want

flint coyote
#

Date has a "before" and "after" method

#

Create a new Date and compare it with the one from your config

#

If current date is before the config date, cancel the event

sinful matrix
flint coyote
#

you don't need a scheduler

#

just put it in the event

sinful matrix
#

I want to add a count down later

flint coyote
#

When do you wanna display that countdown?

sinful matrix
#
[22:43:37 INFO]: [Survival] [STDOUT] cancel
#

Its working btw

sinful matrix
flint coyote
#

Well in that case your scheduler is fine. Now you just have to do some math based on Date.getTime()

#

and add your thresholds

#

You could create a list of reminder milliseconds in order and remove them once you reminded. Or you keep them in the list (or might aswell use an array then) and store your last reminder index

weak bear
#

Hello do you have a video for learn how to connect a database to my plugin please

#

thx in advance !

sinful matrix
flint coyote
#

because it would have to be equal by nanosecond precision

#

which is unlikely if you check every second

sinful matrix
flint coyote
#

you can use getTime and specify a range

#

or you do toInstant() and use truncatedTo()

#

You have to use that on both sides

sinful matrix
#

Can I also do it like this? πŸ˜‚

if(currentDate.equals(dateFormat.getYear())){
                if(currentDate.equals(dateFormat.getMonth())){
                    if(currentDate.equals(dateFormat.getDay())){
                        if(currentDate.equals(dateFormat.getHours())){
                            if(currentDate.equals(dateFormat.getMinutes())){
                                if(currentDate.equals(dateFormat.getMinutes())){
                                    
                                }
                            }
                        }
                    }
                }
            }
flint coyote
#

you could but it looks horrible πŸ’€

#

just truncate to Seconds and compare

sinful matrix
#

hahaha

sinful matrix
flint coyote
#

they are all deprecated and precision depebds on Operating system

#

depends*

pale hazel
#

You could use a switch statement

flint coyote
#

if(configDate.toInstant().truncatedTo(ChronoUnit.MINUTES).equals(new Date().toInstant().truncatedTo(ChronoUnit.MINUTE) {

#

obviously you can cache the toInstant and truncate part of your config date

remote swallow
#

add them to the command map

ashen bolt
#

Hey, I'm trying to make a custom menu GUI and I thought that it would be a good approach te create a new class "menuItem" that inherits from itemstack and has a function "click()" so that way I can add the logic to the item itself. however, when a player clicks on the item the item turns into a craftItemstack so I'm unable to cast it back to a menuItem. Is there a way to change it back to ItemStack or am I just taking a totally wrong approach?

noble lantern
#

try taking a look into this, it has the similar click() function you want just done slightly differently

remote swallow
#

its because you have to register it to the servers command map, not your own

#

about 4 messages down

noble lantern
#

YOO THE OLD HOMIE VANISHED

next zinc
#

Anyone know if there is a good CooldownManager api or resource I can use to make one for 1.19?

remote swallow
noble lantern
#

you dont extend CommandExecutor for this

Extend BukkitCommand

glossy wren
#

I'm working on a large plugin for my server. Should I switch to Kotlin? It seems better and I want to know before I completely finish the project.

remote swallow
#

using kotlin is personal preference

glossy wren
#

Are there any advantages?

tardy delta
#

i want to yell at you now for all the cursed code we'll see but lets not

remote swallow
#

theres a few things it has java doesnt

glossy wren
#

Ok, ty

remote swallow
#

id say if you know java to a decent extent and can debug stuff without extra help, using kotlin is up to you if you want to use it

noble lantern
#

if your not gonna use kotlin, adding lombok to your project is always a nice thing to do πŸ˜‰

golden turret
#

which event is called when the bone meal is used?

remote swallow
#

dw i dont use kotlin

noble lantern
#

try telling the android developers that

remote swallow
#

you are still making you OWN command map

#

you have to use the internal command map

golden turret
#

not interact

#

it is called for every block

remote swallow
#

you still create

quaint mantle
#

I'm just figuring out how distancing two Locations work

#

So we have distance and distanceSquared

remote swallow
#

just look at how commands are registered internall

#

?stash

undone axleBOT
quaint mantle
#

distance is just root of distanceSquared?

quaint mantle
#

I'm asking because I think I just realized that I will always check if distance is greater than 4

#

So if I just check if distanceSquared is less than 16 then I'm good?

#

Return true?

#

Do you know by any chance how much performance I am saving?

#

I am of course going to use what I just told you, but I am curious why this is not a big thing that people are gossiping about lol

#

Wow this is awesome

#

I am really stupid with math but these type of stuff makes me enjoy it each time more than yesterday

subtle folio
#

anyone know of a maven plugin to put jar overe ftp into plugins folder with built jar?

remote swallow
#

just use winscp

#

keep remove dir up to date

zenith gate
#

is there a way to hide this error?

Failed to save level ./world_vault
java.io.IOException: Permission denied
#

Nevermind i figured it out.

hazy parrot
#

I would fix that error instead of hide it

zenith gate
#

its not to be fixed

#

its intended.

young knoll
#

Something tells me there’s a better way to stop world saving than removing file perms

subtle folio
zenith gate
young knoll
#

Can’t you disable saving of a world

zenith gate
#

auto save yes

#

i have not found a way to disable a world save on shutdown tho

#

best way around it is to unload the world and not to save it in the onDisable

young knoll
#

Are you not doing that

zenith gate
#

I am now. I figured it out a few minutes ago πŸ˜‚

karmic mural
#

I'm trying to figure out what triggers this event... Anyone know? I've gotten the "Place_One" and "Place_all" but not some, so I was just curious what triggers it

noble lantern
#

and visa versa

karmic mural
#

In the end it doesn't really matter, it's mostly a curiosity

noble lantern
#

oh yep that would pick_some but placing it back would just be place one

TBH not sure if you can even move items from the curse into an inventory unless just clicking them into an inventory triggers it?

karmic mural
#

Well, place_one and place_all are both triggered by left click and right click respectively, while holding a stack of items on the cursor

zenith gate
#

I'm kind of confused on what to do. So my plugin works fine on my local server for private testing. When i put it up on a hosted server ( server.pro in this case because its free ) the plugin doesn't work. It says java.lang.NoClassDefFoundError: toast/pine/overhaularmory/Materials/InfusedResources Systems needs the resources from the Armory plugin. the class is there in my local server, but why is it not on the server.pro server?

eternal oxide
#

You don't have the plugin on your server

zenith gate
#

its in there.

eternal oxide
#

NoClassDefFoundError says you don't

zenith gate
#

Well then im lsot

eternal oxide
#

however

zenith gate
#

the file is there

eternal oxide
#

?paste teh full stacktrace error

undone axleBOT
zenith gate
eternal oxide
#

ClassNotFoundException: toast.pine.overhaularmory.Materials.InfusedResources Is your overhaul-system loading too early?

zenith gate
#

omg im just a dumbass that's why

#

i forgot. armory uses the vault api.

#

its missing vault

#

so the plugin is disabled

#

Yeah it works now.

eternal oxide
#

does Overhaul-System require OverhaulArmoury?

#

If so, add a depend to it's plugin.yml

zenith gate
zenith gate
sullen marlin
#

Why not use the hideEntity api

neon nymph
#

Is it possible to store consumers into an item's pdc?

upbeat hornet
#

Hello I spawned an entity using this:

FallingBlock fallingBlock = (FallingBlock) world.spawnEntity(newLoc, EntityType.FALLING_BLOCK);

I want to set custom nbt to it (assign "myKey" to string "myValue")
How would I do that?

This is what I tried:

FallingBlock fallingBlock = (FallingBlock) world.spawnEntity(newLoc, EntityType.FALLING_BLOCK);

CraftEntity craftEntity = (CraftEntity) fallingBlock;
net.minecraft.server.v1_8_R3.Entity nmsEntity = craftEntity.getHandle();
NBTTagCompound entityData = new NBTTagCompound();
nmsEntity.e(entityData);
entityData.setString("key", "value");
nmsEntity.f(entityData);
eternal oxide
#

you could store a reference not the consumer itself

upbeat hornet
#

pretty sure that doesn't exist in 1.8.9

strange rain
#

Oh

#

Ya

#

That’s 1.14 I think

upbeat hornet
#

and the value will only be used 5s after the entity has been spawned and never after

#

so nbt seems the best

strange rain
#

Tried chat gpt yet? Lol

#

Nah I’m clueless

upbeat hornet
#

that's what cht gpt gave me

#

but like it doesnt work

strange rain
#

Sad

#

Probably nbt api somewhere

upbeat hornet
#

also made a post and the guy sent me this:

// Get NMS entity
        // Create new tag
        NBTTagCompound nbt = new NBTTagCompound();
        // Add the tag to entity
        nmsEntity.e(nbt);
        // Set the tag string
        nbt.setString("YourNBTKey", "YourNBTValue");
        // Load the nbt tag
        nmsEntity.f(nbt);

Thanks for skipping the "//Get NMS entity"..

strange rain
#

I think spigot should have a built in nbt api tbh but they probably have their reasons

#

Even with persistent data containers

young knoll
#

You have pdc and you have api methods to access vanilla NBT

#

What more do you need

upbeat hornet
#

block-pdc

young knoll
#

Blocks don’t store NBT data

#

But chunks do, and someone has made a library for that

upbeat hornet
#

block-pdc would be so good
the library should be implemented into base spigot

upbeat hornet
#

before that library we would have to store the list of special blocks in a json file

young knoll
#

Meh, just shade it

upbeat hornet
#

which is so lame

young knoll
#

Nothin wrong with shading

#

It’s not even that big

copper scaffold
#

I have a problem with my PrepareGrindstoneEvent
i want to remove my custom Enchantment i set the name of the enchantment with a lore.
but the problem is that i want to see if one of the two enchantments are applyed or if both are applyed. and want to remove them the problem now is that i have som infos in the lore as attackdamage. and the enchants are applied at the top. Here is my code pls help me...
https://mclo.gs/xzsramb

upbeat hornet
young knoll
#

That’s called pdc

strange rain
#

They are in 1.8

#

.9

upbeat hornet
#

now if I want to store data in my entity I need to make a custom entity that extends the original entity

#

what a hassle

strange rain
#

Can you extend item stacks?

upbeat hornet
#

Spigot lets you add custom nbt to item stacks

#

but only for itemstacks

#

for every other entity you have to create your own

strange rain
eternal oxide
#

do not extend Bukkit classes

strange rain
#

Sad πŸ˜”

strange rain
young knoll
#

If you’re in 1.8 then you gotta use raw NBT

#

Β―_(ツ)_/Β―

strange rain
worldly ingot
eternal oxide
#

NBT-API

strange rain
#

Is there nms docs?

wraith apex
#

wut

river oracle
#

lol no

strange rain
#

^

upbeat hornet
#

also before I start doing something unecessary, here's my problem:
I want to make a shockwave effect. I do this by summoning FallingBlock. But fallingblock grief the map. So I use the EntityChangeBlockEvent to manage it.
The EntityChangeBlockEvent is fired twice, once when the falling sand takes the place of the block and another time when it lands on the ground. First, it replaces the block with air and second it replaces the block with its stored value.
On first event:

  • set the block it just removed to the block the entity has right now.
    On second event:
  • if it lands on the same block it started, do nothing
  • if it lands somewhere else, cancel the event
strange rain
#

Can you make private nms docs for a dev team?

upbeat hornet
#

am I wrong on this

wraith apex
#
Entity e;
PersistentDataContainer dataContainer = e.getPersistentDataContainer();
upbeat hornet
wraith apex
#

ooooh

#

my bad

strange rain
#

I think

river oracle
#

on top of that its constantly changing

#

so you'd have to go back and change all the documentation

river oracle
#

yes

wraith apex
strange rain
#

Why can’t Minecraft just be open source

#

Sigh

wraith apex
#

just saw 'can't do this'

wraith apex
strange rain
river oracle
#

it just lists them

worldly ingot
#

Mappings != Javadocs

upbeat hornet
#

is the uuid of an entity stored in its nbt?

strange rain
#

I can’t imagine tryna NMs when Mojang didn’t have mappings

wraith apex
#

\s

strange rain
#

Who tf could read ovsufated frikin code

wraith apex
#

me

strange rain
upbeat hornet
#

I found
UUIDLeast:-5911143662407502793L
UUIDMost:8266609870279821949L
WorldUUIDMost:6452025998917979960
WorldUUIDLeast:-9093406817116217396L

wraith apex
#

and then from there cross referencing multiple versions of jars

worldly ingot
wraith apex
#

unless it's some unique type

#

and not something common like int's

#

then it's easier to find

#

I did this when working on NPC's

#

it's a pain

#

I only assume the obfuscation is there as a legal defence to prove mojang/ms is protecting their ip

strange rain
#

Could you just write your own severside code with protocols

worldly ingot
#

Yes

wraith apex
#

probably

worldly ingot
#

And people have

strange rain
wraith apex
#

but then rip plugin support

strange rain
#

Oh

#

Minestom

worldly ingot
#

Glowstone as well

#

Among countless others I'm sure

wraith apex
#

unless you made a compatability layer

#

Cuberite

#

is another I think

river oracle
#

I wanna try making my own API for NMS at some point

#

I think it'd be a fun project

wraith apex
#

gl hf

strange rain
river oracle
#

or just a server software from scratch which would be even more painfulo

strange rain
#

😊

river oracle
#

I'm not making docs of NMS i'm not fucking mental

strange rain
#

Sad

#

😭

wraith apex
#

some NMS methods are whack and don't work properly

strange rain
#

Then why do they exsit

#

Isn’t Mojang smart?

wraith apex
#

either orphaned code, deprecated code, or methods are are intermediate and certain conditions need to be met before they're called

strange rain
#

Orphans

#

Right

#

Got it

#

What that mean

wraith apex
#

as in they're just left there

#

but not called by anything

strange rain
#

Who

wraith apex
#

and simply forgotten

strange rain
#

Why

#

When

#

For what

#

That’s the most stupid thing ever

wraith apex
#

it's a big code base idk

worldly ingot
#

Bear in mind that while some methods are left in and uncalled, they may be called on the client

wraith apex
#

^

#

that's true

strange rain
#

I hate orphans!

wraith apex
#

to make development easier, since 1.3 minecraft uses an internal server on single player

#

so you don't have to code sp and mp

strange rain
#

Tbh I have no idea what that means

wraith apex
#

single player uses a localhosted server

young knoll
#

On multiple you connect to a server somewhere

wraith apex
#

just transparent

strange rain
young knoll
#

In single player the game starts a server internally

strange rain
#

Did they not use to

wraith apex
#

nope

strange rain
#

?

#

Oh

wraith apex
#

prior to 1.3 they did not do this

#

single player was single player

#

no servers

#

just you and the world

strange rain
#

Wait so in theory I can install spigot into a single player world?

wraith apex
#

but then you can't talk, there is no chat

#

and no open-to-lan

strange rain
wraith apex
#

idk why you would want to

#

it's a local lan server

young knoll
#

Yes there used to be a lot of inconsistencies

wraith apex
#

^

young knoll
#

That’s why they did the merge

wraith apex
#

it's easier to code 1 architecture than implement the logic for interactions differently on multiplayer vs singleplayer

#

multi you have to send packets

#

single you don't need to

#

this sucks

#

make it all multi player and then you have one consistent architecture for both single and multi player

strange rain
#

Wait does that also mean single player supports can have multiple players…

#

Bruh moment

young knoll
#

Yes

wraith apex
#

the open-to-lan feature allows this

#

so ye

young knoll
#

Open to lan

wraith apex
#

if your players are local it's possible

strange rain
#

It’s not single player the

eternal oxide
#

Its a local server only the localhost can join

strange rain
#

Wait could someone hack your pc and actually put herobrine in your world…

wraith apex
#

no..

#

the server is not port-forwarded

#

it's local only

strange rain
#

I mean ya

wraith apex
#

so no one from the outside world can join

strange rain
#

The hacker has malware on the computer

#

So it can be local

#

Right?

wraith apex
#

which computer?

strange rain
#

My iToaster pro

wraith apex
#

You'd have to open some silly program he embedded with malware first

#

and that malware would have to establish some connection to allow them to tunnel into the network

#

which would probably set off a lot of major red flags to the os

strange rain
#

Bro if I make malware (which I won’t) but if I do that will be a thing

wraith apex
#

unlikley to work

#

os would block it

strange rain
#

I would block os

#

Try me

wraith apex
#

that's not how this works...

strange rain
#

I am one hella dedicated person

wraith apex
#

even if the hacker somehow managed to join your sp local hosted server

#

for what?

#

what would be the benefit

eternal oxide
#

steal your tnt

wraith apex
#

it's easier to spin up a spigot server and port forward

wraith apex
young knoll
#

This is why I used to hide my diamonds even on single player

strange rain
#

Make Minecraft conspirieses

vocal cloud
#

I've had the issue of people using copenheimer to join my private MC server we had to setup security measures

vocal cloud
#

Not nice. They were going to grief us and they started collecting supplies for TNT. We had no backups at the time so it was quite something

wraith apex
#

aye, internet do be the wild west

strange rain
vocal cloud
river oracle
wraith apex
strange rain
wraith apex
#

scans the internet for open minecraft servers

strange rain
#

That’s cringe

#

And lame

wraith apex
#

just by pinging ips

#

it's how they found jeb_

#

and griefed him

strange rain
#

No way

wraith apex
#

lol

young knoll
#

Tis why you don’t have your server port forwarded

strange rain
#

Actually?!

vocal cloud
#

It was a fabric mod. Not the actual jeb

wraith apex
#

oh?

#

Β―_(ツ)_/Β―

vocal cloud
#

Yeah, my server gets monthly or so visits from griefers

wraith apex
#

anyhoo copenheimer will find open minecraft servers

young knoll
#

Im confused

wraith apex
#

usually so people can greif them

young knoll
#

It’s not public

#

But it’s open to the internet?

strange rain
#

What if you don’t port forward how would people know you exist

vocal cloud
#

They don't

strange rain
#

?-?;

strange rain
#

Bruh

#

Oh private sever

#

Okay

wraith apex
#

if you don't port forward you don't exist

vocal cloud
#

Unless you use a mod that has trackers installed

strange rain
#

Fair enough

wraith apex
#

if you port forward then any one can ping you

#

port forwarding is like leaving your front door open

strange rain
#

What is port backwarding then

wraith apex
#

that's not a thing

strange rain
#

Oh just not porting forward

strange rain
young knoll
#

Honestly it’d be fun to port forward my dev server

#

People are free to try and grief it, they can’t possible do more damage then I do to it regularly

strange rain
#

Heh

vocal cloud
#

It took them 2 or so years to find our server

#

Or at least sell the ip

#

Since they do that

strange rain
#

One dev sever I saw literally reset everything when it was restart

wraith apex
strange rain
#

What if we run out of ips

wraith apex
#

we already did

young knoll
#

We’ve been out of IPV4 forever

wraith apex
#

that's why IPV6 exists

vocal cloud
young knoll
#

But people just kinda make it work

strange rain
#

Dang

#

How do you even like claim a ip

#

Does internet provider give it

vocal cloud
#

You used to be able to just ask and they'd give you one

#

Now it's automatic. If you want a static IP good luck

#

$$$

wraith apex
#

depends on if you want static or dynamic

#

static is big mooonie

strange rain
#

Who runs the ip

wraith apex
#

because not many of them exist for sale anymore

strange rain
#

Management

vocal cloud
#

Like everything related to the internet probably ICANN

wraith apex
#

you can probably give yourself a new ip by unplugging your router for 5-10 minutes and plugging it back in

strange rain
#

How do I work for them

wraith apex
#

man wants to steal a static ip lol

vocal cloud
#

Oh it's actually IANA

strange rain
eternal oxide
#

if you release the IP on your router before turning it off, you are pretty much guaranteed to get a new IP after 30 mins

wraith apex
#

^

vocal cloud
#

I've been lucky to have the same IP for 4 or so years

wraith apex
#

or just vpn

strange rain
#

Wait is static IP more dangerous?

wraith apex
#

lol

wraith apex
#

it's in the name

#

it doesn't change

#

it stays the same

strange rain
vocal cloud
#

In the sense that if someone is harrassing you, then yes

wraith apex
#

?

#

^

strange rain
#

It will always been known if leaked

vocal cloud
#

Only so much someone can do to you. Unless you're like me and you host a bunch of services

wraith apex
#

just host services in the data centre

#

and let them deal with it

vocal cloud
#

That costs $$$

wraith apex
#

it does

#

or you can do it yourself

vocal cloud
#

Cheaper to host at home

wraith apex
#

with the risk of someone sending a ddos attack your way

#

or other bad packets

vocal cloud
#

Or you can just CloudFlare

wraith apex
#

ye

#

I'm curious how cloud flare works against a botnet ddos

vocal cloud
#

They give you great protection against it. Although the biggest issue I have is Chinese hackers attempting to guess the password to key-only SSH

strange rain
#

Why is main benifit of static ip

vocal cloud
#

You don't have to worry about the IP changing which means caching and whatnot becomes easier

#

For me, it means my DNS records don't need any software to make sure they point to the right IP

strange rain
#

What if people just stopped managing the internet

wraith apex
#

networking is a rabbit hole of rabbit holes my man

strange rain
#

How chaotic would it become

vocal cloud
#

Someone else would

wraith apex
#

someone is getting paid big moonie to keep the thicc cables running

#

like the transatlantic cable

strange rain
#

Where do they get the money?

vocal cloud
#

A few meters usually

strange rain
#

Oop

#

Phone moment

#

Y’all didn’t play that did you

wraith apex
#

doesn't matter if we did, it will be saved in our discord cache

#

if we had this channel loaded

strange rain
#

Just

wraith apex
#

:p

strange rain
#

Don’t listen to it

#

Sight

wraith apex
#

carful what you post in here heheh

#

delete is not delete

strange rain
#

I didn’t mean to

#

Are

vocal cloud
#

Cached

young knoll
#

It’s the internet

strange rain
#

None of it is my voice anyway

young knoll
#

Delete is never delete

wraith apex
#

^

#

:pog:

#

awww

strange rain
#

I still ask that you don’t play it

#

If you do

#

Oh well

vocal cloud
#

Like that rich kid who assaulted the guy having his Dad spend a fortune to get the video deleted

wraith apex
#

looks in discord cache

strange rain
wraith apex
#

ok lemme find it

strange rain
#

What is a cache anyway like a temporary file path?

#

or stuff stored in a variable

wraith apex
#

cache is an area to store data temporary

#

so you don't need to keep requesting it from the server

#

saves on resources

strange rain
#

Ohh

#

That’s brilliant

wraith apex
#

like loading a webpage

strange rain
#

I love people

wraith apex
#

why bother fetching images again?

#

just save them to a temp file on the users pc

#

ofc eventually the cache will be invalidated and be re-cached if new data is found

strange rain
#

Wait what if I don’t want people to see my cached stuff…

#

…

#

Nvm

#

Conveniently same place to clear search history

vocal cloud
#

You can clear your cache but not others

strange rain
#

@vocal cloud your cool

#

Better than coll

#

Guy

wraith apex
#

Interesting

#

I think audio clips work differently

#

they're only cached if you click on them

#

images are cached if you just see them

#

I still have 24kb of your voice tho :p

quaint mantle
#

Using the NBT api, for some reason setting any NBT data causes the player head to lose its skin

#

        NBTItem headNBT = new NBTItem(playerHead);

        headNBT.setUUID("HeadDrops_Owner", playerUUID);
#

if I comment out the second line, and don't set anything, skin stays. if I set it though, then the skin goes back to default alex/steve skin

eternal oxide
#

why are you using nbt to set a skin? old version?

quaint mantle
#

i'm not using nbt to set the skin just to store a UUID for later use

eternal oxide
#

what spigot version?

quaint mantle
#

1.20.1

eternal oxide
#

then use pdc and it won;t mess with any other data

#

?pdc

cedar pine
#

anyone know why my armorstands are doing this
https://cdn.discordapp.com/attachments/817491459128688661/1119088160752808036/Minecraft_1.19.4_-_Multiplayer_3rd-party_Server_2023-06-15_21-15-24.mp4
Code:

               // Create and customize the armor stand for feedback
                ArmorStand armorStand = (ArmorStand) block.getLocation().getWorld().spawnEntity(block.getLocation().add(0.5, 1, 0.5), EntityType.ARMOR_STAND);
                armorStand.setMarker(true);
                armorStand.setVisible(false);
                armorStand.setGravity(false);
                armorStand.setCustomName(ChatColor.GOLD + "⛏ +" + experience + " Mining XP");
                armorStand.setCustomNameVisible(true);

                // Remove the armor stand after 1 second
                plugin.getServer().getScheduler().runTaskLater(plugin, armorStand::remove, 20);
quaint mantle
quaint mantle
#

thanks

eternal oxide
#

np

minor otter
#

How can I check how fast a certain tool will mine based off material

night yarrow
#

craftPlayer.getHandle().b().a(titlePacket);
Is this correct?

eager girder
#

Whats the best way to make custom blocks? Textures really doesn't have to change since im not really good at making textures, just want to make a fwe things like upgradable furnaces and what not

drowsy helm
#

might as well set all teh attributes before spawniing it

drowsy helm
#

but if not you want to use a tile that can hold nbt

cedar pine
#

Oh, didn’t know that actually mattered

drowsy helm
#

on the clientside it's rendering a regular armourstand, and then waiting a tick for it to update that data

#

if it spawns with the data pre populated it doesnt have to re render

eager girder
#

Whats the best way to do enchants? Is it still lore + pbt?

minor otter
#

Mushroom blocks work too if you dont really want to remove any functionality like noteblocks

eager girder
#

alright

warm light
#

how can I check if mob killed by charged creeper?

sweet sonnet
#

EntityDeathEvent

#

event.getEntity().getKiller().getType()

noble lantern
#

getKiller is a player iirc

warm light
noble lantern
#

i think damage event is fine, just check if targets health =< 0 and then do your stuff there

#

cause you have both target and attacker there

shadow night
#

Don't you have to do <= 0?

warm light
#

is it possible in EntityDeathEvent?

smoky anchor
# cedar pine anyone know why my armorstands are doing this https://cdn.discordapp.com/attach...

doing what exactly ?
If you mean "show for a tick" then just use a Text Display entity (unless you want to support versions > 1.19.4)
other solution would probably be: spawn it somewhere under the world and then teleport it a tick later
or you could try the constructor that takes a supplier (or provider or whatever) and use that to modifiy the armor stand, idk what exactly it changes tho.
Ok just noticed you got an answer already :D

noble lantern
#

i dont think the player ever actually dies when using a totem

slim wigeon
#

Who used this HolographicDisplaysAPI? I trying to use it for my farm rods but I get errors from the console. I see the text is white and not aqua if that means anything

dire bluff
#

hello guys i havea question. i want to add custom craft with custom model data but i cant make custom model data the result of a crafting with custom model datas what to do

sullen marlin
dire bluff
#

doesnt give me the custom model data

smoky anchor
#

datapack recipes do not support NBT

dire bluff
#

so how can i do it

#

any ideas?

smoky anchor
#

weird question but are you developing a spigot plugin ?

dire bluff
#

look

slim wigeon
dire bluff
#

im not that exepirienced but i've made some

noble lantern
#

How can i get this to work WITHOUT sending a message to the console (convert() is a translateAlternateColorCodes call)

#

some rigged ahh shiz

smoky anchor
dire bluff
#

ok ty i will try it

sullen marlin
#

Or just addRecipe with an appropriate recipe

#

No events required

smoky anchor
#

oh you can have nbt output with the bukkit recipes ?

noble lantern
#

they accept ItemStacks so yah

slim wigeon
smoky anchor
eager girder
#

Whats the best way to handle custom enchants right now?

#

All of the stuff I see is from like 2010-2014

#

And I know a lot of stuff has changed with pdc and what not

smoky anchor
#

pdc, events and lore I assume
Unless something changed

smoky anchor
#

?main

eager girder
noble lantern
#

implementing Enchantment is a good first step

#

idk why no tutorials ever go over implementing that class when doing custom enchants

#

makes compat a lot easier for some things

eager girder
#

Alright

noble lantern
#

thats some cringe if i ever heard it

slim wigeon
smoky anchor
noble lantern
#

lore is tricky when you add multiple plugins tbf

#

we had this issue with advanced enchantments a few times when i worked there

noble lantern
smoky anchor
#

nonono
The console does not know how to interpret Β§ as a color, that is a MC thing

noble lantern
#

i stg it used to work

#

through some logger

smoky anchor
#

Β―_(ツ)_/Β―

noble lantern
#

i know it forsure works when you send it as a message to console but meh

smoky anchor
hazy parrot
#

Why do you want to have colors in console lol

#

Please don't do that

smoky anchor
#

let the man have his colors

noble lantern
noble lantern
hazy parrot
#

I mean if you like it it's okay, but it's generally hated in community :3

#

You can send message to ConsoleSender

slim wigeon
hazy parrot
#

That will work with colors

noble lantern
smoky anchor
eager girder
slim wigeon
noble lantern
eager girder
#

Going to

smoky anchor
slim wigeon
eager girder
hazy parrot
eager girder
#

Oh wait does lore contain enchantments?

noble lantern
smoky anchor
eager girder
#

If lore contains enchantments then that should be fine

#

Didn't know that it did

noble lantern
#

enchantments being displayed are an ItemFlag

eager girder
#

Oh

noble lantern
#

apply HIDE_ENCHANT to the ItemStack then you can re-render them in the lore

#

enchantments never get put in the lore

#

theyre put into a list in metadeta

eager girder
#

Got it

slim wigeon
# hazy parrot What

I have seen it but I either route this talk to PMs otherwise the talk must end. Just know the colors is not just the console, its apart of MineCraft. But I wish to not fight about this.

eager girder
#

That makes more sense

slim wigeon
hazy parrot
mild violet
#

Hello everyone
I have a question regarding craftbukkit. I use the follwoing codesnipped, which requires 3 objects from Craftbukkit src files:

ChannelPipeline pipeline = ((CraftPlayer) player).getHandle().c.h.m.pipeline();
            if(pipeline.get(player.getName()) == null)
                pipeline.addBefore("packet_handler",player.getName(),channelDuplexHandler);

c = PlayerConnection, h = NetworkManager and m = Channel
However in the latest Craftbuikkit version (PlayerConnection.java), the NEtworkManager has been set to private and I can't access it.

Does anyone know a workaround to access the NetworkManager, or knows another way to declare th pipeile to the craftplayer?
TY in advance :)

smoky anchor
#

I assume reflection is the way you'd have to go

mild violet
#

I have tried it, with a reflection (from chatgpt πŸ˜‡ ), it ocmpiled, however, when running the plugin on the server, said Code did not have any impact

#
try {
                // Get the handle (EntityPlayer) from the CraftPlayer
                Object entityPlayer = (CraftPlayer) player.getClass().getMethod("getHandle").invoke((CraftPlayer) player);

                // Get the PlayerConnection from the EntityPlayer
                Object playerConnection = entityPlayer.getClass().getField("playerConnection").get(entityPlayer);

                // Get the NetworkManager from the PlayerConnection
                Object networkManager = playerConnection.getClass().getField("networkManager").get(playerConnection);

                // Use reflection to access the private 'pipeline' field in the NetworkManager class
                Field pipelineField = networkManager.getClass().getDeclaredField("pipeline");
                pipelineField.setAccessible(true);

                // Get the current pipeline instance
                ChannelPipeline pipeline = (ChannelPipeline) pipelineField.get(networkManager);

                // Add your custom channelDuplexHandler to the pipeline
                pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);
            } catch (Exception e) {
                e.printStackTrace();
            }
smoky anchor
#

is it throwing an exception ?

mild violet
#

I am not experienced enough in this matter, to be able to verify if this code does, what I want it to

mild violet
smoky anchor
#

well for starters, you can remove the unneeded reflection to parameters you do have access to
I guess you can add several prints to every object (again don't kill me good devs here)
To see how far the code gets

mild violet
#

INFOaperMinecraftFormatting
is the only message, the server responds

mild violet
ocean hollow
#

How can I get Map<String, Object> from config? (to deserialize Object)

agile anvil
#

What part are you struggling? Making the map or deserializing objects?

#

And why using yml files for such a thing

#

Also why having a super class "Object" and not something less abstracted?

smoky anchor
#

Could they possibly be trying to serialize an itemstack ?
I think that is how the serialized object looks like

ocean hollow
#

so I have Board class, that has Tasks

#

I wrote method for serializing

#

but how can I load it?

agile anvil
#

I wouldn't process like that. It could lead to so much difficulties between the map containing a list of map, yml, etc...

What I would do is serialize and deserialize in json: which seems much more intuitive for your kind of work.
Then you could literally save and read your json from a json file

ocean hollow
#

json is harder to work with(

shy rock
#
                pillager.setHealth(pillagerHealth1);
                pillager.setCustomName(ChatColor.GRAY + "Pillager (Level 1)");
                pillager.setCustomNameVisible(true);
                upgradeSkeletonEquipment(pillager, Enchantment.ARROW_DAMAGE, (int) pillagerBowDamage1);
        EntityEquipment equipment = pillager.getEquipment();
        if (equipment != null) {

            equipment.setItemInMainHand(new ItemStack(Material.CROSSBOW));
            equipment.getItemInMainHand().addUnsafeEnchantment(enchantment, pillagerBowDamage1);


            ItemStack bow = new ItemStack(Material.CROSSBOW);
            bow.addUnsafeEnchantment(enchantment, pillagerBowDamage1);
            equipment.setItemInMainHand(bow);
        }
    }```

Anyone knows whats wrong? I want a custom value to be added as enchantment level of the pillager's crossbow
smoky anchor
#

why are you setting the item twice ?
Can you not use item meta instead of unsafe method ?

#

why is the method called "upgradeSkeletonEquipment when you pass Pillager
Why is the ItemStack called bow when the material is Crossbow
Why is there a 1 pillagerBowDamage1 in the argument name

shy rock
smoky anchor
#

*inhales*
this is painful for anyone to read and possibly confusing
I hope you're the only one who will ever see the code.. oh wait
Anyways since you're on 1.14 at least - use itemmeta

var meta = bow.getItemMeta();
meta.setEnchant(...);
bow.setMeta(meta);
equipment.setItem(bow);```
#

or something

noble lantern
noble lantern
#

GSON COMES WITH SPIGOT PEOPLE

#

PSA

smoky anchor
#

wait almost forgot
*exhales*

winged sequoia
#

Anyone know where this is from?

smoky anchor
#

where what is from

winged sequoia
#

This map is given on every death

smoky anchor
winged sequoia
#

oopswrong channel

#

Apologies

mild violet
# smoky anchor well for starters, you can remove the unneeded reflection to parameters you do h...

So i added som debug messages, however it seems, that after the "Enters try and catch", no more messages get sent

 player.sendMessage(ChatColor.GOLD + "Enters Try and Catch: ");
                Object networkManager = ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager").get(((CraftPlayer) player).getHandle().c);
                player.sendMessage(ChatColor.GOLD + "networkManager is: " + networkManager);
                // Use reflection to access the private 'pipeline' field in the NetworkManager class
                Field pipelineField = networkManager.getClass().getDeclaredField("pipeline");
                pipelineField.setAccessible(true);
                player.sendMessage(ChatColor.GOLD + "pipelineField is: " + pipelineField);
                // Get the current pipeline 
                ChannelPipeline pipeline = (ChannelPipeline) pipelineField.get(networkManager);
                //ChannelPipeline pipeline = ((CraftPlayer) player).getHandle().c.get(networkManager).m.pipeline();

                pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);
smoky anchor
#

anyways it is weird that nothing else gets sent and no exception is thrown...

mild violet
#
player.sendMessage(ChatColor.GOLD + "Enters Try and Catch: ");
            Object networkManager = ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager").get(((CraftPlayer) player).getHandle().c);
            player.sendMessage(ChatColor.GOLD + "networkManager is: " + networkManager);
            
            // Use reflection to access the private 'pipeline' field in the NetworkManager class
            Field pipelineField = networkManager.getClass().getDeclaredField("pipeline");
            pipelineField.setAccessible(true);
            player.sendMessage(ChatColor.GOLD + "pipelineField is: " + pipelineField);

            // Get the current pipeline 
            ChannelPipeline pipeline = (ChannelPipeline) pipelineField.get(networkManager);
            pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler); 
smoky anchor
#

try to print

((CraftPlayer) player).getHandle().c.getClass().getField("networkManager")
mild violet
#

kinda hard, cuz sendmessage() does not allow to send "a field"

#

nvm

smoky anchor
#

you just "" + field :D

mild violet
#

I did it as follows and it did not print anything past "try and Catch"

  
  player.sendMessage(ChatColor.GOLD + "Enters Try and Catch: ");
  player.sendMessage(ChatColor.GOLD + ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager").toString());
  Object networkManager = ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager").get(((CraftPlayer) player).getHandle().c);
  player.sendMessage(ChatColor.GOLD + "networkManager is: " + networkManager);
smoky anchor
#

ye don't use .toString() here, I'm trying to see if it is null
just do sendMessage(ChatColor.GOLD + "" + ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager"));

mild violet
#

ah oke

#

same result tho

#

can't send screenshots in here, right?

smoky anchor
#

unless you verify, no

#

but wait

#

?screen

#

?screenshot

#

?image

#

ok nvm idk the commands here

#

?img

undone axleBOT
smoky anchor
#

ah!

subtle folio
mild violet
#

I'll quickly verify :)

mild violet
#

there we go :)

smoky anchor
#

ok now look into the console and send a picture from there
Starting with the Enters Try and Catch

mild violet
#

it does not print anything to the console yet, should I?

smoky anchor
#

? ? ?

#

oh right

subtle folio
smoky anchor
subtle folio
#

or Bukkit.getLogger().info()

#

which is the proper way πŸ˜›

smoky anchor
#

who cares, this is debugging, a lawless territory

mild violet
#

🀣

smoky anchor
mild violet
#

and giving it the : ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager"))?

smoky anchor
#

just change all player.sendMessage to Bukkit.broadcastMessage

mild violet
#

oh I see

rough drift
#

I am debugging the spigot server and I get things like net.minecraft.server.level.ChunkProviderServer.d() which intellij can't navigate to, is there a way to get these sources somehow?

subtle folio
smoky anchor
mild violet
#
player.sendMessage(ChatColor.GOLD + "Enters Try and Catch: ");
Bukkit.broadcastMessage(ChatColor.GOLD + "" + ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager"));
Object networkManager = ((CraftPlayer) player).getHandle().c.getClass().getField("networkManager").get(((CraftPlayer) player).getHandle().c);
Bukkit.broadcastMessage(ChatColor.GOLD + "networkManager is: " + networkManager);

// Use reflection to access the private 'pipeline' field in the NetworkManager class
Field pipelineField = networkManager.getClass().getDeclaredField("pipeline");
pipelineField.setAccessible(true);
Bukkit.broadcastMessage(ChatColor.GOLD + "pipelineField is: " + pipelineField);

// Get the current pipeline 
ChannelPipeline pipeline = (ChannelPipeline) pipelineField.get(networkManager);
pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);
#

gave the same output, nothing in the console

smoky anchor
#

there can not be "nothing"

subtle folio
shy rock
#
        ItemStack crossbow = new ItemStack(Material.CROSSBOW);

        // Apply enchantments based on the pillager's level
        switch (level) {
            case 1:
                crossbow.addEnchantment(Enchantment.ARROW_DAMAGE, 5);
                break;
            case 2:
                crossbow.addEnchantment(Enchantment.ARROW_DAMAGE, pillagerBowDamage2);
                break;
            case 3:
                crossbow.addEnchantment(Enchantment.ARROW_DAMAGE, pillagerBowDamage3);
                break;
            default:
                break;
        }
        return crossbow;
    }
        // Adjust skeleton attributes based on the level
        switch (level) {
            case 1:
                // Level 1 attributes
                pillager.setMaxHealth(pillagerHealth1);
                pillager.setHealth(pillagerHealth1);
                pillager.setCustomName(ChatColor.GRAY + "Pillager (Level 1)");
                pillager.setCustomNameVisible(true);
                // Set level 1 crossbow
                ItemStack crossbowLevel1 = createCrossbow(1);
                pillager.getEquipment().setItemInMainHand(crossbowLevel1);

                break;```
anybody knows why the crossbow is not getting enchated?
smoky anchor
#

As I said before... Have you tried to use the item meta instead ?

shy rock
smoky anchor
#

? ? ?

#

you want to change the item

#

how in the fuck would meta not work here

mild violet
smoky anchor
#

aight, what is wrong with your console

#

how are you running the server

mild violet
#

I made a start.bat file, which runs the purpur jar form the console

drowsy helm
#

purpur

smoky anchor
#

what the fuck is purpur

drowsy helm
#

lol

mild violet
#

(windows cmd)

drowsy helm
#

ask the pupur discord

subtle folio
#

?whereami

smoky anchor
#

?whereami

smoky anchor
#

HAHA

subtle folio
#

beat you

smoky anchor
subtle folio
#

yaaah

mild violet
#

but its not a purpur issue πŸ˜‚

subtle folio
#

but purpur server

drowsy helm
#

how are you so sure?

chrome beacon
mild violet
#

craftbukkit, form buildtools, made NetworkManager private, in the previous versions it was public... this borks my code...

subtle folio
smoky anchor
#

the console output being fucked is most likely 'cause you're using off-brand spigot :D
I am like 99% sure you're getting an error but not seeing it

drowsy helm
#

use reflection

smoky anchor
#

you can try putting Bukkit.broadcastMessage() in the catch section

smoky anchor
#

I don't know these spigot forks, what are the benefits of purpur ?

drowsy helm
#

purpur is pretty popular

smoky anchor
#

not a benefit

mild violet
#

the thing is, I am testing a plugin on my own defualt purpur server, cuz the server I play on, is on purpur

smoky anchor
#

but you're writing a spigot plugin ?

drowsy helm
#

google

smoky anchor
mild violet
onyx fjord
#

plugins dont use craftbukkit

#

craftbukkit is the server

shy rock
mild violet
#

technically a genious wrote it a few years ago, and I am updateing it and understand it to a certain point... but i am no master in spigot and nms at all

smoky anchor
#

just use a fricking spigot server so you can actually see the errors in the console
then report back :D

mild violet
#

oke, will set one up

smoky anchor
subtle folio
#

@chrome beacon fixed ty babe you da greatest