#help-development

1 messages ¡ Page 1352 of 1

deft sedge
#

ill show you where it gets it from

young knoll
#

Player jump event will never be reliable

#

Sadly

quaint mantle
#

mine seems to be completely reliable

eternal night
#

Isn't there a paper implementation for this event

quaint mantle
#

I have tried to break it in every way I can

deft sedge
#

@quaint mantle This is the string that it gets location from

rugged topaz
#

horrendous

young knoll
#

Depends how you detect it

quaint mantle
#

bruh you have the whole Location saved

#

why are you replacing string

deft sedge
#

ohhh

#

omg

young knoll
#

I find the best method is using the StatisticIncrementEvent

deft sedge
#

so I should just do the x y and z

#

f

#

ok

quaint mantle
#

what

deft sedge
#

should I just save x y and z?

quaint mantle
#

Location location = config.get(akfaskl;fkasldkadk)

#

you literally have the entire location saved

deft sedge
#

I know

#

but the problem is

#

it's in string form

#

and the thing screams at me

eternal night
#

Isn't location by nature config serializable

deft sedge
#

becaue I cant' teleport someone to something that isn't a location

south onyx
#

@rugged topaz sry for the ping, but im getting a massive error in my playermove event, that i didnt have before

#

here it is

quaint mantle
#

YOU literally have the location saved

deft sedge
#

so that code that i showed u is supposed to make it into a location

south onyx
#

oh wait

#

its not there anymore

silent vigil
#

@quaint mantle what did I do wrong?

quaint mantle
#

yes you can

south onyx
#

lemme try the plugin and illt ell u if its there

young knoll
#

It is indeed config serializable

quaint mantle
#

My guy is splitting string when he has the entire Location saved

rugged topaz
quaint mantle
#

^

silent vigil
#

tysm

deft sedge
#

@quaint mantle I am trying to get location values from a book. But to put them in a book I have to use a string. to get the data out of said book I have to convert it back to location. I can't save location data to a book if it's not in the form of a string

cerulean jasper
#

Does every class get executed when plugin is running? 🤔

I am trying to figure out how to call my object declarations etc.. if that makes sense

south onyx
#

yanlol that was the error

#

right when i moved on the server i got like 50 of the same errors like that

young knoll
#

I mean, the classes that are used get executed

#

It won't just magically execute classes if you don't interact with them somehow

silent vigil
#

@rugged topaz should i do it?

cerulean jasper
#

How do I use a class on plugin launch?

opal sluice
#

Well, I don't see any scheduler so it will be hard to know why it does send it every 30 seconds instead of 60

rugged topaz
somber hull
quaint mantle
young knoll
quaint mantle
#

@silent vigil

#

figure it out

somber hull
rugged topaz
#

there's also a version for a name @silent vigil jus so u know

silent vigil
somber hull
#

It does run every 30 seconds

young knoll
#

(The name one is blocking)

silent vigil
#

i got it

opal sluice
somber hull
#

Yes so every 30 seconds it checks

#

But if you read what i sent earlier

#

It should update a cooldown of one minute

#

and check if that cooldown is up

opal sluice
#

Well first of all

#

you need to get long

#

and not int (from your config)

#

since it's a TimeMillis

somber hull
#

wait theres no . in that is thwere?

opal sluice
#

I don't think that the whole value fit in an int

quaint mantle
#

arent your symbols turned around

#

nextBossspawn is always gonna be bigguer than the current time

somber hull
#

o

opal sluice
#

not if the nextBossSpawn is already set

quaint mantle
#

because it's a future time

opal sluice
#

if it's set then it shouldn't set it again to an other bigger value

quaint mantle
#

what

opal sluice
#

if(!plugin.data.getConfig().contains("nextbossspawn")) {
plugin.data.getConfig().set("nextbossspawn", System.currentTimeMillis() + (plugin.getConfig().getInt("secondsuntilspawn") * 1000));

        return;
    }
somber hull
#

i changed it to long

#

testing rn

#

holy fuck

#

thanks

#

that fixed it

opal sluice
#

Nailed it 😉

patent bloom
#

this gives me a list of online players right?

young knoll
#

I mean

#

yes

#

Pretty sure you can just declare it as a list

eternal night
#

new ArrayList(getOnlinePlayers()) would also work xd

#

Saves you a stream allocation

#

Those things aren't the fastes java invention yet

patent bloom
#

ooh i see

quaint mantle
#

Hello! Okay so I'm working on a countdown thing right, yeah, here it is: https://pastebin.com/bu6gdf8K I do know that its not the most efficient thing in the world but it somewhat works, I just got one problem. The first countdown that runs when the state is IN_LOBBY works fine, but the countdowns for the two other states don't work as the first one. The two others count down 2 and 2 / not every 20 tick. Is anyone able to help me out here?

patent bloom
#

has anyone been able to get the nice names of advancements? (eg. Isn't It Iron Pick or The Parrots and the Bats) if so, can someone point towards the right direction of capturing those nice ones? i can only grab the namespace

arctic summit
#

?paste

queen dragonBOT
arctic summit
#

this code doesnt work, can someone tell me why

vocal cloud
#

What doesn't work?

arctic summit
#

it doesnt detect blocks breaking

#

theres no console log output

#

and nothing happens in game

eternal night
#

Did you go down the usual check list ? registered listener, @EventHandler annotation

limber dust
#

checking that the event actually fires ^^

deft sedge
#

Please @ me if responding 😄

lost matrix
sullen marlin
#

Lots of issues with that code

deft sedge
#

ok

#

Can you tell me them?

sullen marlin
#

Different spacing, pitch missing :, no accounting for newlines

deft sedge
#

if you have time

drowsy helm
#

are you trying to print out a location because you can do that in one function

sullen marlin
#

Not running spigot

deft sedge
#

i am running spigot

#

and I'm trying to get the location froma string and then teleport the player to said location

sullen marlin
#

The stack trace you posted says otherwise

deft sedge
#

ok

#

so what changes should I make?

#

I am kinda new to this

#

basically it's supposed to get those cords from that book and teleport the player there

lost matrix
#

Then each line has to be parsed separately.

deft sedge
#

ok can you walk me through how to split the content

lost matrix
deft sedge
#

yea

#

well I know how i store it

#

is there a way to just get the specific lines and store them to vars

#

bc that seems eiser to me

#

bc I know the line numbers and what they correspond to

lost matrix
#

No. You get the page as one String. Then you split this String at '\n' which results in a String[]

deft sedge
#

ok

#

so there isn't a way to do what I just said?

lost matrix
#

Doesnt get much simpler than that

deft sedge
#

ok

#

ill do some testing

#

mind if i mention you for more questions?

lost matrix
#

sure... but just ask here and someone will answer eventually

deft sedge
#

ok

#

thx

quaint mantle
#

Hey, I want to cast Block to Jigsaw after checking that the block is a jigsaw block, but its not letting me cast it (throws a cast error), how can I get my Jigsaw block? Please ping on response

lost matrix
quaint mantle
#

so i cast the blockstate to jigsaw?

#

ok

#

cool

#

thx

deft sedge
#

@lost matrix I split it up by \nl and it works, but then how do I get just one of those lines. For example if I only wanted line 1 and there is 6 lines

deft sedge
#

thx

compact haven
#

it

#
  1. learn java
#
  1. selector operator of array
#

arr[element]

somber hull
#

super(EntityTypes.ZOMBIE, ((CraftWorld) loc.getWorld()).getHandle());
zombie doesnt like being there
It says it cannot be ZOMBIE cannot be resolved or is not a field

cinder thistle
#

Conclure slow

somber hull
#

If anyone know how to use 1.12 nms please dm me im confused

rugged topaz
#

how do you set the minimum amount of blocks in order to take fall damage?

cinder thistle
#

meant to jokingly ping him @ivory sleet slow

cinder thistle
limber dust
#

doesn't minecraft handle fall damage by velocity not techically blocks?

cinder thistle
#

Not in that order

#

Probably

young knoll
#

It’s blocks

rugged topaz
#

"Check how far they fell" the difficult part

young knoll
#

Listen for the damage event and get the fall distance

cinder thistle
#

Google is useful

#

Generally gives results for that stuff

rugged topaz
#

i'm aware lmao

#

google suggests to use player#setFallDistance or some other stuff

#

which doesn't work

young knoll
#

It does

rugged topaz
#

not for me

#

is it meant to be -50 blocks or 50 blocks

#

as a parameter

young knoll
#

It sets how many blocks they have fallen

#

So setting it to 0 will make them take no damage

#

Setting it to 1000 will make a big splat

rugged topaz
#

oh so it doesn't even

#

it's bait

young knoll
#

It sets the fall distance

rugged topaz
#

doesn't actually change the amount of blocks needed to take dmg

#

but

#

damage

mystic lion
rugged topaz
#

fall damage

young knoll
#

If you want to change that, just use the damage event and some simple subtraction

rugged topaz
#

i'd want it to be by default 20 blocks, before the user takes damage instead of the default minecraft 3 or so

#

yah

#

i need help w that

somber hull
#

but i can try

young knoll
#

I’m pretty sure you can just subtract 17 damage then

#

And if it’s <0 cancel it

somber hull
#

Wait can someone point me to a good place to learn NMS

young knoll
#

Decompiler

rugged topaz
#

20 blocks in order to begin fall damage, instead of 3 to begin fall damage

young knoll
#

Correct

#

Subtract it from the damage

rugged topaz
#

? one of u r telling me to subtract 17 from the fall distance and then the other from the damage

#

which

young knoll
#

If they fall 25 blocks they normally take 22 damage, subtract 17 and they will take 5

rugged topaz
#

and to know if the player's falling?

young knoll
#

Of course you may have to manually account for feather falling

rugged topaz
#

playermoveevent?

young knoll
#

Use the damage event

rugged topaz
#

from -> to?

#

o

young knoll
#

You can get the fall distance and the damage in that event

#

And do all the maths you want

rugged topaz
#

how to get fall distance

#

since dmg event

#

not fall event

#

i'd need to tell it somehow i'm looking for fall related stuff

#

player#getFallDistance()?

rugged topaz
young knoll
#

You could set the health directly to ignore the armor, and then use setLastDamageCause

#

And call the damage event manually

deft sedge
#

Does anyone know how to scan player inventory for an item

young knoll
#

Just use a simple for loop over Inventory.getContents

deft sedge
#

ok

#

my problem is taht I did that but now I can't get the variable that has the item out of the for loop

#

Does anyone know how to do that

quaint mantle
#

any reason why player.getWorld().setStorm(true); does not work🤨

young knoll
#

You need to set the rain too

quaint mantle
deft sedge
#

@young knoll I can't get the variable that has the item out of the for loop

rugged topaz
#

@young knoll ```java
@EventHandler
public void onPlayerFall(EntityDamageEvent e) {
if (e.getEntity() instanceof Player) {
Player p = (Player) e.getEntity();
EntityDamageEvent damageCause = p.getLastDamageCause();
if (damageCause.getCause() == EntityDamageEvent.DamageCause.FALL) {
if (p.getFallDistance() >= 10) {
e.setDamage(e.getFinalDamage() - 10);
} else {
e.setCancelled(true);
}
}
}
}

this should work yea?
young knoll
#

setWeatherDuration I believe

deft sedge
#

in the for loop i stored the item it finds ina variable

young knoll
#

Mhm

deft sedge
#

now I can't get that variable out of the for loop

#

ill show code if it helps

young knoll
#

Declare the variable outside the loop

#

And assign it inside

deft sedge
#

ok

#

thx

#

so it is underlined int red

#

I declared it outside @young knoll

young knoll
#

Not quite

deft sedge
#

?

#

It wants me to put square brackets after itemstack

young knoll
#

That’s called an array

deft sedge
#

but if i do that then something else gets mad

#

yea

young knoll
#

Bukkit.getPluginManager.callEvent

deft sedge
#

If I make it an array 2 other things get mad at me

young knoll
#
ItemStack target = null;
for(ItemStack item : inv.getContents) {
    //if statements and what not
    target = item;
    break;
}

if (target != null) 
//doStuff
#

Or you can modify the item directly inside the loop if you don’t need it after

wise mesa
#

here and to better explain what Coll is saying

#

if you have the brackets afterwards you have an array

deft sedge
#

yea ik that

wise mesa
#

an array is kind of like a list of objects

deft sedge
#

yea

wise mesa
#

so you can't just access it like one object

deft sedge
#

thx for clarification

wise mesa
#

but the for loop that coll posted will loop through each object in the array

deft sedge
#

Thx coll

#

@young knoll ANOTHER PROBLEM yayyyyy

#

I did what I think u did

#

if i did it wrong pls tell me

young knoll
#

You declared target as ItemStack[]

#

Which is an array

deft sedge
#

f

#

k it works thx

#

@young knoll how would I check if they have a specific item. I want to detect if they have a written book

young knoll
#

If it’s any written book just compare material

woeful moon
#

Hey, has anyone here ever used placeholderapi in their plugin? I followed the steps on their wiki but it didn't seem to work

topaz atlas
#

How can you set a players max rendering distance?

#

I need to lower it

young knoll
#

It’s per world

#

Not per player

#

You can set the server view distance, but you have no control over the players

deft sedge
#

k

drowsy helm
#

the highest player render distance is the highest server render dist

young knoll
#

Kind of

#

The client will keep chunks past that in memory, but they won’t be updated

north niche
#

where i need to upload the picture of my query?

drowsy helm
#

what query

#

if you want to upload images you need to verify your account

quaint mantle
#

inb4

#

?services

queen dragonBOT
topaz atlas
#

How to change server distance?

#

Its so the server does not get laggy

quaint mantle
north niche
#

how to find if a player placed an item or clicked in the player's crafting slot"that 4 block in player's inventory!"! i used this

public void onInventoryClick(InventoryClickEvent e) {
        if(e.getSlot() == 4){e.setCancelled(true);}
}
```but the crafting table slot numbers are `1,2,3,4` and the player's inventory slot numbers also starts with `0,1,2,3,4...`.now how I find if the player clicked on the crafting slots?
young knoll
#

Did you try using the raw slot

young knoll
north niche
candid galleon
#

anyone here familiar with uploading to maven central? im running into some issues

north niche
deft geode
#

So i have this code for a bossbar:

BossBar celebrationBar = getServer().createBossBar("Easter Event!", BarColor.PINK, BarStyle.SEGMENTED_10);
        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                if(celebrationBar.getProgress() == 1.0) {
                    celebrationBar.setProgress(0.0);
                }
                celebrationBar.setProgress(celebrationBar.getProgress() + 0.1);
            }
        }, 0L, 10L);

And I'm wondering if there's a way to make it visible to all players?

deft geode
drowsy helm
#

max the value

#

or constrainToRange

deft geode
drowsy helm
#

As the trace says, progress must be between 0 and 1

#

so constrain it between those two numbers

deft geode
sage swift
#

use Math.min(1.0, celebrationBar.getProgress() + 0.1)

#

to ensure it doesn't go above

#

double/float is not exact so if it is even slightly over after adding as seen in the error, it will cause problems so you need to set a limit

deft geode
# sage swift use `Math.min(1.0, celebrationBar.getProgress() + 0.1)`
        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                if(celebrationBar.getProgress() == 1.0) {
                    celebrationBar.setProgress(0.0);
                }
                celebrationBar.setProgress(Math.min(1.0, celebrationBar.getProgress() + 0.1));
            }
        }, 0L, 10L);
```\
sage swift
#

i'd also use >= 1.0 instead of == 1.0, just in case

deft geode
#

kk

deft geode
#

i know that addPlayer exsists, but something like addAllPlayers or do I have to loop through

sage swift
#

hell if i know

deft geode
#

No i just did it so it adds it to players when they join

#

that should be fine

quaint mantle
#

Hey does anybody know an alternative to saveResource("file.yml", false)in BungeeCord?

wet breach
#

@quaint mantle why do you need an alternative?

quaint mantle
#

because saveResource is in spigot but not in BungeeCord but i finded the code.

wet breach
#

There is alternatives to it. The method in spigot is just a convenience method for doing such things.

#

but cool you found your answer

quaint mantle
#

yeah, thank you btw

quaint mantle
#

Hey could somebody help me with Bungee Plugin Message?

ivory sleet
#

?ask

queen dragonBOT
#

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.

quaint mantle
#

what?

#

oh okay

quaint mantle
#

Hello! Okay so I'm working on a countdown thing right, yeah, here it is: https://pastebin.com/bu6gdf8K I do know that its not the most efficient thing in the world but it somewhat works, I just got one problem. The first countdown that runs when the state is IN_LOBBY works fine, but the countdowns for the two other states don't work as the first one. The two others count down 2 and 2 / not every 20 tick. Is anyone able to help me out here?

#

How do parameters in playing a sound work?

#

@quaint mantle look at the java doc

#

Oh God not that again

#

type in “playSound javadoc spigot” on google and itll pop up

#

@quaint mantle not sure what you’re trying to explain, can u explain what ur end goal is?

quaint mantle
quaint mantle
#

so the other countdowns go down by 2, but you want 1?

#

yes

#

it’s hard to tell what the problem is cus theres referenced code i can’t see

#

like the GameSystem class

#

honestly if i were u i’d start over and implement a state machine

#

itd make everything easier to manage and debug

quaint mantle
#

In which way do I use playSound?

#

anyway your problem is that you’re calling a new Timer within the timer by calling lootPhaseStart

#

and since you’re variables are static, they are being accessed simultaneously and being decremented by multiple timer classes

#

oh yeah it was, I'm so sorry for not seeing that

#

@quaint mantle get a player instance and use playSound

#

Well I dont know how

#

why does it have to be world.playSoung(something something..)

#

why not player.playSound?

#

it can

#

it can be both

#

Ok, and when would a sound list or something show up

#

look at the sound enum

lost matrix
#

The world method plays to every player nearby.
The Player method plays that sound to only one specific player.

ancient plank
#

^

quaint mantle
#

oooooooooh

#

and I have to define Location location = p.getLocation();

lost matrix
#

Thats the location a sound is played at.
If the sound is in mono format then the sound will be calculated regarding distance and volume. If its stereo then it will be streamed independent from its play location.

quaint mantle
#

k

#

Hey just wanted to ask how do i specify subchannel?

#
ByteArrayDataOutput output = ByteStreams.newDataOutput();
        output.writeUTF(player.getName());

        player.sendPluginMessage(this, "BungeeCord", output.toByteArray());
        getLogger().info("sent");
eternal night
#

The wiki even shows an example of a sub channel

#

You basically write it as a simple string to the buffer

#

And then consume it on the other end

quaint mantle
#

i tried but nothing works

#

like it works but everytime i send it kicks me for this

#

[AuthToolsBungee] BungeeCord
12:46:35 [WARNING] [P4vlyi] <-> DownstreamBridge <-> [lobby] - EOFException: null
12:46:35 [INFO] [P4vlyi] disconnected with: EOFException : null @ java.io.DataInputStream:-1

eternal oxide
#

You are trying to read froma null stream

#

or an empty stream and you are not check it for data first

quaint mantle
#

okayy

eternal oxide
#

show me some code (I only just got up)

#

Unless this is something to do with offline UUIDs

quaint mantle
#

nah its not offline uuid

#
private void sendBungeeCordMessage(Player player) {
        ByteArrayDataOutput output = ByteStreams.newDataOutput();
        output.writeUTF("Forward");
        output.writeUTF(player.getName());
        output.writeUTF("AuthToolsBungee");

        player.sendPluginMessage(this, "BungeeCord", output.toByteArray());
        getLogger().info("sent");
    }

#
@EventHandler
    public void onPluginMessage(PluginMessageEvent e) {
        if (e.isCancelled())
            return;

        // Check if the message is for a server (ignore client messages)
        if (!e.getTag().equals("BungeeCord"))
            return;
        // Check if a player is not trying to send us a fake message
        if (!(e.getSender() instanceof Server))
            return;

        // Read the plugin message
        ByteArrayDataInput in = ByteStreams.newDataInput(e.getData());

        // Accept only broadcasts
        if (!in.readUTF().equals("Forward"))
            return;

        in.readUTF(); // Skip ONLINE/ALL parameter
        
        // Let's check the subchannel
        if (!in.readUTF().equals("AuthToolsBungee"))
            return;

        // Read data byte array
        // final short dataLength = in.readShort();
        // final byte[] dataBytes = new byte[dataLength];
        // in.readFully(dataBytes);
        // ByteArrayDataInput dataIn = ByteStreams.newDataInput(dataBytes);
        //
        // // For now that's the only type of message the server is able to receive
        // String type = dataIn.readUTF();
        //
        // instance.log("got message " + in.readUTF());
        // instance.getAuthLocked().remove(in.readUTF());

        instance.log("receivedk");
        ByteArrayDataInput byteArray = ByteStreams.newDataInput(e.getData());
        instance.log(byteArray.readUTF());
    }
eternal oxide
#

could you use paste please

quaint mantle
#

yeah im new to the plugin message thingy

#

like only paste it?

eternal oxide
#

?paste

queen dragonBOT
quaint mantle
#

oh okay

eternal oxide
#

its too small in here to read easily, and not static as it scrolls

quaint mantle
eternal oxide
#

as you are getting kicked I'm going to assume you correctly registered your receiving event.

eternal night
#

pretty sure you don't get to read Forward at all. BungeeCord consumes it

eternal oxide
#

correct, Forward shoudl be auto consumed

quaint mantle
#

i did register it

eternal night
#

neither do you read ONLINE/ALL

#

also consumed

quaint mantle
#

i do read it?

eternal night
#

but you shouldn't

quaint mantle
#

oh idk

#

i looked into authme bungee thing

eternal oxide
#

that why you are erroring, you are reading things that are not there

#

well you need to only read once

quaint mantle
#

oh

eternal night
#

Forward and ALL/ONLINE are bungeecord values that you have to specify when you send the message but that are read by bungee

eternal oxide
#

line 17 20 and 21 are all reading

#

you shoudl be reading once in a while loop that checks for data

quaint mantle
#

so i just need to remove this?

// Accept only broadcasts
        if (!in.readUTF().equals("Forward"))
            return;

        in.readUTF(); // Skip ONLINE/ALL parameter
        
eternal oxide
#

every time you call in.reafUTF it tries to pull new data

quaint mantle
#

okay

eternal oxide
#

that won;t fix it, properly. sec

quaint mantle
#

its not kicking me

#

but its not doing anything it should

eternal night
#

you are also not specifying ALL/ONLINE at all are you ?

quaint mantle
#

im doing this when im sending it

#
private void sendBungeeCordMessage(Player player) {
        ByteArrayDataOutput output = ByteStreams.newDataOutput();
        output.writeUTF("Forward");
        output.writeUTF(player.getName());
        output.writeUTF("AuthToolsBungee");

        player.sendPluginMessage(this, "BungeeCord", output.toByteArray());
        getLogger().info("sent");
    }
eternal night
#

yes but player.getName() makes no sense or am I tripping

#

like forward forwards the message to other servers

quaint mantle
#

no it does i need the player name

eternal oxide
eternal night
#

I don't see the player name in the example on the wiki

quaint mantle
#

i need to get the an player name to the proxy server only

eternal night
#

there is ForwardToPlayer

#

which does take the player name as its second argument

#

but Forward, as per documentation, takes either ALL or ONLINE as second argument

quaint mantle
#

what is ALL or ONLINE

eternal night
#

well first argument

#

read the docs lol

quaint mantle
#

oh okay

#

I made a server , my friends can join and play normally but if I join, blocks dont drop, mobs stand still , it times me out then my wifi crashes, possible fixes?

eternal oxide
#

Are you a plugin dev?

quaint mantle
#

no

eternal oxide
quaint mantle
#

oh ok thanks

eternal oxide
#

np

quaint mantle
#

the receiving doesnt work now @eternal night

#

it just says it has sented on spgiot side but bungeecord doesnt do anything with it

#
@EventHandler
    public void onPluginMessage(PluginMessageEvent e) {
        if (e.isCancelled())
            return;

        // Check if the message is for a server (ignore client messages)
        if (!e.getTag().equals("BungeeCord"))
            return;

        // Check if a player is not trying to send us a fake message
        if (!(e.getSender() instanceof Server))
            return;

        // Read the plugin message
        ByteArrayDataInput in = ByteStreams.newDataInput(e.getData());

        // Let's check the subchannel
        if (!in.readUTF().equals("AuthToolsBungee"))
            return;

        String subChannel = in.readUTF();
        short len = in.readShort();
        byte[] msgbytes = new byte[len];
        in.readFully(msgbytes);

        DataInputStream msgin = new DataInputStream(new ByteArrayInputStream(msgbytes));
        try {
            String somedata = msgin.readUTF();
            instance.log(somedata);
        } catch (IOException ex) {
            ex.printStackTrace();
        }

        instance.log("receivedk");
        ByteArrayDataInput byteArray = ByteStreams.newDataInput(e.getData());
        instance.log(byteArray.readUTF());
    }
#

this is bungeecord side

#

and this is spigot side

private void sendBungeeCordMessage(Player player) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        ByteArrayOutputStream msgbytes = new ByteArrayOutputStream();
        DataOutputStream msgout = new DataOutputStream(msgbytes);

        out.writeUTF("Forward"); // So BungeeCord knows to forward it
        out.writeUTF("ALL");
        out.writeUTF("AuthToolsBungee"); // The channel name to check if this your data

        try {
            msgout.writeUTF(player.getName());
            msgout.writeShort(0);
        } catch (IOException exception) {
            exception.printStackTrace();
        }

        out.writeShort(msgbytes.toByteArray().length);
        out.write(msgbytes.toByteArray());

        player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
        getLogger().info("sent");
    }
eternal oxide
#

I've never had it work with the "BungeeCord" channel. At some point I believe they added a delimiter requirement so "bungeecord:channel"

quaint mantle
#

i just found out it works but when i try to check for the subchannel with in.readUTF() it returns FORWARD instead of AuthToolsBungee

eternal night
#

hmmm

#

I guess if you are reading on bungee cord side

#

it hasn't consumed it yet ?

quaint mantle
#

idk

#

should i try the channels?

eternal oxide
#

Thats because its Forward not FORWARD

quaint mantle
#

oh sorry writed it in caps lock it returns Forward only

eternal oxide
#

it shoudl be consumed

quaint mantle
#

out.writeUTF("Forward"); // So BungeeCord knows to forward it
out.writeUTF("ALL");
out.writeUTF("AuthToolsBungee"); // The channel name to check if this your data

eternal oxide
#

ah ok

quaint mantle
#

this is what i send

eternal oxide
#

Not sure what to tell you, that shoudl not be happening

quaint mantle
#

yea

eternal oxide
#

have you tried simply doing nothing in the event and see if it gets relayed?

eternal night
#

The javadocs, in true spigot fashion, also don't specify anything about the point at which this event is called

eternal oxide
#

btw you need two servers and two players to test this properly

quaint mantle
#

i have only one server

drowsy helm
#

wot

quaint mantle
#

like one spigot one bungee

eternal oxide
#

Forward sends to every server EXCEPT the sending one

eternal night
#

But the event would still be called

eternal oxide
#

yes

eternal night
#

even if there is no server applicable as a target

#

so like /shrug

quaint mantle
#

but how do i send plugin message to only a PROXY

eternal oxide
#

I'm wondering if thats why its not being correctly consumed. There is no server to send to

quaint mantle
#

i want to send it to proxy not a spigot server

eternal night
#

I mean I guess it isn't consumed because you could just not use any of the bungee cord sub channels like Forward or whatnot

#

and bungeecords logic where it parses Forward + arguments comes after that

eternal oxide
#

Yep, use anthing that is not a preset value

quaint mantle
#

so how do i like send it to only a proxy

eternal night
#

You could basically just write out.writeUTF("MyChannel") and out.write(myData)

#

and then read that on the bungee side

eternal oxide
#

out.writeUTF("ToProxy"); instead of Forward.

#

or any name you want so its not auto consumed

eternal night
#

^ tru

quaint mantle
#
ByteArrayDataOutput out = ByteStreams.newDataOutput();
        ByteArrayOutputStream msgbytes = new ByteArrayOutputStream();
        DataOutputStream msgout = new DataOutputStream(msgbytes);

        out.writeUTF("ToProxy"); // So BungeeCord knows to forward it
        out.writeUTF("AuthToolsBungee"); // The channel name to check if this your data

        try {
            msgout.writeUTF(player.getName());
            msgout.writeShort(0);
        } catch (IOException exception) {
            exception.printStackTrace();
        }

        out.writeShort(msgbytes.toByteArray().length);
        out.write(msgbytes.toByteArray());

        player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
        getLogger().info("sent");
#

like this?

eternal oxide
#

yes

quaint mantle
#

okay

eternal oxide
#

you litterally design the protocol however you want and it will send it

quaint mantle
#
if (e.isCancelled())
            return;

        // Check if the message is for a server (ignore client messages)
        if (!e.getTag().equals("BungeeCord"))
            return;

        // Check if a player is not trying to send us a fake message
        if (!(e.getSender() instanceof Server))
            return;

        // Read the plugin message
        ByteArrayDataInput in = ByteStreams.newDataInput(e.getData());
//
//        // Let's check the subchannel
        instance.log("debug");
        instance.log(in.readUTF());

        
        if (!in.readUTF().equals("AuthToolsBungee"))
            return;

        instance.log("true");
#

and this is on bungeee side

eternal oxide
#

just decode in the same order/fashion at the other end

eternal night
#

after debug it should print ToProxy now

quaint mantle
#

omg

eternal night
#

if our wild speculations here are correct lul

quaint mantle
#

it works

#

it works as intended thank you so much

minor garnet
#
    public void fireGun(FireGunEvent e) {
        Bukkit.broadcastMessage("work");
        }```
why this event is dont working ?
quaint mantle
#

did you register the listener? in main class

#

and is the event being fired?

minor garnet
#

like a ?

quaint mantle
#

getServer().getPluginManager().registerEvents(listener class, this);

minor garnet
#

yes

quaint mantle
#

okay

minor garnet
#

main class

eternal oxide
#

does your listener have a @brave glenhandler on it?

eternal night
#

rip @EventHandler

quaint mantle
#

xd

minor garnet
#

bye guys

eternal night
#

lol

quaint mantle
#

okay? lol

ancient plank
#

bye son

little falcon
#

Any idea why config.set(val, val) isn't updating the config at all?

eternal oxide
#

save it

little falcon
#

would it not automatically save when the plugin is disabled?

eternal oxide
#

no

latent talon
#

i've decided to experiment with using vscode as a java IDE, im trying to export a jar file using the java projects menu, but it does not compile the yaml files with my jar, but only classes and packages, anyone has an idea on how to fix it?

quaint mantle
#

try put in src folder ig?

eternal oxide
#

You are the only person I've ever met whos is attempting to code a java plugin in VS

quaint mantle
#

xD

latent talon
#

i know

#

im just expierimenting

latent talon
quaint mantle
#

show me your work directory

#

@latent talon

latent talon
#

the work directory?

#

like in vscode?

quaint mantle
#

like this

#

idk how its called

latent talon
quaint mantle
#

ig try putting the yml to src/resources

latent talon
eternal oxide
#

Eclipse is lightweight. Visual Studio is... not the best

latent talon
#

its visual studio code

#

not visual studio

quaint mantle
latent talon
#

yeah its in

#

but i wanna see if spigot recofgnizes it

quaint mantle
#

ok did that work?

latent talon
#

checking

quaint mantle
#

okey

#

i dont know i dont code with 1.16

patent bloom
#

just asking again if anyone's gotten the pretty names of advancements? like A Seedy Place, Isn't It Iron Pick etc. I can only grab the namespaceid

quaint mantle
#

what do you mean by "pretty names of advancements"?

patent bloom
#

A Seedy Place, Isn't It Iron Pick, Suit Up, Hot Stuff, etc

latent talon
#

?

patent bloom
#

these

#

i'm only able to grab the Namespaced ID

latent talon
#

wait

#

there's a difference?

patent bloom
#

achievements are bedrock i think, advancements are java. could be wrong

latent talon
#

huh

quaint mantle
#

conversely

latent talon
#

the name most have changed

quaint mantle
#

achievements are in java

latent talon
#

im sure it was called achivements

latent talon
quaint mantle
#

java

latent talon
ivory sleet
#

That’s legacy

quaint mantle
#

wait what

latent talon
#

it was changed in a newer version

#

than 1.8

quaint mantle
#

oh nvm

ivory sleet
#

It was bumped to advancements

eternal oxide
#

what does the getCriteria() provide you?

quaint mantle
#

btw @latent talon did it work?

latent talon
#

nope

quaint mantle
#

weirddd

latent talon
#

decompiler shows its in

eternal oxide
#

it needs to be in root

latent talon
#

server doesn't recognize it

quaint mantle
#

yeah but if its in root or src it says that it doesnt show

#

like it doesnt export with it

latent talon
#

it didn't show if it was in root or src

eternal oxide
#

I can;t advise you with VS. You need to change its settings to include files in root

latent talon
#

yeah thats what im trying to do

quaint mantle
#

ill look in vs code i have it installed so

patent bloom
quaint mantle
#

@latent talon try doing your directory as

 ┣ src
 ┃ ┣ main
 ┃ ┃ ┣ java
 ┃ ┃ ┃ ┗ dev
 ┃ ┃ ┃   ┗ cibmc
 ┃ ┃ ┃     ┗ spigot
 ┃ ┃ ┃       ┗ blankplugin
 ┃ ┃ ┃         ┗ App.java
 ┃ ┃ ┗ resources
 ┃ ┃   ┗ plugin.yml
ivory sleet
#

Do you use gradle or maven?

#

Else doubt it would work

latent talon
#

no

eternal oxide
#

he's just using Visual Studio Code and exporting

latent talon
#

i thought about switching

ivory sleet
#

Then don’t follow that sourceset architecture

#

If you don’t use maven/gradle

#

Also yes get an IDE

#

it’s profoundly more suitable

latent talon
#

alright ill get back to intellij

#

my premium ran out so im just expierimenting with stuff

ivory sleet
#

I mean even eclipse exists

eternal oxide
#

Eclipse + maven is great

latent talon
#

yeah i know but eclipse annoyed me when i tried it

eternal oxide
#

Low memory footprint, no subscriptions and does what its told.

narrow furnace
#

if ur writing java

#

use a java ide

#

idk why anyone wouldnt

ivory sleet
#

Masochistic maybe

vague mason
#

Because nano is the best

latent talon
#

i literally said im just expierimenting

narrow furnace
#

apart from nano lol

vague mason
#

ide

#

for every programming language

narrow furnace
#

nano op

vague mason
#

😂

ivory sleet
#

doron yeah it’s fine but still (;

weary geyser
#

How would you get the name of an enum if you only have a class of the enum?

ivory sleet
#

Wat

eternal oxide
#

explain?

ivory sleet
#

If you mean the class name just getClass#getName

weary geyser
#

But that will return the name of the enum class

#

Not the like actual value

ivory sleet
#

Ofc it will

weary geyser
#

idk

ivory sleet
#

No but how are you suppose to get the name from an enum constant if you don’t know which one

weary geyser
#

oop

ivory sleet
#

Or don’t have an instance of one

weary geyser
#

wait

#

I will explain

narrow furnace
#

send example

cinder thistle
#

TFW conclure slow

ivory sleet
#

Oh that was the thing I forgot

weary geyser
#
public enum A {
  ABC, CBA, BAC;
}

Class<? extends A> c = ...;
//Now, for example let's say that c is the class of CBA
//How would you get the name of CBA if we didn't know that?```
#

if that's even possible

cinder thistle
#

Yes I am going to continuously say that until my leg vibrates to alert me of a PR

ivory sleet
#

Ok ok

#

Im gonna EDIT this in gh

eternal oxide
#

A.values()

#

will get all values in A

weary geyser
#

Yes but how would I get the name of CBA from the class instance?

ivory sleet
weary geyser
#

no

#

from the c variable

ivory sleet
#

That’s not how it works

weary geyser
ivory sleet
#

The class instance of that enum does not hold the enum constants

cinder thistle
#

Me trying to understand the question

weary geyser
#

is that how it works

#

idk if i'm making sense

ivory sleet
#

CBA isn’t a class?

cinder thistle
#

^

eternal oxide
#

if you have an enum value you can get its declaring class

weary geyser
#

It's the enum value

cinder thistle
#

Actually what IS an enumeration value?

abstract relic
#

i dont think you can extend an enum?

cinder thistle
#

What’s its type?

#

You can iirc

patent bloom
ivory sleet
#

Cry I prd

cinder thistle
#

Ty

#

On mobile rn

#

But will take a look

ivory sleet
#

Yeah

abstract relic
#

no you cant

eternal oxide
#

@patent bloom you are probably out of luck then. It will be client side. Possibly available via a datapack

ivory sleet
#

Enums implement interfaces tho🎈

abstract relic
#

you should create an interface

#

and implement that

cinder thistle
#

Pog

abstract relic
#

yea

ivory sleet
#

Tho it’s a shame enums don’t go well with generics

patent bloom
#

rip ah well

vital ridge
#

Yo, anybody has any idea why cancelling entitytarget event for zoglins & hoglins does not work?

abstract relic
#

@lost matrix got a question for you, how would register a tile entity so that the server loads it as that specific entity on server load?

#

using TileEntityTypes#a doesn't seem to work

cinder thistle
#

Imagine getting an instance of an enumeration

weary geyser
#

This is what I'm fully trying to do. I'm having a method in a class annotated with a specific annotation. Then I'm getting the method, and the thing that is problematic is that I need to get a parameter in the method that is some material (org.bukkit.Material) and then get the actual Material instance.

ivory sleet
#

:0

abstract relic
#

wdym

#

material instance

#

there's no such thing as a material instance

ivory sleet
#

The method doesn’t hold a material instance

#

Not the material parameters as the very least

#

When you call the method, that would be the time when you would pass the material instance

abstract relic
#

its not an instance tho

#

its an enum constant

weary geyser
#
 @MyAnnotation
 public void a(Material.AIR /*I'm trying to get the Material.AIR part */)```
ivory sleet
#

They’re instances

abstract relic
#

how the fuck are you compiling that

#

what

ivory sleet
#

Oh sysdm looks like a field would suit you better

#

Wat

abstract relic
#

does that compile

ivory sleet
#

Oh

#

No

weary geyser
#

it was an example

abstract relic
#

i mean you cant create a parameter of an enum constant

ivory sleet
#

Tho you could create some sort of annotations mappings if that’s what you want

abstract relic
#

could you not just pass the material into the annotation?

weary geyser
#

I was trying to do smth like this Material m = Enum.valueOf(Material.class, Arrays.stream(method.getParameterTypes()).findFirst().get().getName()); but that obv won't work

stray halo
#

Hello, is there something like a console output event?

weary geyser
#

If it's possible

ivory sleet
#

Sysdm sry but that’s not possible nor how it’s suppose to work

weary geyser
#

Wait how does bukkit do it?

#

With the @EventHandler

#

fuck

#

wtf

stray halo
#

Poor event

ivory sleet
#

They use it to invoke the method with the passing the even instance

abstract relic
#

what

#

oh

ivory sleet
#

The event instances aren’t randomly chosen

abstract relic
#

the main difference is that they're passing in an object

#

not an enum constant

weary geyser
#

oh yeah

eternal oxide
#

I just leave the pings. If people have silly names they deserve the ping 🙂

ivory sleet
#

No

#

OxKitsune doesn’t matter

abstract relic
#

yes it does

ivory sleet
stray halo
abstract relic
#

you cant have a method parameter be a Material.AIR constant

#

thats just not how it works

ivory sleet
#

That’s not my point

#

In principle we could create a similar event handler system but pass material constants instead of event instances

abstract relic
#

oh yea

#

thats easy

#

but i meant like the type of parameter

#

cant be singular enum constant

ivory sleet
#

@stray halo Logger#addHandler

weary geyser
#

oh yeah i didn't even think of that

#

lmfao

#

my brain is dead

abstract relic
#

it doesnt make any sense lol

weary geyser
#

no lol

#

idk what i was thinking

abstract relic
#

in rust it does tho

#

😏

ivory sleet
#

Rust you say, let’s talk Haskell then

abstract relic
#

no fuck haskell

ivory sleet
#

🍉

#

Wow

#

Rude

stray halo
opaque mango
abstract relic
#

NO

#

TRIG

#

HAHAHAHHAHA

eternal oxide
#

Create a LogHandler extends ConsoleHandler which overrides publish. then get the default logger .addHandler(yoru handler);

abstract relic
#

why r u here

opaque mango
#

<3

#

cause it's lazy time

rare rain
#

i agree with trig

abstract relic
#

NO

#

DIAMOND

#

AHH

#

LMFAO

ivory sleet
#

You’ve lost boy

#

🎈

abstract relic
#

i sent a screenshot

#

in work slack

#

and he showed up not fair

rare rain
#

you were asking for it

abstract relic
#

functional programming languages are not my cup of tea

#

that is all

ivory sleet
#

Ah I see you’re an object oriented programmer

#

You like mutability huh

#

No thread safety?

rare rain
#

Functional programming I don't get either

ivory sleet
#

Side effects

abstract relic
#

?

#

rust

opaque mango
#

do words like immutability scare you?

rare rain
#

LMAO

abstract relic
#

not rlly

ivory sleet
#

Doubt

abstract relic
#

rust is literally

#

immutable by default

#

also only functional programming ive done is prolog

#

and that was horrible

ivory sleet
#

Rust is multi paradigm

#

💩

abstract relic
#

yes

#

but still not haskell

#

🤮

ivory sleet
#

Take that back

#

🙁

abstract relic
#

i havent touched haskell

#

so i cant rlly talk shit

stray halo
abstract relic
#

mb

ivory sleet
#

Yeah well then you’ve clearly missed something 😉

ivory sleet
eternal oxide
#

^

stray halo
#

oh i see

ivory sleet
#

It’s basically a context class

stray halo
#

and the record has some method to get the message right?

eternal oxide
#

yes

#

and the log level

weary geyser
#

Is it possible to get the contents of a method? So like ```java

public void printContents(Method method) {
//blah
}```

wet breach
#

what do you mean the contents of the method? o.O

ivory sleet
#

You can get it’s accessibility level, params and if it’s static etc

eternal oxide
#

it would be byte code by runtime

weary geyser
#

Like what's in it

#

the code

ivory sleet
#

No

#

Or I mean

weary geyser
#

Is there like a bytecode to source converter

ivory sleet
#

There is instrumentation

wet breach
#

Yes, there is a couple of ways to do it but both are a pain to do

ivory sleet
#

If that’s what it’s called

#

Bytecode manipulation also exists

#

Altho it requires a java agent or smtng

weary geyser
#

is there any way that is not too hard?

sturdy patrol
#

It's doable, but neither efficient nor easy

ivory sleet
#

Not really

wet breach
#

You can either read the byte code and somewhat determine what it is or use reflection to get the objects.

ivory sleet
#

Sysdm what are you even doing

weary geyser
#

lmao

eternal oxide
ivory sleet
#

I can promise some easier solution exists

wet breach
#

I am pretty sure everyone is curious as to what it is too

#

XD

weary geyser
#

i'm trying to put in the contents of a method in an consumer

#

it's weird

wet breach
#

so then, you really just need the objects?

#

also why do you need the contents of a method to run in another method? o.O

weary geyser
#

Something like this java Events.listen(a.event()) .filter(e -> e.getPlayer().getItemInHand() != null && e.getPlayer().getItemInHand().getType() == a.material()) .handler(method.getContents());

#

fuck

wet breach
#

3 back ticks 😉

weary geyser
#

i pressed enter too early

ivory sleet
#

Oh

#

That’s cute

#

But seems like a ton waste of work?

wet breach
#

Ok, that doesn't really explain why you need the contents of one method, to then run it through another method

stray halo
#

I've tried the logger, but it doesn't log all the console messages, it only logs the message of when i disable the plugin

ivory sleet
#

What logger did you inject the handler in?

wet breach
#

also depends on the type of logging as well

stray halo
#

plugin.getLogger().addHandler(new LogHandler(this));

ivory sleet
#

You might wanna inject Plugin#getLogger and Server#getLogger iirc they’re not the same

wet breach
#

@stray halo you don't even need to do that o.O

stray halo
#

wdym?

weary geyser
#
@FilteredInteractPlayerEvent(material = Material.SOMETHING, event = PlayerInteractEvent.class)
public void test() {
  abc
}``` and then ```java
Set<Method> set = new Reflections("me.zoibox.core.core").getMethodsAnnotatedWith(FilteredPlayerInteractEvent.class);
        for(Method method : set) {
            for(FilteredPlayerInteractEvent a : method.getDeclaredAnnotationsByType(FilteredPlayerInteractEvent.class)) {
                switch (a.event().getName()) {
                    case "PlayerInteractEvent" : {
                        Events.listen(a.event())
                                .filter(e -> e.getPlayer().getItemInHand() != null && e.getPlayer().getItemInHand().getType() == a.material())
                                .handler(method.getContents());
                    }
                    case "PlayerInteractEntityEvent": {

                    }
                    case "PlayerInteractAtEntityEvent": {

                    }
                }
            }
        }```
#

that is what i'm at so far @wet breach

wet breach
#

Using your own Logger generally messes up the logging and you end up running into problems. When you can just grab an instance of the logger for your plugin instead. Not really many valid reasons why you need to inject some other logger.

ivory sleet
#

Maybe he’s only reading the records

stray halo
#

so, basically i'm creating a plugin with JDA, and i want to get console ouput and write it in a text channel on a discord server

ivory sleet
#

Yeah

#

You could just inject the Handler into the plugin logger and the server logger

#

Idk what other loggers there are

#

Other plugin loggers maybe

stray halo
#

and how do i do that?

ivory sleet
#

Do it at onLoad

stray halo
#

btw i changed from plugin.getLogger() to plugin.getServer().getLogger() and it logs more messages, but still not all of them

ivory sleet
#

Then just Bukkit#getPluginManager#getPlugins#forEach or smtng

#

Yeah ofc

#

You need both loggers

stray halo
ivory sleet
#

No

dusk flicker
#

lmao

ivory sleet
#

You basically already solved this

stray halo
#

oh

stray halo
ivory sleet
#

Plugin#getLogger#addHandler(yourHandlerInstance)

#

If you do that then don’t call Plugin#getLogger to inject it in ur plugin logger as that will be done on the loop

stray halo
#

ok thx i'll try

wet breach
#

If you are wanting to grab all output

#

then you need to grab the main logger of the server then

ivory sleet
#

Idk if you could inject into the global logger as well doubt it

wet breach
#

forget the appropriate name that the main logger is called, think its Minecraft?

//To get the logger of a specific class
private final static Logger LOGGER = Logger.getLogger(MyLogger.class.getName());

private final static Logger LOGGER = Logger.getLogger("Minecraft");
#

You don't need to inject @ivory sleet just get the reference so you can grab the output from its handler

ivory sleet
#

Well you would need to inject a handler at first?

#

Won’t magically be passed into a logger?

wet breach
#

The logger should have a handler already. Since the logger is created via the server, you only need to grab its reference. Not create a new instance of the logger.

ivory sleet
#

Oh never said create a new logger

sturdy patrol
#

Never worked much with loggers, so idk what is of interest in this repo

#

Yup, just checked, DiscordSRV still have a remote console feature.

stray halo
#

could be useful

#

i'll take a look

sacred sedge
#

why cant i do .setOwner on a cat

#

??

outer crane
#

javadocs to find out

sacred sedge
#

it says i should be able to

#

but it doesnt work :/

outer crane
#

well you are probably doing it wrong

sacred sedge
#

i can do it for a wolf...

#

but not a cat..

#

@outer crane

sturdy patrol
#

is it tamed?

#

It's written you don't have to call it, but it's worth a try

outer crane
#

javadocs say its possible, you are doing something wrong (like doing it if its not tamed)

sacred sedge
#

set tamed doesnt work :/

ivory sleet
#

define doesnt work

sacred sedge
#

oh wait lmao

#

i was using ocealot not cat lmao

kindred solar
#

guys, i ve been searching but i cant fix it, this is my code and i cant see why its not working ```java
@EventHandler
public boolean onPlayerUse(PlayerInteractEvent interact){
if(container.has(keyMenuWarp , PersistentDataType.DOUBLE)) {
if (interact.getAction() == Action.LEFT_CLICK_AIR || interact.getAction() == Action.LEFT_CLICK_BLOCK) {
interact.setCancelled(true);
interact.getPlayer().openInventory(menuJogos);
}
}

    return true;
}
#

some1 can help me by making this work?

sturdy patrol
#

what is container?

kindred solar
#
    public static Inventory menuJogos = Bukkit.createInventory(null, 9,"Modos de jogo!");
    public static PersistentDataContainer container;
    public static NamespacedKey keyMenuWarp;
ivory sleet
#

😮

sturdy patrol
#

Aff I gotta go. i'll let you guys explain x)

kindred solar
#

then onPlayerJoin i have this code keyMenuWarp = new NamespacedKey(this , "MenuWarps"); ItemMeta itemMeta = item.getItemMeta(); container = itemMeta.getPersistentDataContainer();

ivory sleet
#

you do know the container doesnt update when the item is updating

kindred solar
#

wdym?

ivory sleet
#

well what do u wanna achieve with the code provided

kindred solar
#

i want to open like an inventory

#

but a custom inventory

ivory sleet
#

okay

#

well the way you check the item is somewhat lacking

#

Wanna open an inventory if someone holds a special item with a special tag right?

wet breach
#

with the way your code is, probably best you don't set the inventory object as static

ivory sleet
#

you would actually have to grab the item from the players hand from PlayerInteractEvent#getItem I think or smtng estrit

#

or if you need to call PlayerEvent#getPlayer#getItemInMainHand

#

then check if that item has the tag by gettings its meta and then its container and so on

kindred solar
#

b4 i do that i was checking if the name of the item clicked is equal to the custom item

ivory sleet
#

thats another way

kindred solar
#

but some people from here said that ill cause troubles

wet breach
#

@weary geyser I don't really mess with annotations, but still doesn't really make sense why you need to have this if you have full control of the code? Couldn't you just keep track of the information and send it to the appropriate method the normal way? o.O

weary geyser
#

?paste

queen dragonBOT
wet breach
#

@quaint mantle please remove that and use the past service that is linked

ivory sleet
lost matrix
ivory sleet
#

however assume its in a lobby, then I would say no worries (if you cant get nor manipulate items)

opal sluice
#

I guess it's explicit enough isn't it ? (about the previous deleted paste)

ivory sleet
#

looks fine

sacred sedge
#

why am i getting this error when i try to suse inventory framemwork??

#

java.lang.NoClassDefFoundError: com/github/stefvanschie/inventoryframework/pane/Pane

ivory sleet
#

but I would make it to "Attempted to send plugin message through unregistered channel ..." @opal sluice

ivory sleet
sacred sedge
#

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
                    <relocations>
                        <relocation>
                            <pattern>com.github.stefvanschie.inventoryframework</pattern>
                            <shadedPattern>SnifferDogs.inventoryframework</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


abstract relic
opal sluice
ivory sleet
#

also its scope should be compile I think

#

oh

#

okay

sacred sedge
ivory sleet
#

?paste entire pom

queen dragonBOT
sacred sedge
ivory sleet
#

oh yeah

ivory sleet
#

set the scope to compile

#

like <scope>compile</scope> @sacred sedge

#

I think that would work

sacred sedge
#

ty leeme try

#

where shoul i add it?

#

like in executions?

ivory sleet
wet breach
#

@sacred sedge make sure all dependencies have a scope set

ivory sleet
wet breach
#

any dependencies with a scope of compile get included into the shading automatically if you have the shade plugin set to be used

stray halo
kindred solar
ivory sleet
#

I didnt mean it like that

#

if you just check the name, the chances are another item with other properties (but same name) can be seen as that item and would also have the ability to open the designated inventory

sacred sedge
#

java.lang.NoClassDefFoundError: com/github/stefvanschie/inventoryframework/pane/Pane

kindred solar
ivory sleet
#

ok

sacred sedge
ivory sleet
#

well if you're relocating it

sullen dome
#

quick question:
how to get the stuff that is logged into the console? couldn't find an event or smt like that

ivory sleet
#

ofc that NCDFE will be thrown if you try to access a class with its original package

#

inject a ConsoleHandler into the logger you "listen to" with Logger#addHandler

kindred solar
ivory sleet
#

I told you the cons

#

its up to you what method to use

kindred solar
#

okok

ivory sleet
#

did u set the scope to compile?

sacred sedge
#

yup

ivory sleet
#

and what do u run to build the jar?

#

it should be maven clean install I think

#

(I dont use maven so rly dk)

sacred sedge
#

i use a build artifact

#

is that bad?

ivory sleet
#

well that explains why

#

if you use maven

paper viper
#

is the artifact id literally called IF 😳

#

what dafaq

#

lmao

ivory sleet
#

then you need to use the maven life cycle tasks as well to build your jar

sacred sedge
#

i just press build artifacts?

stray halo
#

hello again, is there a way i can make my plugin disable before all the others?

paper viper
#

no no no no

#

package