#help-development

1 messages · Page 309 of 1

humble tulip
#

the first thing is the type of data

#

so MessageRaw is a raw message for the client to display in chat

warm light
#

so if I want to make a custom messaging channel, I need to register it using bungeecord plugin right?

humble tulip
#

yes

#

you will need the bungee plugin to intercept the incoming messages

#

and do whatever you want with them

#

whether it may be to send the messages to other servers etc

#

Or you can just use Forward in the bungee messaging channel so you dont have to do all of that

warm light
# humble tulip yes

is there any official wiki for that? 👀
I have many custom data & want to use own messaging channel

humble tulip
#

is it for a public plugin or a private one?

warm light
#

public plugin. but want it without database

#

I already have database. but also want to transfer data with bungee

humble tulip
#

but then they'll have to install a plugin in the bungee server AND spigot server

warm light
#

no prob with that.

humble tulip
#

if you're okay with that then you can use custom channels

sullen marlin
#

but it'll still need a database?

warm light
#

uhh. can I just look at an example, of how it works?

humble tulip
#

not many examples out there

#

i think there was a spigot post on it tho

warm light
#

alright, I will try to find it out

humble tulip
#

@warm light

#

also remember plugin messages require a player to be online to be sent since it's sent via a player's connection

warm light
#

player need to be online in both server?

#

from where it send & where it will receive

humble tulip
warm light
#

ahh

humble tulip
#

redis

wet sparrow
#

Hello, I'm doing a tops system, and I do a LIMIT 3 that returns a UUID, how can I get the name with that uuid, I already tried with Bukkit.getPlayer(uuid).getName();

#

but this get error Null

#

and the uuid is not null

eager flax
#

how do I check if a player is an operator

wet sparrow
#

player.isOp();

eager flax
#

thx

remote swallow
#

Check the UUID class for the method to convert it

wet sparrow
#

convert uuis string to UUID?

remote swallow
#

Ye

wet sparrow
#

error

tender shard
#

whatever is in line 140, something there's null

#

?paste <---

undone axleBOT
buoyant viper
#

paperspigot 1.8.8
smh....

frail gazelle
#

hello,

so i have a command where when you type '/roleplayitems check' it checks to see if the item in the hand has a specific key or not, then displays whether or not it is a roleplay item.

problem is if the player isn't holding anything. i thought i checked for it, but it still seems to be giving me errors when the item is null.

CODE:

if (args[0].equalsIgnoreCase("check") && args.length == 1){
            ItemStack itemHand = player.getEquipment().getItemInMainHand();
            if (itemHand.getType() != null) {
                NamespacedKey key = new NamespacedKey(RoleplayItems.getPlugin(), "rp-Item");
                ItemMeta itemMeta = itemHand.getItemMeta();
                PersistentDataContainer container = itemMeta.getPersistentDataContainer();
                if (container.has(key, PersistentDataType.DOUBLE)) {
                    player.sendMessage("Item is a RoleplayItem");
                    return true;
                } else {
                    player.sendMessage("Item is NOT a RoleplayItem");
                    return true;
                }
            } else {
                player.sendMessage(ChatColor.DARK_RED + "Hold an item.");
                return false;
            }

ERRORS:

remote swallow
#

?paste the error dont screenshot it

undone axleBOT
frail gazelle
#

@remote swallow

remote swallow
#

use getInventory not getEquipment

frail gazelle
remote swallow
#

?paste the full onCommand method

undone axleBOT
remote swallow
#

the item doesnt have any extra meta im guessing so you probably want to check for that

frail gazelle
#

i'm already checking for if it has a specific key or not

#

its just when i don't have an item in my hand

remote swallow
#

yeah

#

the item you have in your hand has no item meta

#

if its empty

#

so the pdc container is null

quaint mantle
#

maybe you need to check item.hasItemMeta() before using itemHand.getItemMeta() to ensure that item has ItemMeta

remote swallow
#

^^

frail gazelle
remote swallow
#

if it has no meta it has no pdc

frail gazelle
#

and i'm guessing thats whats causing the error

quaint mantle
#

so no meta means not a RoleplayItem

remote swallow
#

if the rp item has pdc identifying it, yes

frail gazelle
#

welp

#

i'll just go with that one now then

#

thank you guys

tawdry parcel
undone axleBOT
tender shard
#

<source> etc belongs into the compiler plugin's configuration, not the maven-jar-plugin's one

tawdry parcel
#

here you have the pom.xml

tender shard
#

as said, the source and target has nothing to do with the maven-jar-plugin, but with the maven-compiler-plugin

#

the .jar plugin is just to "zip" your compiled classes into a .jar file

#

the compiler plugin is the only thing that cares about the language level

tawdry parcel
#

for some reason the jar plugin is not working :C

tender shard
#

wdym with "not working"?

tawdry parcel
#

my commands aren't working ingame

tender shard
#

what exactly is the problem?

remote swallow
#

bet its unrelated

tender shard
#

?notworking

undone axleBOT
#

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

remote swallow
#

any errors in console

tawdry parcel
#

nope it sais build succesfull

tawdry parcel
#

yeah do you need extra informations?

tender shard
#

yes

remote swallow
#

i think we need code, errors or anything

tawdry parcel
#

ok wait

#

I think thats enough isnt it

#

but not only the commands arent working, nothing of the plugin is working ingame

remote swallow
#

why are you using != on a string and == on a string

remote swallow
tawdry parcel
#

ok wait

#

when i used the marven-compiler-plugin, everything worked fine, but with the marven-jar-plugin its not working anymore

remote swallow
#

i doubt the jar plugin does the same thing then

tawdry parcel
#

yes the maven-compiler-plugin exports my source code and the maven-jar-plugin exports my code as .jar file, and i need that right?

undone axleBOT
tender shard
#

your issue has NOTHING to do with maven

tawdry parcel
#

okay

tender shard
#

anyway, line 12 in NicknameCommand is already wrong

tawdry parcel
tender shard
#

as Epic already said, you must not use != or == for strings

#

you didnt define that command in your plugin.yml

#

and stop comparing strings with != or ==, you must use equals()

remote swallow
#

if you need to chek if something isnt equal to that use !args[0].equals

tawdry parcel
# tender shard you didnt define that command in your plugin.yml

i did:

name: KonerUtils
version: '${project.version}'
main: com.koner.konerutils.Main
api-version: 1.19
author: KonerDev
description: The official plugin of KonerCraft
commands:
  nickname:
    usage: /nick <NAME>
    description: Change your name on the entire KonerCraft server
    aliases: nick
remote swallow
#

how are you building

tawdry parcel
tender shard
remote swallow
#

are pressing the hammer, pressing the green play button, pressing something on the maven panel

tender shard
#

In the code you sent, the getCommand() is in line 11. In your stacktrace, getCommand() is in line 12

torpid blaze
#

Hey,
I just recoded one of my old plugins and want to store in a yml file a list of costum objects. However, when I restart the server, it gives me the error that it can't find a constructor for the object.

Do any of you have any idea how I can fix this?

Error:

org.yaml.snakeyaml.constructor.ConstructorException: could not determine a constructor for the tag tag:yaml.org,2002:com.example.shops.utils.ShopItem
in 'reader', line 2, column 3:
- !!com.example.shops.utils.ShopItem

tender shard
#
  1. stop your server
  2. do mvn clean package
  3. install the new plugin .jar
  4. start server again
  5. see if it works now. If not, send latest.log again
    @tawdry parcel
remote swallow
tender shard
#

please ?paste the FULL ShopItem class

#

please don't just paste parts of it, but the full class

#

?paste

undone axleBOT
torpid blaze
#
package com.example.shops.utils;

import org.bukkit.inventory.ItemStack;

public class ShopItem {
    private ItemStack itemStack;
    private double worth, cost;

    public ShopItem(double cost, ItemStack itemStack, double worth){
        this.itemStack = itemStack;
        this.cost = cost;
        this.worth = worth;
    }

    public ShopItem(ItemStack itemStack, double worth, double cost){
        this.itemStack = itemStack;
        this.cost = cost;
        this.worth = worth;
    }

    public ItemStack getItemStack() {
        return itemStack;
    }

    public void setItemStack(ItemStack itemStack) {
        this.itemStack = itemStack;
    }

    public double getWorth() {
        return worth;
    }

    public void setWorth(double worth) {
        this.worth = worth;
    }

    public double getCost() {
        return cost;
    }

    public void setCost(double cost) {
        this.cost = cost;
    }
}
tender shard
remote swallow
#

and have a deserialze method and serialize

tawdry parcel
# remote swallow why are you using != on a string and == on a string

is that right:

package com.koner.konerutils.nickname;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class NicknameCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        String nickname = !args[0].equals("delete") || !args[0].equals("") ? args[0] : player.getName();
        player.setDisplayName(nickname);
        player.setCustomName(nickname);
        player.setPlayerListName(nickname);
        player.sendMessage("Display Name: " + player.getDisplayName() + " Name: " + player.getName() + " Custom Name: " + player.getCustomName() + " PlayerListName: " + player.getPlayerListName());
        return true;
    }
}
tender shard
#

it must have at least ONE of those methods

remote swallow
tender shard
torpid blaze
#

thx

tawdry parcel
remote swallow
#

no

#

you dont use .equls for null

#

?learnjava

undone axleBOT
tender shard
# torpid blaze but how do I implemet this?
public class MySerializableObject implements ConfigurationSerializable {

    private final String name;
    private final int age;


    public MySerializableObject(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public Map<String, Object> serialize() {
        Map<String,Object> map = new HashMap<>();
        map.put("name", name);
        map.put("age", age);
        return map;
    }
    
    public static MySerializableObject deserialize(Map<String, Object> map) {
        return new MySerializableObject((String) map.get("name"), (int) map.get("age"));
    }
}
#

all the things I marked in green MUST be there

tawdry parcel
remote swallow
#

null check first

tender shard
tawdry parcel
torpid blaze
tender shard
remote swallow
#

lets say you want to check if something isnt null or equals something, you would want to know if its null first

#

if its null it cant be the 2nd option

tender shard
#

yeah ^ or use Objects.equals(...)

tawdry parcel
tender shard
#

however you should only use Objects.equals(...) if you know why you cannot just use equals() on null references

tawdry parcel
tender shard
tawdry parcel
#

wait i send you screenshot

tender shard
#

yes, a screenshot would be helpful

tawdry parcel
tender shard
remote swallow
#

that doesnt look like you using mvn clean package tbh

tender shard
#

click on this, then you get the full log

#

then ?paste the full log

tawdry parcel
tender shard
#

oh and btw, if you get verified, you can send screenshots directly here

tawdry parcel
#

yeah i do it after breakfast

tender shard
#

?paste your full pom.xml, fellow german

undone axleBOT
remote swallow
#

i just looked at that log and thought its a good thing your here

tender shard
#

you somehow set your language level to 5

#

it should be 7 or higher

tender shard
#

yeah well the logs clearly says "Quelloption 5 wird nicht mehr unterstützt."

#

yeah, I see

tawdry parcel
#

it means something like source option 5 is no longer supported

tender shard
#

did you copy that pom from my blog by any chance?

#

5 is the default value

tawdry parcel
#

no

tender shard
#

okay so

tawdry parcel
#

intellij generated that for me

tender shard
#

in your <properties> section, add this:

#

(1 sec)

#
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
#

like this (without the <jarLocation> thing)

remote swallow
#

or 16, been as your java version is 19

tender shard
#

the "java.version" property is useless anyway, btw

#

no idea where that comes from

remote swallow
#

does that not actually do anything

tender shard
#

did you generate the pom through this stupid "Minecraft Dev Plugin" for IntelliJ?

#

It's known to be a bit stupid and only fuck things up

remote swallow
#

the plugin is great if you set your own poms

tender shard
#

lol to setup your own poms, you could just use maven archetypes

remote swallow
#

it easier imo

tender shard
#

yeah as we see

#

this dude is struggling since half an hour to get it to work, I wouldnt really consider this to be "easier"

remote swallow
#

ive got my build.gradle default setup to have my own build file

#

and its easier

#

without it its pointless

tender shard
#

the "minecraft dev plugin" is shit. it's a cheap version of maven's archetypes, except that it adds useless stuff and misses important things and doesnt have any useful config options

#

e.g. "wanna use NMS?"

#

and it causes crashes in IJ ultimate whenever there's an IDE update

torpid blaze
# tender shard ```java public class MySerializableObject implements ConfigurationSerializable {...

I now tried this and the serialisation is working but the deserializing not.
I get this Error:

org.yaml.snakeyaml.error.YAMLException: Could not deserialize object
...
Caused by: java.lang.IllegalArgumentException: Specified class does not exist ('at.kessapps.shops.utils.ShopItem')
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:197) ~[spigot-a

@Override
    public Map<String, Object> serialize() {
        Map<String, Object> map = new HashMap<>();
        map.put("itemStack", itemStack);
        map.put("cost", cost);
        map.put("worth", worth);
        return map;
    }

    public static ShopItem deserialize(Map<String, Object> map) {
        return new ShopItem((ItemStack) map.get("itemStack"), (double) map.get("worth"), (double) map.get("cost"));
    }```
tender shard
#

pom files should only ever be generated through archetypes. I never understood why anyone would use any "pom generator" when maven already got a way more powerful templating engine builtin

tender shard
#

it looks like you renamed the class or package at one time but are still using a config file where the class was called differently

torpid blaze
# tender shard show your full ShopItem class again, and also show your full config file please

Class:

package at.kessapps.shops.utils;

import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.inventory.ItemStack;

import java.util.HashMap;
import java.util.Map;

public class ShopItem implements ConfigurationSerializable {
    private ItemStack itemStack;
    private double worth, cost;

    public ShopItem(ItemStack itemStack, double worth, double cost){
        this.itemStack = itemStack;
        this.cost = cost;
        this.worth = worth;
    }

    public ItemStack getItemStack() {
        return itemStack;
    }

    public void setItemStack(ItemStack itemStack) {
        this.itemStack = itemStack;
    }

    public double getWorth() {
        return worth;
    }

    public void setWorth(double worth) {
        this.worth = worth;
    }

    public double getCost() {
        return cost;
    }

    public void setCost(double cost) {
        this.cost = cost;
    }

    @Override
    public Map<String, Object> serialize() {
        Map<String, Object> map = new HashMap<>();
        map.put("itemStack", itemStack);
        map.put("cost", cost);
        map.put("worth", worth);
        return map;
    }

    public static ShopItem deserialize(Map<String, Object> map) {
        return new ShopItem((ItemStack) map.get("itemStack"), (double) map.get("worth"), (double) map.get("cost"));
    }
}

YML File:

Items:
- ==: at.kessapps.shops.utils.ShopItem
  itemStack:
    ==: org.bukkit.inventory.ItemStack
    v: 3120
    type: OAK_LOG
  cost: 2.0
  worth: 1.0
remote swallow
#

already know the issue

#

thats a list of items so im guessing you arent getting the item back just from Items not the list

tender shard
#

show the full stacktrace, not just an excerpt

#

config and class looks good

humble tulip
torpid blaze
humble tulip
#

So i dont have to change the number twice

tender shard
#

by itself, it doesnt do anything

remote swallow
torpid blaze
tender shard
# torpid blaze

please ?paste your class files. we need to know what line 29 in ShopData is, and what Main line 28 is

#

if you just post it here, we have to count the line numbers manually, and nobody wants to do that

#

so please use ?paste

torpid blaze
#
package at.kessapps.shops.utils;

import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.inventory.ItemStack;

import java.io.File;
import java.io.IOException;

public class ShopData {

    private static File file;
    private static YamlConfiguration status;

    public ShopData(){
        File dir = new File("./plugins/Shops/");
        if (!dir.exists()){
            dir.mkdirs();
        }

        file = new File(dir, "ShopData.yml");
        if (!file.exists()){
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        status = YamlConfiguration.loadConfiguration(file);
    }

    public static boolean contains(String path){
        return status.contains(path);
    }

    public static void set(String path, Object value) throws IOException {
        status.set(path, value);
        status.save(file);
    }

    public static Object get(String path){
        if (!contains(path)){
            return null;
        }
        return status.get(path);
    }

    public static Object getKeys(String path){
        if (!contains(path)){
            return null;
        }
        return status.getConfigurationSection(path).getKeys(false);
    }

    public static void delete(String path) throws IOException {
        status.set(path, null);
        status.save(file);
    }
}
humble tulip
tender shard
#

...

#

we don't wanna count the lines

#

?paste it

undone axleBOT
torpid blaze
#

sorry

remote swallow
#

from what i remember the file doesnt start at ./plugins/ it starts in your plugins resource folder

torpid blaze
#

no, that is working

#

I have multiple files and the others have no problem

tender shard
#

ah I see

#

I know your problem I guess

#

you gotta register your class

torpid blaze
#

an it also creates the file if does not exist

tender shard
#

you didnt read the docs that I sent you twice already 😛

#

in your onEnable, you have to call ConfigurationSerializable.registerClass(ShopItem.class)

#

BEFORE you access your config

torpid blaze
#

oh, sorry. I didn't see that

tender shard
#

np, but next time when someone sends you docs, please read them 😄

topaz cape
#

imagine reading when mfnalex can just tell ya

#

/j of course

torpid blaze
remote swallow
#

yes it does

#

ive used it

tender shard
#

sorry I typed it wrong

#

ConfigurationSerialization.registerClass(Class)

#

Serialization != Serializable

#

ConfigurationSerialization.registerClass(ShopItem.class)

torpid blaze
#

that is working XD

tender shard
#

yeah

#

call that in the first line in your onEnable()

#

this tells spigot on how to deserialize your object

torpid blaze
#

no errors anymore !

#

Thanks all of you! I just tried this the whole day yesterday 😄

tender shard
#

no problem!

remote swallow
#

you are not here 24/7

tender shard
#

how do you know?

remote swallow
#

its more lik 18/7

remote swallow
#

other than when im sleeping

tender shard
#

I never slept in the entire 27 years of my life

#

trust me, it's true, I said it on the internet

remote swallow
#

is that how you fly planes

#

you were in one as a child and never forgot

tender shard
#

flying a plane is easy tbh

#

landing safely is the hard part

remote swallow
#

its just press the button, flip the switch pull up

#

enable auto pilot

tender shard
# remote swallow enable auto pilot

it's a bit harder. here's my first ILS landing which is indeed "autopilot is landing for you" https://www.youtube.com/watch?v=2NQGuJvSaxU&t=1s

ILS (engl. instrument landing system)
Unter Instrumentenflug (umgangssprachlich auch Blindflug) bezeichnet man das Steuern von Luftfahrzeugen, bei dem die Fluglage ohne Bezug auf äußere Anhaltspunkte mit Hilfe von Instrumenten an Bord gehalten wird (Ausnahme - der circling approach ist ein Instrumentenanflug, der unter Sichtbedingungen durchgefü...

▶ Play video
remote swallow
#

i have no idea whats going on

tender shard
#

ILS is basically "you tell autopilot how to land"

remote swallow
#

ah

#

have you ever flown a 737 or 747

tender shard
#

haha no of course not

#

I am only allowed to fly single-engined propellor planes

remote swallow
#

arent you meant to be flying on like tomorrow ow whatever it was

tender shard
#

tomorrow?! no, I am totally drunk right now

remote swallow
#

i thought you were flying a commercial soon

tawdry parcel
tender shard
#

it's useless in your case

remote swallow
#

im going downstairs does any one want some food

tender shard
tawdry parcel
#

i'll try that in the mc sevrer

tender shard
#

but I dont recall having said that

remote swallow
#

one second ill see if i can find it

tender shard
#

oki

tawdry parcel
#

in the target folder are only the temporary files right?

humble tulip
#

Alex

tawdry parcel
humble tulip
#

Why isn't craftbukkit importong nms properly?

sterile breach
#

hi, i supcie my plugin infected, how to check? uncompile and search if the code have à links?

humble tulip
#

If you think a plugin is inefected

#

Get a new server

#

Also it's possible the plugin is deobfuscated so you won't be able to read it anyways

sterile breach
#

it works, but a developer of mine put it on and I suspect it

humble tulip
#

@sterile breach

sterile breach
#

it finds everything?

#

backdord or juste dangerous cmds?

tender shard
tender shard
remote swallow
#

tell me you arent depending on craftbukkit and bukkit and using the spigot-api

remote swallow
tawdry parcel
#

and one question: should i use jar:jar or clean package

remote swallow
#

package or clean package

tawdry parcel
#

is there even a difference?

remote swallow
#

clean package runs a full fresh build iirc, package just builds it

#

alex will correct me in a moment probably

tawdry parcel
#

i meant the difference between jar:jar or clean package

remote swallow
#

probably, no idea what it is

tawdry parcel
#

okay then i just use the clean package thing

humble tulip
# tender shard wdym

I forked craftbukkit as well as bukkit from spigot stash and cloned in in intellij

remote swallow
#

?contribute

remote swallow
#

look at the last 2

tawdry parcel
#

is it bad if i restart my plugins using /reload?

sterile breach
#

/reload break plugin

#

use /(pluginname) relaod

remote swallow
#

not all the time

remote swallow
sterile breach
#

yes but is not good idea

remote swallow
#

that normally just reloads a config if they have it setup

remote swallow
#

but a restart is better

humble tulip
#

I need to apply patches even if I didn't make any changes?

tawdry parcel
remote swallow
humble tulip
#

Fk it

#

I'll try

remote swallow
# tawdry parcel okay perfect

just be ware that some errors might appear because of it and if there something you cant fix just restart and somtimes it would work lol

sterile breach
#

is for some plugins

remote swallow
#

some plugins have ondisable incorrectly setup so those would break on restart

#

you can just use https://flags.sh if you need to auto restart on a dev server

#

and just disable akairs flags

sterile breach
remote swallow
#

you can

#

its up to you

humble tulip
#

AAA

remote swallow
#

do you have git installed

rare pike
#

how much ram is needed to create a survival economy server?

earnest forum
#

how much players you expecting

remote swallow
#

depepnds, how many plugins are you gonna have, how many players, how big is the map

earnest forum
#

for this type of question

rare pike
humble tulip
#

I'm using git to run it

remote swallow
#

open git bash where the thing is and type bash runPatches.sh

rare pike
humble tulip
#

i did

remote swallow
#

@tender shard if ur still here how do they do the .sh on gitbash

humble tulip
#

that's the $1 but idk anything abt bash

#

OHH

#

im dumb

#

i was running makePatches

#

not applyPatches

#

yesss

#

got it working

tender shard
#

?paste the whole .sh file

undone axleBOT
humble tulip
#

@tender shard i got it working

#

i was running makePatches instead of applyPatches

tender shard
#

ah oki

tardy delta
#

didnt even know this wasnt possible

#

works fine with a static class but then i have to pass stuff around

torpid blaze
#

@tender shard xD Now I have the same issue with a UUID. I can't deserialize it but I also can't register it too.
Should I just save it as a String or is there a better solution?

remote swallow
#

alex is asleep im pretty sure, whats your issue?

torpid blaze
#

Not I get the error that the UUID I save in the yml is not deserializable as with my costum Object

remote swallow
#

oh the shop item?

#

how are you deserializng

torpid blaze
#

I just added a uuid feld with the UUID type

#

but that has nothing to do with my Object I think. It is the UUID in general

remote swallow
#

check config, does it have dashes

torpid blaze
#

uuid: !!java.util.UUID '5e444988-f43c-491b-af6c-92eeb302452f'

#

is saves it like this

remote swallow
#

ah, pass in a uuid.tostring

#

instead of a UUID

torpid blaze
#

ok

remote swallow
#

then on the deserialize use UUID.fromSTring iirc

torpid blaze
#

yea, I already thought of this but maybe there was a better solution

#

but thanks anyway

crystal palm
#

hi! trying to make a disenchant plugin for players as a perk of sorts. if a player does /disenchant <enchant> while holding an item, the enchant is removed and a book is given.

this works fine for vanilla enchantments, but doesnt work the same for custom ones, even though both of them have the same key.
it does a check to see whether the custom enchantment even exists too but it wont remove it :/

[11:03:34 INFO]: [Disenchanter] minecraft:abrasion
[11:03:38 INFO]: goosBanny issued server command: /enchant sharpness
[11:03:40 INFO]: goosBanny issued server command: /disench sharpness
[11:03:40 INFO]: [Disenchanter] minecraft:sharpness

same key, yet abrasion wont disenchant.

Enchantment enchant = Enchantment.getByKey(NamespacedKey.minecraft(enchStr));
... ... ...
itemInHand.removeEnchantment(enchant);

it does, however, show that it removed abrasion in chat.

#

any idea?

#

what's even weirder is the fact that when holding an empty book in offhand, itll give the abrasion enchantment to said book just fine, but wont give the level.

#

but wont remove it from the sword

chrome beacon
#

Have you tried using the api of your custom enchants plugin

crystal palm
#

trying to make it so itll work with any plugin rn

chrome beacon
#

Not all custom enchant plugins work the same way

#

If it works with vanilla then it's fine

crystal palm
#

🤔 its registering in the minecraft namespace

chrome beacon
#

Spigot was never designed to handle custom enchants like that

#

So who knows if it works correctly or not

sterile breach
#

all plugins posted in spigot ares verified? or can contain malwars?

chrome beacon
#

Some can contain malware

#

So stay away from new plugins from new accounts

#

Optic does check them, but it can take a bit before they're taken down

spiral light
#

Quick question... is there a ItemChangeCooldownEvent ?
for example for Enderpearls and Shields it would get called

chrome beacon
#

Doesn't look like it

#

What are you trying to do?

storm scaffold
#

How do I set an item nbt to a string? I can use item.getItemMeta().getAsString() to output the nbt of item as a string, but if I had a string such as "{CustomModelData:1,MagicSword:1b,InvisibleTool:1b,CustomEnchanted:True}", how would I set an item's nbt to that?

spiral light
#

thinking about adding an event for this to apply or remove custom cooldowns on use

tardy delta
#

my toString goes brr

storm scaffold
chrome beacon
#

CraftItemStack should have a method for that if I remember correctly

#

Also why not use pdc

#

?pdc

storm scaffold
#

Is there a way to convert a string to an item meta and just use setItemMeta() like I use getItemMeta()?

chrome beacon
#

Not in the API

storm scaffold
#

If I have an item from player.getInventory().getItemInMainHand(), and I have nbt stored as a string such as "{CustomModelData:1,MagicItem:1b}", is there a simple way to just set the nbt of the item to the nbt?

chrome beacon
#

Use PDC

#

If you want to use NBT then you will need to use NMS

storm scaffold
#

What is PDC?

remote swallow
#

?pdc

storm scaffold
#

The example contains a variable called pluginInstance, which isn't set to anything by default, what should I set that to?

remote swallow
#

an instance of your plugin

#

?di

undone axleBOT
tardy delta
#

this would double the array size and move the original elements back into it right?

twin venture
#

Caused by: java.lang.NoSuchMethodError: 'org.bukkit.inventory.meta.ItemMeta$Spigot org.bukkit.inventory.meta.ItemMeta.spigot()'

#

my plugin is 1.8.8 code based ? can i do something to fix it ?

#

i dont use any nms code

#

or packets

chrome beacon
twin venture
#

not an option

chrome beacon
#

Then don't use that method

twin venture
#

is there another method?

chrome beacon
#

Depends on what you tried to do

#

Probably not though so you will need nms

twin venture
#

opening guis ..

#

and set itemmeta for some items

storm scaffold
chrome beacon
#

The instance of your plugin

#

the plugin being your main class that extends JavaPlugin

storm scaffold
#

How do I make an instance of my plugin and put it in a variable?

chrome beacon
#

?di

undone axleBOT
chrome beacon
#

You already have an instance of your plugin

tardy delta
#
public class MyPlugin extends JavaPlugin {
  void onEnable() {
    // this refers to the current instance of MyPlugin
    Something smth = new Something(this);
  }
}

class Something {
  MyPlugin plugin;

  Something(MyPlugin plugin) { this.plugin = plugin; }
}```
chrome beacon
#

No don't spoon

#

People need to learn to read

remote swallow
tardy delta
#

exactly the same thing as in the docs

chrome beacon
#

Yeah

#

but people won't read the docs if you keep replying here

#

and you skipped all the important text

tardy delta
#

java moment: cannot cast CharTree<?>.Node to CharTree<T>.Node \💀

#

so i have to fuck with Array.newInstance

chrome beacon
#

Sounds like a problem with your code rather than Java

tardy delta
#

just because CharTree is generic and Node is not static ;-;

chrome beacon
#

Yeah so ofc it's causing problems

tardy delta
#

ig Node must be created within the context of CharTree<T> and the actual type is CharTree<T>.Node then

chrome beacon
#

Yeah

twin venture
#

Hi i have a problem i just happend , i dont know why ..
so when i click on mvn clean package nothing show in the termanal [console ] or intellij idea , no errors and it compete , but the plugin size is really small

#

200kb

#

idk what happend

#

the plugin orginal size is 1,3mb

tardy delta
#

just click on package

twin venture
#

its working now .. before 5 minutes it was'nt building the correct plugin

#

and without any libs ..

zinc egret
#

i didnt pay alot of attention to formattingz arent there any common formatting rules for java? besides naming conventions

remote swallow
#

class names in UpperCamelCase var names in lowerCamelCase, package names lower case

chrome beacon
#

besides naming conventions

remote swallow
#

didnt read that far

fluid river
#

avoid nesting ifs

#

ez

remote swallow
#

we have a command for that

fluid river
#

"then" is present in java

#

so you can have oneliners

#

if (smthIsTrue) doSomething();
else doAnotherThing();

remote swallow
#

dont nest ifs like what nukersaid and instead of doing something like

if (playerIsSus() {
    do something sus;
} else {
    return;
``` do 

```java
if (!playerIsSus()) return;

do something sus;
zinc egret
#

i read it 🥰

fluid river
fluid river
#

there is no return in my code

remote swallow
#

im just giving another tip

fluid river
#

and also this can be applied to else if

fluid river
zinc egret
remote swallow
fluid river
#

i thought you are criticising me

#

sry

#

❤️

remote swallow
#

nah im just giving an extra tip lol

fluid river
#

i guess i read nukersaid as nuker did

#

for some reason

remote swallow
#

my space bar doesnt work sometimes

fluid river
#

happens

remote swallow
#

so works look weird

livid dove
#

Is there a method for loading a chunk even if players are not there?

Had this cracking idea of a plugin for further mitigating cheating players whom, even after rollback have managed to get away with it via various work around by grabbing coordinates of various item exchanges, loading the chunk, checking the containers and seeing if the items of equivalent are there, give an option to delete them, then de load the chunk

remote swallow
#

plugin ticket iirc

livid dove
#

*get away with cheating core protect

livid dove
remote swallow
livid dove
#

Ahh fantastic cheers

daring elm
#

help? :/ my server still timeout

chrome beacon
chrome beacon
#

Also when you're in the Paper discord don't screenshot the logs and show the entire thing

tardy delta
#

paper moment

rotund ravine
#

Not the same oneliners

#

Nah

tardy delta
#

ah yes streaming a collected stream

topaz cape
#

why does sending zombie entity spawn packet not work in the nether o. o

#

no way the client refuses it

#

does it?

rotund ravine
#

probably not

topaz cape
#

it works fine in the OW

#

why not the nether

chrome beacon
#

Probably something wrong with your code

echo basalt
#

most likely

topaz cape
#

I'll recheck every step

#

but i doubt it

chrome beacon
#

I doubt even more that zombies are broken in the nether

echo basalt
#

yeah like send a packet saying you're a spectator

topaz cape
#

i checked and made some debug strings

#

packets are for sure sent

#

but why do they not work?

#

no clue

undone axleBOT
topaz cape
remote swallow
#

"and" i was giving another tip for them

topaz cape
#

you can't change entity id in a packet mr smarty

#

plus this code works fine in the OW

#

nope

#

entityID not uuid

#

to make a player look like an entity

#

pls don't change the subject

#

THIS PACKET WORKS OML

#

it works as long as you're not in the nether

#

or the end

#

only OverWorld

#

stop

#

not helpful

radiant aspen
#

Will it include stuff like explosions? or is it just stuff like zombies breaking doors?

remote swallow
radiant aspen
#

how are u that fast?

remote swallow
#

its on the javadocs

radiant aspen
#

that was like 100ms response

#

yes but exactly what triggers it?

#

is it just zombies breaking doors and enderman moving blocks?

#

or is there anything else im missing?

remote swallow
#

was about to say that

radiant aspen
#

Well it looks like EntityBreakDoorEvent extends EntityChangeBlockEvent

#

so wouldnt EntityChangeBlockEvent also include break door event?

#

or is that not how that works

#

and a more specific event is not available ah thats not how that works

#

kinda dumb imo

#

hmm alright

#

thanks

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

https://paste.md-5.net/apuwodifos.cs - For some reason it only works once, on right click it opens the inventory but once i close out and right click the item again it doesn't do anything? I've debugged and the event is still firing and not getting stuck anywhere

#

ahhh yeahh

pseudo hazel
#

well return breaks the whole function xD

remote swallow
#

intellij will probably scream at you for using it just ignore it

pseudo hazel
#

intellij never screamed at my continues

#

why would it

#

maybe you are just using them wrong

remote swallow
#

almost every time ive used it intellij just wants me to die

pseudo hazel
#

sounds like a personal issue then

remote swallow
#

intellij just doesnt liek me

pseudo hazel
#

it wotn

#

it only gets mad at epic

undone axleBOT
echo basalt
#

mm I love code samples that don't follow any structure

remote swallow
#

are you sending a death message

#

after running that

#

dont

#

use the death event

#

or canel the death event

#

or better set the death event message to null

#

i would guess the death event is called when you set the health to 0 then it triggers again for some reason

#

is the death message handled just after you set the health to 0 or do you handle the death message on the death event

undone axleBOT
remote swallow
#

i would guess the only way that could happen from that code you provided is that theres 2 instances of the plugin running

#

i mean the plugin has loaded twice

#

yeah

#

im guessing its triggering when you set it to 0, and triggering the next tick

#

you could just set there health to 0.5

#

and within the next 10 ticks they would die to the void

#

also on your damage check, check if their health is already 0.5 or lower

#

otherwise you'll get into an un-die able state probably

#

lol

bright spire
#

Hello! I am developing a plugin and I need to pass the skin of a SkullMeta item into another. How can I achieve this?

#

newSkullMeta.setOwnerProfile(oldSkullMeta.getOwnerProfile());
This example is not working at all.

remote swallow
#

any errors

bright spire
#

No errors. Yes, I set the meta back.

remote swallow
#

is it a player your setting the owner to?

#

on the old skul

bright spire
#

old skull

remote swallow
#

well is the owner of the old skull a player or a texture

bright spire
#

I think its a texture

remote swallow
#

if its a players head you probably need to use getOwningPlayer and setOwningPlayer

#

idk how else the old skull owner wouldnt be set from that

bright spire
#

How do I pass a texture?

#

I am basically making an antiexploit plugin, and to prevent illegal items I recreate the entire item and pass the values

remote swallow
#

are you on 1.18.2 or soemthing or above?

bright spire
#

But I am not able to pass the skull textures

#

Yes

#

I am using 1.19

remote swallow
#
            PlayerProfile profile = Bukkit.createPlayerProfile(UUID.nameUUIDFromBytes(texture.getBytes()));
            PlayerTextures textures = profile.getTextures();
            try {
                textures.setSkin(new URL(TEXTURE_URL + texture));
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }

            profile.setTextures(textures);
            ((SkullMeta) this.meta).setOwnerProfile(profile);
#

would be something like that

#

texture url is http://textures.minecraft.net/texture/

bright spire
#

Wait so I have to recreate the profile?

#

Why isnt the old skull profile working?

remote swallow
#

if it isnt giving an error ive got no idea

bright spire
#

Its not giving any errors

remote swallow
#

you might

bright spire
#

Is there an alternative way to pass the texture?

remote swallow
#

not that i know of

tawdry parcel
remote swallow
#

unrelated but you can do TabComplete and the command in the same class

#

and you dont need to setTabCompleter

#

setExecutor does it

#

since always

#

ratio

tawdry parcel
remote swallow
#

you dont need the getCommand("nickname").setTabCompleter(new NicknameTabComplete()); if you do tab complete in the same class as the command

quaint mantle
#

Hi there! May I ask a question whilst there is already a question being answered, or must I wait?

remote swallow
#

ask away

quaint mantle
#

alright

remote swallow
quaint mantle
#

So, as of now, I'm trying to play around a bit with multi-protocol support without viaversion etc. and I was looking at wiki.vg for the loginstart packet:
https://share.sweetaurora.tech/leni3/navELito21.png/raw

However, weirdly enough, the has player uuid portion is never sent to me, making me unable to verify i.e. the public key and more, does anyone know what's going on?

#

as I can't imagine wiki.vg being wrong about this one

remote swallow
#

is the has player uuid true?

tawdry parcel
quaint mantle
#

It is not sent

#

the boolean

#

that entire field is missing

#

I read the following

#

String (name, is there)
Has Sig Data (true, is there)
all the other fields

#

and then it just ends at Signature

rotund ravine
#

is your server in offlinemode?

quaint mantle
#

Non

#

1.19.1/2 does send this field though

remote swallow
#

they dont exist pre 1.19.1 iirc

#

because messages and that werent signed before those versions

quaint mantle
#

Hmm, then, why is the key etc. being sent instead of i.e. nonce

#

and wiki.vg does mention the packet being this way, and as far as I can read matches until the last 2 fields

tawdry parcel
#

like this?

package com.koner.konerutils.nickname;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.List;

public class NicknameCommand implements TabExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        String nickname = args[0] == null || !args[0].equals("delete") ? args[0] : player.getName();
        player.setDisplayName(nickname);
        player.setCustomName(nickname);
        player.setPlayerListName(nickname);
        return true;
    }

    public class NicknameTabComplete implements TabCompleter {
        public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
            List<String> arguments = new ArrayList<>();
            arguments.add("s");
            arguments.add("name");
            return arguments;
        }
    }
}
remote swallow
#

just put the method directly in the NicknameCommand

undone axleBOT
tawdry parcel
remote swallow
#

or viaversion

tawdry parcel
#

Like this?

package com.koner.konerutils.nickname;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.List;

public class NicknameCommand implements TabExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        String nickname = args[0] == null || !args[0].equals("delete") ? args[0] : player.getName();
        player.setDisplayName(nickname);
        player.setCustomName(nickname);
        player.setPlayerListName(nickname);
        return true;
    }

    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
        List<String> arguments = new ArrayList<>();
        arguments.add("s");
        arguments.add("name");
        return arguments;
    }
}
remote swallow
#

yeah

tawdry parcel
#

perfect :D

remote swallow
#

if you want tab complete to respond to what they type use StringUtil.copyPartialMatches(args[num (starts at 0)], list, new ArrayList<>())

quaint mantle
#

I'll look into it

remote swallow
#

== 1 not 0 lol

#

args[] starts at 0, args.legnth starts at 1

#

if the legnth is 0 the theres no args

#

you probably need sleep

#

ago or for 12 hours

pseudo hazel
#

the only confusing part is that counting starts at 0 and not 1

remote swallow
#

sounds like its not a brain day

pseudo hazel
#

the rest should just make sense

remote swallow
#

is now the right time

#

havent touched packets and i really dont want to

#

couldnt tell you what there called but im guessing you would need to allow or send movement packets that allow people to go into blocks

#

and set them as not colidable and set them as invis

quaint mantle
#

@remote swallow thanks, got past it now

#

turns out it does not send UUID on 1.19

remote swallow
#

set the player you want to hide as colidable false

#

i would guess thats how that works

#

if not, good luck on scoreboard teams

#

looks like your gonna need scoreboard teams so they dont colide with online players

#

but online players can colide with online players

#

by online i mean alive

#

brain didnt brain

quaint mantle
#

Players collide on the client, so if they can't see the player they won't collide

remote swallow
#

omg

#

its loohp

#

the interactive chat guy

quaint mantle
#

Then something changed

#

because I recall hiding players and collision being gone automatically

#

Ohh right

#

The block disappears, right?

#

after attempted placing

#

yeah, it doesn't collide

#

that just the server going 'you can't place that here'

#

because of the player, no?

remote swallow
#

i scared the interactive chat guy off

#

he went to paper

sterile token
remote swallow
#

this is very sad

sterile token
#

Because You join paper and they put You in your place. So after some days they came back to spigot remastered tho

remote swallow
#

but interactive chat is great

#

i love it

sterile token
#

Oh it's a plugin

remote swallow
#

who

#

oh

#

yeah

#

i scared the guy that made it off, i think he was coming here asking for help

sterile token
remote swallow
#

lul

tardy delta
#

whats interactive chat

sterile token
sterile token
#

I thought it's was an author

tardy delta
#

ah that

remote swallow
#

sometimes people will get called thing-there-known-for guy

sterile token
#

Lmao i don't realize i can use this thing, it's perfect tho

Written by talpback

tawdry parcel
#

This error is multiple times in all of my files: Not annotated parameter overrides @NotNull parameter. How can I fix that?

package com.koner.konerutils.nickname;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;

public class NicknameCommand implements TabExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        String nickname = args[0] == null || !args[0].equals("delete") ? args[0] : player.getName();
        player.setDisplayName(nickname);
        player.setCustomName(nickname);
        player.setPlayerListName(nickname);
        return true;
    }

    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
        List<String> arguments = new ArrayList<>();
        arguments.add("set");
        arguments.add("get");
        arguments.add("delete");
        return arguments;
    }
}
bright spire
#

Skulls have no gameprofile for some reason

#

I need to get the GameProfile of the clicked skull to get its textures

remote swallow
quiet ice
sterile token
#

You cant get Game profile from a skulk

sterile token
tawdry parcel
remote swallow
#

all of them

#

after each comma needs one

quiet ice
#

If you were to use eclipse I'd know, but if you were to use IJ you'd surely know how to do it yourself given how easy to use it is (according to you guys that is)

tawdry parcel
quiet ice
#

Import NotNull from JB annots then

tawdry parcel
#

okay but i think i'll just turn off these errors in intellij

quiet ice
#

It should suggests turning off the warnings in IJ anyways

sterile token
#

Better bro

#

Those annotstion are annoying when usin IJ

tardy delta
#

@urban grotto is still there

sterile token
#

Oh lmao

marsh hawk
#

Not sure if the questions belongs here:
Is there any obligation to sell premium plugins on spigotmc?
Not as in a one time commission but more like a private collections of premium plugins with e.g a discord server?

vocal cloud
#

The benefit to selling on spigotmc is that more people will view it and trust it rather than from an external page.

marsh hawk
#

I understand. But would it be allowed?

undone axleBOT
vocal cloud
sterile token
quiet ice
#

why would it not be?

sterile token
#

Some months ago we did something similar and they banned our community spigot acc because we we're selling custom collection of plugin which we're managed by our custom page

vocal cloud
vocal cloud
#

See, that might violate the SpigotMC website ToS

#

But it doesn't violate the Spigot License you agree to when using the library

quiet ice
#

But selling outside of spigot? Fine, as long as you don't create a spigot acc for that

sterile token
#

I also dm optic but he didnt even answer tho and i get really sinxe that

remote swallow
#

optic doesnt read his dms i dont think

sterile token
#

Well i explained how it used to work, we we're listening to spigot buys to the plugin on our backend, so for downloading it You used to log on our site, why? Because our backend manage the downloads and plugin updates, etc. So once you log in on our site You can download ir from there the resource

remote swallow
#

that goes against premium rules

#

because the plugin wouldnt work if your backend went down

sterile token
#

No

#

Because the download button download the jar normally as every premium pl does it and the ñlugkn itself doesnt depend on the backend

#

There no rule is breaken

river oracle
#

wouldn't have been banned for no reason

#

if you believe its false

#

?support

undone axleBOT
sterile token
#

Lmao

#

They email never get answered

#

It's like dming to optic

remote swallow
#

md would respond probably

tardy delta
#

it cant read

#

it just read a hashmap import and assumed i was using a hashmap

rotund ravine
#

It isn't that great unless you ask it proper questions, and it's not great for super specific stuff sometimes

sterile token
#

How did u do that

#

I want to try it

tardy delta
#

i once visited md5's personal site and whenever i type "pa" in my browser it suggests me that site ;-;

#

and ofc it has bugs

worldly ingot
#

Sorry, your toString() really bothers me

StringBuilder sb = new StringBuilder();
if (this instanceof ValueHoldingNode) {
    sb.append("ValueHolding");
}
sb.append("Node{'").append(value).append("', children=");```
Massive no-no to check for subtypes in the parent. That's why we have overrides
#

I would override toString() in the child class and append ValueHolding in front of super.toString()

tardy delta
#

might just use getClass().getName() too

worldly ingot
#

Alternatively, could just append getClass().getSimpleName()

#

Yep

tardy delta
#

or simple name whatever

worldly ingot
#

Was a minor annoyance lol. Doesn't affect performance, only my soul

sterile token
#

I want to try that intelligence

tardy delta
#

how did i get what

sterile token
#

The mesaage You sent

sterile token
tardy delta
#

i sent it my code

#

chat.openai

sterile token
#

But how?

#

I don't understand un know that is used for looking info

tardy delta
sterile token
tardy delta
#

lol

#

i just pasted my whole class

sterile token
#

Ohh ok

#

I didnt know You we're able to do that

Written by talpback

tardy delta
#

ah yes Expression '4(5-1)' returned -4,0000000000, expected 16,0000000000

#

my 5 disappeared

sterile token
#

That is the query you sent to the AI

tardy delta
#

no

sterile token
#

So

#

Are u trolling

#

🤔😂

#

Also why many ppl prefer using shity plain NIIO socket instead of Netty? It's pretty important this question

tardy delta
#

whats wrong with it

undone axleBOT
sterile token
#

No?

#

Weird

#

My file handler doesnt mkdir?

tardy delta
#

ok copilot fixed it lol

#

really need to make things simpler cuz this looks awful

#

reading a simple number is even worse

sterile token
#

Oh lmao i realize why doesnt happen that issue My file handler use the next methods:

void createParent() throws Exception {
this.file.getParent().mkdir();
if (this.plugin.getResource(this.name) != null) this.plugin.saveResource(this.name, false);
this.createFile();
}

void createFile() throws Exception {
this.file.createNewFile();
}
tardy delta
#

why creating a new file after you just saved it

sterile token
#

That because in case You don't provide the scheme file, it Will create an empty file

#

If You don't provide the file in resource folder, would throw an Exception so instead of that i just create the file empty

#

What was the name of the module loader You recommend me?

#

ServiceLoader was named?

tardy delta
#

smth like that

ivory sleet
#

yes ServiceLoader

tardy delta
pseudo hazel
#

anyone here familiar with intellij crashing when I just want to select some words? it like freezes and then says low memory

tardy delta
#

CharacterData00 is a meme

wise pumice
#

Best way/API for player nametags? No nametagedit because it's old and has a lot of bugs.

tardy delta
#

thats not even 1/10th of it

zinc egret
#

how can i read the config of another plugin?

tardy delta
#

20k bytes character property tables 💀

wise pumice
hazy parrot
tardy delta
#

rust user i see

hazy parrot
#

Or just get file as suggested

tardy delta
#

PluginManager#getPlugin(String)

#

which returns a Plugin and #getConfig exists ther

#

assuming you know its name

zinc egret
hazy parrot
zinc egret
hazy parrot
#

I like simple yaml, it's same api as bukkit's

zinc egret
#

I'll try it later thanks

small timber
#

eclipse doesn't seem to be working for me, i added a spigot 1.8.8 library and after i import the package it says the JavaPlugin class doesn't exist, even though it does

sterile token
#

I have My own FileHandler which extends YamlConfiguration (bukkit yaml api) and works amazing. Never have any type of issue

undone axleBOT
small timber
#

?

#

1.19 doesn't even allow me to import the package

#

soo

sterile token
#

Also for coding i would never suggest Eclipse, i would even use Vscode over that thing

tardy delta
#

eclipse user, go to the shame corner

small timber
#

wow ok

topaz cape
#

stop

small timber
#

what do u use then

tardy delta
#

intellij

sterile token
topaz cape
#

this isn't even close to java

sterile token
#

Intellij is the most widely IDE use

tardy delta
#

people thinking 20L is any different than 20

topaz cape
#

also you don't change the entity id through entity class

sterile token
hazy parrot
tardy delta
#

compiler fixed it

topaz cape
#

he's just throwing random links

small timber
topaz cape
#

and some weird weird code

small timber
#

a lot of people use 1.8.8 and play on 1.8.8 servers

pseudo hazel
#

well its just not very widely supported by developers afaik

remote swallow
tardy delta
#

most people here refuse to give any support for it

pseudo hazel
#

only exceptions are dev teams for big servers

#

but those dont need support

topaz cape
#

you have more knowledge ig

sterile token
#

I'm cellñhone k Will do My Best

#

Oh sorry i never used Packets if not i would help

topaz cape
#

hmm thank you

sterile token
#

Sorry tho

tender shard
topaz cape
#

Alex

#

can ya take a guess

#

maybe you're more experienced in packets duke

#

actually i find something interesting

#

if the disguised player walks on undisguised players in the Nether it works fine

#

but if its the other way around it doesn't

#

ugh i would ping Choco but i dont like pinging without permissions 😦

remote swallow
quaint mantle
#

Does anyone know how I can dye a material item in 1.8? Specifically STAINED_GLASS_PANE

#

ItemStack fill = new ItemStack(Material.STAINED_GLASS_PANE, 1, (byte) 9);

#

is what I have so far

tender shard
remote swallow
tender shard
#

I never dreamt about maven

#

I dreamt about a sql library

remote swallow
#

ah

tardy delta
#

he was touching sql

tender shard
#

i don't like sql

quaint mantle
#

let alone a stained glass pane.

tender shard
#

show your full code

remote swallow
#

would BookMeta serializer be in craftbukkit or bukkit

tender shard
#

CraftMetaBook -> CB

remote swallow
#

ah

quaint mantle
#
public static void openMainBankMenu(Player player){
        Inventory mainbankergui = Bukkit.createInventory(player, 9, ChatColor.translateAlternateColorCodes('&', MCBanker.getInstance().getConfig().getString("BankerName")));

            // Fill Item
                ItemStack fill = new ItemStack(Material.STAINED_GLASS_PANE, 1, (byte) 9);
                ItemMeta fill_meta = fill.getItemMeta();
                fill_meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', MCBanker.getInstance().getConfig().getString("FillerName")));
                fill.setItemMeta(fill_meta);
            // Deposit Item
                ItemStack Deposit = new ItemStack(Material.matchMaterial(MCBanker.getInstance().getConfig().getString("DepositMaterial")), 1);

                ItemMeta deposit_meta = Deposit.getItemMeta();
                deposit_meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', MCBanker.getInstance().getConfig().getString("DepositName")));
                ArrayList<String> deposit_lore = new ArrayList<>();
                deposit_lore.add(ChatColor.translateAlternateColorCodes('&', MCBanker.getInstance().getConfig().getString("DepositLore")));
                deposit_meta.setLore(PlaceholderAPI.setPlaceholders(player, deposit_lore));
                Deposit.setItemMeta(deposit_meta);
        // Withdraw Item
                ItemStack Withdraw = new ItemStack(Material.matchMaterial(MCBanker.getInstance().getConfig().getString("WithdrawMaterial")), 1);

                ItemMeta withdraw_meta = Withdraw.getItemMeta();
                withdraw_meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', MCBanker.getInstance().getConfig().getString("WithdrawName")));
                ArrayList<String> withdraw_lore = new ArrayList<>();
                withdraw_lore.add(ChatColor.translateAlternateColorCodes('&', MCBanker.getInstance().getConfig().getString("WithdrawLore")));
                withdraw_meta.setLore(PlaceholderAPI.setPlaceholders(player, withdraw_lore));
                Withdraw.setItemMeta(withdraw_meta);
        // CreateGUI
            mainbankergui.setItem(3, Deposit);
            mainbankergui.setItem(5, Withdraw);

        player.openInventory(mainbankergui);
    }
#

mmm formatting

tender shard
#

you create a "fill" ItemStack and then never use it for anything

quaint mantle
#

idk mayn

#

well

#

oh wait i just sent my old ass one

#

hol on

quiet ice
#

How do you call that tree-like structure that recursively divides the space into four child nodes? Kinda forgot the name 😅

remote swallow
#

naming conventions out the window

quiet ice
#

Yep, thanks

tardy delta
#

<insert itembuilder here>

quiet ice
#

I always think it's quaternion, but it isn't. My brain is a fool sometimes

tardy delta
#

and ofc i didnt see alex before

pseudo hazel
#

octree is cooler

fluid river
#

PhotovoltaicJump: paid java lessons

remote swallow
#

FAEE JRVA LESSONS

tardy flame
#

FRAE JAVA LESSONS

daring lark
#
                .forEach(p -> {
                    if(p.getName().equals("listener")) {
                        
                    }
                });```

how could i get all listeners in this package using reflection?
quiet ice
#

SELF LEARNING EXERCISE

daring lark
vale ember
#

wdym you can use class loader?

quiet ice
#

But uh, that is an enormous dependency

vale ember
#

a few of the answers doesn't use any libraries

#

there are also options with Guava which is included with spigot

quiet ice
#

But hey, it might be more economical to use cafed00d, asm (though be aware that that one doesn't always work if you are doing stupid stuff with obfuscation), or similar libraries

daring lark
vale ember
#

well it uses ClassLoader.getSystemClassLoader, but spigot implements it's own for plugins, so there's a chance it might not work

quiet ice
#

(i.e. it does not work)

vale ember
#

if you replace the ClassLoader.getSystemLoader() with plugin.getClass().getClassLoader() it should work ig

quiet ice
#

I don't believe that that works at all

vale ember
#

why tho?

eager flax
#

How do I make it so when they click while holding an item it opens a gui?

vale ember
#

listen to player interact event

eager flax
#

yeah I did that

#

but its bein weird

#

holup ill show you

quiet ice
eager flax
#

package Listeners;

import net.md_5.bungee.api.chat.ClickEvent;
import org.bukkit.entity.Item;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;

import javax.swing.*;

public class opengui implements Listener {

@EventHandler
public void onOpenGui(PlayerInteractEvent e){

Item itm = e.getItem();

    












}

}

#

im tryna make a variable

quiet ice
#

Folders should be openable through input streams... but whatever

eager flax
#

for the item

#

but its not workin

quiet ice
#

Remove the javax import, you 100% don't want that

#

Else, you might have issues on macos

eager flax
#

ight

#

but my variable

#

@EventHandler
public void onOpenGui(PlayerInteractEvent e){

Item itm = e.getItem();
vale ember
#

ohh

eager flax
#

the item one

quiet ice
#

It's ItemStack

#

not Item

eager flax
#

oh mb

#

item stack aint an option tho

#

wait ik what to do nvm