#help-development

1 messages ยท Page 2231 of 1

dusk flicker
#

please

raw sky
#

:kekw: I just looked back up

dusk flicker
#

this is legit like the perfect instance where you create an object for it

raw sky
#

so uh

#
            FileConfiguration yConfig = YamlConfiguration.loadConfiguration(getPlayerDataFile(player));
            yConfig.save(getPlayerDataFile(player));
``` do you know whats wrong with this ๐Ÿ˜
dusk flicker
#

i dont know if I want to know whats wrong with it

raw sky
#

you dont

#

I have been doing this for so long today

#

barealy any sleep

dusk flicker
#

you could put getPlayerDataFile as a variable rather than calling it twice

raw sky
#

I mean

#

yea

#

I just

#

have tried different things then I gave up

dusk flicker
#

is the file not being created?

raw sky
#

it is

#

no errors in console

dusk flicker
#

it is being created?

raw sky
#

yea

dusk flicker
#

so it just not saving?

raw sky
#

yea

#

I think its being edited dont know for sure

dusk flicker
#

so in your class up there you have getPlayerFileConfiguration which does the same thing but you are loading it via yamlconfiguration but returning it as a fileconfiguration

#

if you switch that to return a yaml config, you might be able to remove the overhead of having to create a new instance of it to save

#

I am also very tired so I probably will miss something sooner than later lol

raw sky
#

and should I keep yConfig.save(getPlayerDataFile(Player))?

#

your good dont worry, any help is appreciated

#

even if its wrong, atleast I still learn

dusk flicker
#

I would set a var of yamlconfig to the getPlayerFileConfiguration previously mentioned, then call the var.save(var)

#

I find it interesting that it doesnt use the stored path

#

actually for the save your getplayerdatafile might be fine

raw sky
#

hmm nope still at 2 deaths (which was 0 before I changed it manually)

raw sky
#

or is it just the same

dusk flicker
#

var being the new yamlconfig

raw sky
#

but in var.save(var)

dusk flicker
#

so var.save(getPlayerFileconfig)

#

try that thingy

#

gonna be honest if it doesnt work ima let someone else hopefully give it a shot as I am tired, and not great with yaml configs lol

raw sky
#

hmm nope, but tysm for the help! Ill look into that static abuse too ๐Ÿ‘€

#

have a good day!

eternal oxide
#

Show some code. It seems to be loading fine, so show your saving code

raw sky
#

.

#

click the expand button

eternal oxide
#

looking now

humble tulip
#

I'm storing items in a database and am currently using MEDIUMTEXT since i convert the ItemStack[] to a byte[] and then to a base 64 string however mediumtext has a limit of 16mb which is probably not enough since i want to offer the opportunity for the plugin to have "infinite" storage. I saw LARGETEXT has a limit of 2gb which is unrealistic to surpass so should i use that or should i use Blob?

eternal oxide
# raw sky

from what I can see your savePlayerDataFile(Player player) loads the data before saving. so its wiping out any changes you made.

raw sky
#

so remove that and replace it with something else?

sharp flare
#

you have static methods but never use them?

eternal oxide
#

Then save that

#

You are currently loading a fresh copy from file and saving

#

this method never stores anything java public static File getPlayerDataFile(Player player) { return new File(dataFolder, "player data" + File.separator + player.getUniqueId() + ".yml"); }

raw sky
eternal oxide
#

it just returns a FileConfiguration. You need that instance passed back to a save method

#

The statics are not too bad. if you got rid of most (as they are not needed) and remove the static FileConfiguration config;

#

If its a static class you shoudl not be storing that

#

If you want to keep the static you should change public static void create(Player player) throws IOException { to return a FileConfiguration

raw sky
#

or is it just in general for the future

eternal oxide
#

one sec

raw sky
#

kk

#

OOps wait I thought you said saveDataFile my bad

#

what would go right here then? since I can only change a config file if im correct

#

and if I get the fileConfig then it would load the file

eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

you hold a reference to the returned FileConfiguration and return it to be saved

raw sky
#

oh my god you are a life saver

#

thank you so much

eternal oxide
#

you can actually delete + File.separator from the end of the folder field

#

not needed

worldly ingot
#

Also, spaces in file names = no no

#

Or folder names, whatever

humble tulip
#

should i even be using text or should i use nvarchar?

eternal oxide
#

Fill a max size inventory (modded chest) with stacks of stone and serialize it. See what size teh data is. add 20% on top for variations (enchants etch) and that will be your max data size

#

MEDIUMTEXT should be fine for saving inventories

humble tulip
#

it's not just an inv

#

it can be 1000+ items is some server owners wanna get crazy

eternal oxide
#

they should not be storign 1000+ items in a single table entry

humble tulip
#

well technically i am ๐Ÿ‘€

#

i just didnt set a limit

eternal oxide
#

an inventory, yes. 1000+ items in one blob, no point

humble tulip
#

what do you suggest then?

eternal oxide
#

control how many items you are storing in a single Base64

humble tulip
#

i hate putting a hardcoded limit

eternal oxide
#

What are these 1000+ items you want to put in one MEDIUMTEXT?

humble tulip
#

it's player storage

#

like vaults

eternal oxide
#

Then it should be limited by a players inventory capacity

#

what a vaults size limit?

humble tulip
#

well yes but it's pagniated

#

so there is no defined limit

eternal oxide
#

then save each page

humble tulip
#

then i need a column for each page?

eternal oxide
#

each page will have a hard cap then

humble tulip
eternal oxide
#

an entry per page

#

a table with owner, page and contents

#

a key pair of owner and page

humble tulip
#

hm

#

that makes sense

#

am i doing this for curroption prevention?

eternal oxide
#

no, just so you don;t have a mega blob of data pumped into sql

humble tulip
#

it probably wont ever go past like 30mb

eternal oxide
#

its not what sql is designed for

#

you may as well save to file if you are blobbing everything

humble tulip
#

isnt that the point of the blob datatype tho?

eternal oxide
#

BLOB stands for Binary Large Object and this type of storage is generally used for storing media like images, videos, etc.

#

Yours is not a true blob

#

yours is lots of individual items

humble tulip
#

ok hear me out, what is bad abt this? because splitting into pages vs throwing it into one entry it's the same end result right?

eternal oxide
#

not really. If its all one blob you have to read and write the whole thing at once

humble tulip
#

i'm going to cache it all at once anyways

#

for online players

#

most servers using the plugin probably wont even go that far

eternal oxide
#

Well in the end its upto you how you store it. Myself I'd not go above MEDIUMTEXT for this

humble tulip
#

max like 500 items maybe

visual tide
#

iirc thats only possible via command

#

so listen for CommandPreprocessEvent

worthy yarrow
#

I'm trying to make a gui with a clickable rewards claim system, ```Player p = (Player) e.getWhoClicked();

            if (UUIDs.contains(p.getUniqueId())) {          

                p.closeInventory();
                p.sendMessage(ChatColor.DARK_RED + "You have already claimed your rewards!");

            } else if (!UUIDs.contains(p.getUniqueId())) {  

                switch (e.getRawSlot()) {               


                    case 4:
                        UUIDs.add(p.getUniqueId());
                        p.closeInventory();
                        p.sendMessage("AAAA");

                        break;

                    default:

                        return;

                }
            sender.sendMessage("give " + p.getDisplayName() + " cobblestone 1");
            p.closeInventory();``` problem's I'm having is that the player can take items in/out of the gui and nothing happens when you click on the EnderChest in the middle
#

        
        if (sender instanceof Player) {
            Player p = (Player) sender;

                //Functionality for the gui.

                Inventory inven = Bukkit.createInventory(p, 9, ChatColor.GOLD + "Trailer Repost Rewards!");
                ItemStack MonthlyCrate = new ItemStack(Material.ENDER_CHEST);
                ItemMeta meta1 = MonthlyCrate.getItemMeta();
                meta1.setDisplayName(ChatColor.YELLOW + "Monthly" + ChatColor.RED + "Crate " + ChatColor.GRAY + ("(Click to claim your repost rewards!)"));
                MonthlyCrate.setItemMeta(meta1);
                inven.setItem(4, MonthlyCrate);
                p.openInventory(inven);


        }``` my gui
sharp flare
#

You gotta cancel the click event

#

But make sure it is on the right inventory view

worthy yarrow
#

I think I tried that, should I write it under: if (ChatColor.translateAlternateColorCodes('&', e.getView().getTitle()).equals(ChatColor.BLACK.toString() + "Trailer Repost Rewards!")

#

                && e.getCurrentItem() != null) {```
sharp flare
#

Yeah

#

If its the correct inventory holder too

#

Just make checks then cancel, profit

worthy yarrow
#

so something like if (e.getClick().isLeftClick(){ }

sharp flare
#

Not necessary, just cancel it when the conditions are met

#

Or items will be taken out of the inventory

worthy yarrow
#

ok and in the switch method, my outcomes aren't working when I click on the 5'th slot of the gui

#
                            e.setCancelled(true);
                            UUIDs.add(p.getUniqueId());
                            p.closeInventory();
                            p.sendMessage("AAAA");

                            break;```
sharp flare
#

Output the raw slot num when u click to the console or chat

#

Then verify it

worthy yarrow
#
                            e.setCancelled(true);
                            UUIDs.add(p.getUniqueId());
                            p.closeInventory();
                            p.sendMessage("AAAA");
                            System.out.println(e.getRawSlot());
                            break;``` this is what I added, tested and nothing came out to console or in chat
sharp flare
#

Print it before the switch

#

That will never get fired if its not the right slot

#

So you gotta do it before the switch by printing the raw slots

#

From there make ur assumptions

worthy yarrow
#

I'm wanting case 4 to be the only thing the player clicks, when they click it then I want to run a console command that /gives player rewards

sharp flare
#

Read what I said above

#

Its a simple debugging

#

And u can use #broadcastMessage instead of sout

humble tulip
worthy yarrow
#

no

humble tulip
#

if not, cancel as soon as you check that the clicked inv is yours

harsh totem
#

how can I get an arrow's modelData in EntityShootBowEvent?

humble tulip
#

custom model data?

harsh totem
#

yes

humble tulip
#

getConsumable

harsh totem
#

what

humble tulip
#

one sec

#

let me check

harsh totem
#

k

humble tulip
#

yes event.getConsumable

#

gives the itemstack

#

then get custommodeldata frm that

harsh totem
#

it gives the arrow itemStack?

#

or the bow

humble tulip
#

item

harsh totem
#

ok thank you

humble tulip
#

click the link i sent

harsh totem
#

is there a way to get an arrow itemStack from an arrow entity?

#

I can't use getConsumable() this time because it's in entity death event

lethal knoll
#

When using ConfigurationSerialization, is it normal that you will have this this ==: me.mrgeneralq.sleepmost.models.Dream <-- being the class path always there? My concern is if I ever re-organize the structure of my classes, it would break

near crypt
harsh totem
near crypt
#

Wdym with costum arrow?

harsh totem
near crypt
#

Oh okay

#

I don't know but I think when a arrow is fired (it is now an entity) it loses its itemdata because it is not a item anymore

harsh totem
#

yes that's the problem

#

im gonna save the fired arrow in hashMap with EntityShootBowEvent and then check if the arrow that killed the mob is in the hashMap

near crypt
#

But you can check it otherwise you can just check if the number of the arrows in the inventory with this specific data is getting lower

harsh totem
worthy yarrow
#

Is there a way I can make a player send a command upon completion of a certain condition?

agile anvil
agile anvil
agile anvil
worthy yarrow
#

I think I got it figured out, I wanted console to send it anyways

agile anvil
#

There is a packet for it but you can't directly send it to the player that you want to lay down as I know.
Other solution if you want to make it : create a fake entity, lay down that entity and make the player invisible

earnest forum
#

In this episode of the Spigot MC Plugin series, I start a new plugin called Bodied. This plugin makes it so when a player dies, an NPC is spawned using NMS and is made to lay down and have no nametag. In the next parts of this plugin's development, I will show you how to put items in the body once the player dies, and if no one claims it after a...

โ–ถ Play video
#

find the part you need

#

theres a part 2

#

just like skim through it

#

i dont know exactly how but ive watched this before and it shows u how to

agile anvil
earnest forum
#

its for entity player but should in theory work for regular player if u cast

worthy yarrow
#

        ArrayList<UUID> UUIDs = new ArrayList<>();


        if (ChatColor.translateAlternateColorCodes('&', e.getView().getTitle()).equals(ChatColor.GOLD.toString() + "Trailer Repost Rewards!")  //This is a conditional checking for the opened inventory.

                && e.getCurrentItem() != null) {
            Player p = (Player) e.getWhoClicked();
            ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
            String command = "mcrate give " + p.getDisplayName() + " june 1";

            e.setCancelled(true);
            if (!UUIDs.contains(p.getUniqueId())) {  //Checks for the players UUID in the arraylist to add protection from players claiming rewards over and over again.
                UUIDs.add(p.getUniqueId());
                TrUUIDs.add(p.getUniqueId());
                if (e.getRawSlot() == 4) {               //Functionality of the gui.
                    if (UUIDs.contains(p.getUniqueId())) {
                        if (p.isOp()){
                            p.closeInventory();
                            p.sendMessage(ChatColor.GRAY + "You have claimed your rewards!");
                            Bukkit.dispatchCommand(console, command);
                        } else {
                            p.closeInventory();
                            p.sendMessage(ChatColor.DARK_RED + "You have already claimed your rewards!");
                        }
                    } else {
                        p.closeInventory();
                        p.sendMessage(ChatColor.GRAY + "You have claimed your rewards!");
                        Bukkit.dispatchCommand(console, command);
                    }```
#

        //Checking the player's permissions.
        if (sender instanceof Player) {
            Player p = (Player) sender;

                //Functionality for the gui.

                Inventory inven = Bukkit.createInventory(p, 9, ChatColor.GOLD + "Trailer Repost Rewards!");
                ItemStack MonthlyCrate = new ItemStack(Material.ENDER_CHEST);
                ItemMeta meta1 = MonthlyCrate.getItemMeta();
                meta1.setDisplayName(ChatColor.YELLOW + "Monthly" + ChatColor.RED + "Crate " + ChatColor.GRAY + ("(Click to claim your repost rewards!)"));
                MonthlyCrate.setItemMeta(meta1);
                inven.setItem(4, MonthlyCrate);
                p.openInventory(inven);
#

I'm making a custom gui for when a player clicks my item in the gui it will give them a monthly crate

#

if they have the permission that is,

#

and it works

#

amazing

earnest forum
#

why are you translating the inventory title?

hushed spindle
earnest forum
#

surely you aren't setting the title to &4Monthly &3Crate

#

when you get it

#

it has the formatting

worthy yarrow
#

to be fair this is how I've been doing guis, since i watched the stephen king udemy course

#

so its just how I've been writing them

earnest forum
#

and you dont need to use ToString on chat colours since the + keyword does that

worthy yarrow
#

alright

earnest forum
#

well string stuff can get pretty heavy if you do it a lot

worthy yarrow
#

Well I'm just surprised I got everything I wanted to work

earnest forum
#

first try?

worthy yarrow
#

no def not lol

earnest forum
#

ah

worthy yarrow
#

this has been a day project

earnest forum
#

first try's never work in spigot ๐Ÿ˜ž

worthy yarrow
#

30 hrs mostly just tweaking and debugging it to be honest

#

I had the majority of this working yesterday

#

but now its done

#

so im happy

agile anvil
earnest forum
#

small chance

#

a miracle it does

worthy yarrow
#

Thanks for the help guys

agile anvil
#

Try letting it to null

#

Not sure at all

agile anvil
#

You have to change the GameProfile

#

Is craft player the entity you're creating or a real player ?

#

Exactly what you did

#

What is the lign you get this error ?

#

Looks like you're maybe sending a too long player name

glossy venture
#

yeah

#

you cant add the color without removing some of the other string

#

otherwise the string length will exceed 16

#

maybe hide the name and place an armor stand above it

#

and then put the full name in there

eternal night
#

Or do colour with a team

glossy venture
#

oh yeah

#

possible too

short raptor
#

Is there really no way to know if a player was damaged/killed by another player apart from parsing the death message?

#

๐Ÿ’€

eternal night
#

I mean

hushed spindle
#

is playerdeathevent and getLastDamageCause not sufficient?

eternal night
#

getKiller exists

chrome beacon
#

^^

hushed spindle
#

oh you want to cancel a death event?

#

then listen to a damage event instead and check if the players health minus event.getFinalDamage() is less than or equal to 0

#

you can cancel that damage event

eternal night
short raptor
#

Thanks so much I have tried to find this for so long lol

#

Ig my searches were not right

hushed spindle
#

and does that not work?

#

oh cool

#

rad

eternal night
#

I mean

chrome beacon
#

Remember to use getFinalDamage

eternal night
#

that will only work if the last damage was actually the player, so like

#

player shooting another won't work with that

#

or player knocking someone to death won't trigger that either

hushed spindle
#

then you need to get the shooter of that projectile instead

#

im also gonna need some help, im trying to get nms to work so currently im using mojang mappings but the maven specialsources plugin isn't re-obfuscating my nms code so on servers it doesnt actually work

#

keep getting nosuchmethoderrors and all

agile anvil
hushed spindle
#

i know i have the specialsource plugin installed and im packaging with maven but the plugins dont seem to actually be obfuscated

eternal night
#

can you share your pom

hushed spindle
#

whats the paste command again

eternal night
#

?paste

hushed spindle
#

?paste

undone axleBOT
eternal night
#

lol

hushed spindle
#

i know i got some dependency duplication but eh

eternal night
#

why do you have multiple mapped spigot deps

#

I mean, are you sure that you are using the right one ?=

tender shard
eternal night
#

the plugin will only reobf one

tender shard
#

use modules bro

eternal night
#

^

tender shard
#

I mean, this might have worked on old versions, where the NMS version was in the package name

near crypt
hushed spindle
#

so its not working because i got duplicated dependencies

tender shard
#

for example PlayerChangedWorldEvent is just a "monitor" event. You cannot cancel it etc, and it gets called AFTER the palyer has changed worlds

hushed spindle
#

though most of the time yeah it is the case that events are called before they actually happen

tender shard
#

yes, most of the time that's true

hushed spindle
#

are modules something that i can get it to generate automatically or do i just manually copy that file structure you linked

#

is that something maven just does for me

summer scroll
#

you need to do it manually

agile anvil
#

You sure?

summer scroll
#

maven will handle the compilation

near crypt
agile anvil
#

You just have to add it to your maven dependencies, and shade it into your plugin

tender shard
#

haven't read the full conversation

hushed spindle
#

i just nuked the whole thing, im starting over lol

#

why's nms gotta be such a mess to work with

summer scroll
#

try the obfuscated one lmao

hybrid spoke
#

because you are not supposed to work with it

sharp flare
#

Haven't touch nms either

#

Since it ain't an api

hushed spindle
#

i mean i would like to not have to work with nms but unfortunately i have to due to a spigot bug

summer scroll
#

what bug?

vocal cloud
#

1.8.8 probably

hushed spindle
#

like im trying to make an extra attack range attribute but under specific circumstances no interact event is being fired

#

1.19

#

so i cant actually detect when a player is left clicking a weapon

native gale
#

Can someone explain please, why compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' should be compileOnly and not implementation?

vocal cloud
#

Doubt there is a bug with the interact event THONK

summer scroll
#

dependency that use compileOnly, the code will be available at the runtime.

summer scroll
native gale
#

Isn't it opposite?

hushed spindle
#

like i said, it's a specific

#

you gotta be just barely out of range to actually attack but in range to be able to target blocks

#

and if an entity were to block that line of sight no event is being fired at all

summer scroll
native gale
#

afaik implementation is runtime + compile

hushed spindle
#

so my extra range attribute sometimes doesnt work

summer scroll
#

implementation is like including the code into your final jar, so it will affect your file size.

leaden gust
charred blaze
#

i have a question

hushed spindle
#

ask and ye might receive

charred blaze
#

if i blacklist word on AsyncPlayerChatEvent will it also blacklist commands which contains blacklisted word?

hushed spindle
#

i dont believe so

charred blaze
#

hm

hushed spindle
#

commands use a different event from chat messages

charred blaze
#

ok

#

i have also another question

#

how to get command as a string

#

like

#

if i execute /i am greened

#

it returns iamgreened

hushed spindle
#

i mean just listen to a command event and combine the command name plus args i guess

hushed spindle
#

wdym how just listen to the event

#

seems that PlayerCommandPreprocessEvent has a getMessage() method too so you can just get the raw message i think

charred blaze
#

dont u use this? public boolean onCommand(CommandSender sender, Command command, String label, String[] args)

hushed spindle
#

you'd need to register the commands for that

#

but it seems that you're trying to specifically look for any command the player sends

#

what are you trying to do

charred blaze
#

commands

#

which

#

contains

#

blacklisted word

hushed spindle
#

yeah then you want to listen to the command event

#

not use CommandExecutor

#

if you want to cancel only your own commands with blacklisted words then yeah you use CommandExecutor

charred blaze
#

use this PlayerCommandPreprocessEvent event?

hushed spindle
#

yes

charred blaze
#

is it

hushed spindle
#

just make a listener for that event

charred blaze
#

working on any cmd?

hushed spindle
#

check if the message has a blacklisted word

#

cancel if it does

#

yeah

charred blaze
#

hm wait

eternal oxide
#

If you are wanting to censor every command for every plugin you use pre process

half sinew
#

anyone know how to get the person who lit tnt
like say i light tnt and it damages another player how would i get the person who lit the tnt in the EntityDamageByEntityEvent if that is at all possible

eternal night
charred blaze
#

its working now thx

half sinew
#

thank you

covert karma
#

what would be the best way to make multiple plugins be able to use the action bar at the same time?
i made a library plugin that allows doing that, but obviously that requires all plugins to use that library instead of sending action bar messages manually. is there like an already standardized way of doing this?

tender shard
#

it's like a shitty version of PDC

subtle folio
#

but not good for idโ€™s / storage

worn tundra
#

True

eternal night
#

Well, would not call metadata too temporary either

#

you have to manually clean that up on entity removal

#

where as the PDC is removed with the entity

worn tundra
#

I assumed metadata resets automatically as well?

#

And doesn't persist through restarts

eternal oxide
#

metadata does not persist

subtle folio
#

store all player stats in metadata ๐Ÿ˜ˆ

eternal night
#

I mean, metadata does not reset itself on entity removal

#

if your projectile dies

#

you need to remove the metadata from the server, otherwise you are leaking

eternal oxide
#

When the entity is removed the metadata goes with it

eternal night
#

Are you sure about that

eternal oxide
#

yes

#

put metadata on a snowball

eternal night
#

I have doubts

#

metadata does not live on the entity

#

it lives in a giant hashmap on the server

eternal oxide
#

isn;t it a weak hashmap stored under teh entity though?

#

?stash

undone axleBOT
eternal night
#

no

#

it is not

#

each "metadata" thing basically just has a method to convert itself into a unique id

#

which is thrown into a giant hashmap as a key + the metadata key

#

Like yea it is a weak hashmap

#

but that is for the plugin unloading

#

not the entity reference

halcyon mica
#

Has anyone experimented with custom shaders mixed with some server trickery yet?

#

I have seen a server literally do a functional minimap server-sided with nothing but a resourcepack, and I have no fucking idea how

#

And custom HUD elements that don't rely on all that font trickery is something I am very interested in

mortal hare
halcyon mica
#

The problem with fonts is how akward it is to actually position and update individual elements

#

Hell, you need to do some weird negative width character bs to position stuff

mortal hare
#

well you cant do custom UI's without some hacky trickery

halcyon mica
#

Shaders exist

#

And based on what I've been shown, they can do some impressive stuff even on clients

mortal hare
#

๐Ÿค”

#

this seems impressive

#

but it requires fancy graphics

#

probs

halcyon mica
#

Unlikely

#

The rendering pipeline has long been shader based

eternal oxide
eternal night
#

๐Ÿ‘

#

moral of the story. Don't use metadata for anything

#

just PDC it

#

or have your own Map<UUID, Data>

eternal oxide
#

or remove it when finshed

mortal hare
#

just use

eternal night
#

or that, but dunno if spigot has the entity removed from world event stuff yet

mortal hare
#

nbt compound tags

eternal night
ivory sleet
#

Oh yes the meta data implementation is intriguing in many ways kek

eternal oxide
#

I guess its best to not use Meta that much

halcyon mica
#

I've been trying to figure out how to do it

#

But there is very little to none documentation or source available

#

With no client mods

eternal oxide
halcyon mica
#

So, anyone got any clue how this could work?

eternal night
#

isn't the inner map a weak one

#

and w/e, on paper the outer one is a concurrent one anyway ๐Ÿ˜›

summer scroll
twilit roost
#

any way to create Custom Fog?

hybrid spoke
halcyon mica
#

Rendering graphics like this via a shader, and updating it from the server in a consistent way

#

Because you can't serve custom data to shaders on the client

#

But clearly there seems to be a way to do so, as the minimap rotates in sync with the camera and moves with the players position, and that little circle not only takes rotation but also distance into account

quaint mantle
#

I try not to come here but I'm really not sure of how to make it work. So, I'm unsure of how to get a target into my menu listener. So, pretty much I want to make a punish GUI. I've made the GUI and it all works as I want that to, but in terms of the listener to actually perform commands I am unsure of how to get the target into that part as well, any ideas? (Information: I'm using 1.8 and I'm a complete noob with Java but the little experience I have with making Discord bots with it)

vocal cloud
#

Ah the bane of all devs. 1.8

hybrid spoke
subtle folio
#

e.getWhoClicked()?

eternal oxide
#

is that YT Bedrock? I've never seen Bedrock

hybrid spoke
quaint mantle
halcyon mica
#

And a completely unmodded client

#

Only a server resourcepack and a minestom server

subtle folio
hybrid spoke
halcyon mica
#

(The latter of which doesn't really mean much)

quaint mantle
quaint mantle
eternal oxide
#

Mobs coming up out of teh ground, really slow arrows. Those are not valilla (unmodded) client

subtle folio
#

Bukkit.getPlayer(args[0]);

#

pass the target as one of your args in ur gui

halcyon mica
#

It's a Minestom server, meaning all entity behavior is custom made

#

It's all armorstand animations and resourcepack resources

quaint mantle
hybrid spoke
#

and whats the question?

hybrid spoke
#

how to make a minimap?

halcyon mica
#

Rendering a minimap like that via shaders, and how to control the parameters

hybrid spoke
#

thats all clientside

halcyon mica
#

Because you can't directly pass parameters to a shader

hybrid spoke
#

a shader is also just code which gets executed

eternal oxide
halcyon mica
#

...yes, and I am asking how one would approach that with respect to the minecraft rendering system

subtle folio
#

?paste

undone axleBOT
hybrid spoke
halcyon mica
subtle folio
quaint mantle
halcyon mica
#

And removed the offhand slot texture

subtle folio
eternal oxide
subtle folio
#

then make a private variable for the target inside of its constructor

quaint mantle
#

Okay, thank you

halcyon mica
eternal oxide
#

How? S and F generate no packets

halcyon mica
#

You handle packets manually and individually in minestom, they are not consolidated into things like a move event

#

The client sends a move update packet every time the key is pressed

#

Not just every tick

eternal oxide
halcyon mica
#

...you know pressing s makes the player entity move right

#

And thus sends a move packet

eternal oxide
hybrid spoke
halcyon mica
#

What

subtle folio
#

i love english

hybrid spoke
subtle folio
halcyon mica
#

Oh for fucks sake

eternal oxide
#

actually S is backwards

halcyon mica
#

Yes, S is backwards

#

Any kind of move action on the client sends a move packet to the server, which the server processes as necessary

eternal oxide
#

right at teh start of the video he demos his dart

halcyon mica
#

The vanilla server and derivatives consolidate move packets collected every tick into a single move event and process that

#

But in a enviroment where you handle packets yourself as they arrive, you can instead queue up something like the dash, rather than the normal behaviour

#

it's not exactly rocket science

#

Regardless, that's not really the question

eternal oxide
#

The question was on shaders

halcyon mica
#

I need to find at least a starting point to be able to control properties on the client as the server, which allows the shader to render in respect to those clients

#

But since you can't directly pass data like that, there has to be a trick to it

#

it's not font UI, because smooth rotation like that is not possible through it

#

Spooky mysterious minimap

covert karma
#

Bukkit.getServer().getPlayer(args[0])

summer scroll
#

@halcyon mica so he's using Minestom?

halcyon mica
#

Looks like it

summer scroll
#

That explains a lot

halcyon mica
#

But minestom is just a server implementation

#

The magic here is happening in the shader

#

Because the protocol does not provide a way to control the parameters of shaders

covert karma
#

why does the player not have the suffix in their name tag?

Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Team team = board.registerNewTeam(player.getName());
team.addPlayer(player);
team.setSuffix("test");
#

it just doesnt show up anywhere

mortal hare
#

is it possible to call superclass, superclass method?

#

BaseClass -> AnotherClass -> ThirdClass

#

I need to call BaseClass method from ThirdClass

#

that's not my bad design

#

im just trying to inject some behaviour to nms

agile anvil
#

maybe you should activate "show suffix" or smth

covert karma
#

it works when doing getMainScoreboard() instead of getNewScoreboard()

#

but now i have a new problem

#

how do i make the suffix show up in a new line

mortal hare
#

ah yes

#

stackoverflow error

#

i thought i would never encounter this

tardy delta
#

just wondering

#

assuming it has an impl

mortal hare
#

this doesnt work

proper notch
#

super gives a Class god damn im tired

mortal hare
#

super gives you a superclass

opal juniper
#

does it not inherit that method?

mortal hare
#

i need to get super superclass

opal juniper
#

that you can just call

mortal hare
#

and in the third class i need to revert that change

opal juniper
#

ah ok

#

bad design

mortal hare
#

Im just hooking NMS

#

ik, there's no way to do this unless with this way, since the handling of the container is hardcoded

#

inside Packet handling class

#

it needs to be that exact instance

#

if its not, it wouldnt work

ivory sleet
#

might be with reflection

mortal hare
#

my best best rn to just copy the method

#

probs

ivory sleet
#

where you get the declared method from said class

#

but idk

mortal hare
#

eh i just copied the method

#

it seems not to use the superclass fields at all

#

thank god

sterile token
#

Bad design

hybrid spoke
#

no problem

sterile token
#

You should resgn it

mortal hare
#

i can't this is NMS

sterile token
#

Oh

#

Nms is so shity

#

I think that they should make the api better

#

Also Implement support like protcol lib but already integranted

hybrid spoke
#

NMS is no api

mortal hare
#

NMS is internal guts of the server. Its unsupported, but sometimes API just doesnt cut it

eternal night
#

promoting packets to API level is like

#

not clever

harsh totem
#

I was experimenting with my plugin and all i did was kill a sheep and then this happened. i can't type messages and command anymore, wtf?

humble tulip
#

go to settings

harsh totem
#

i relogged and it is fixed now but wtf was that?

#

it still happens when i kill mobs

harsh totem
# harsh totem I was experimenting with my plugin and all i did was kill a sheep and then this ...

I have this code: ``` public static void turn(Entity entity){
Random random = new Random();
int chance = random.nextInt(1,4);
if (chance == 1){
entity.getWorld().spawnEntity(entity.getLocation(), EntityType.COD);
} else if (chance == 2){
entity.getWorld().spawnEntity(entity.getLocation(), EntityType.SALMON);
} else if (chance == 3){
entity.getWorld().spawnEntity(entity.getLocation(), EntityType.TROPICAL_FISH);
}
entity.remove();
}

@EventHandler
public void diamond(EntityShootBowEvent event){
    if (event.getProjectile() instanceof Arrow && event.getEntity() instanceof Player){
        if (event.getConsumable().getItemMeta().getCustomModelData() == 500){
            event.getProjectile().setMetadata("fish", new FixedMetadataValue(plugin, true));
        }
    }
}

@EventHandler
public void fish(ProjectileHitEvent event){
    if (event.getEntity() instanceof Arrow){
        Arrow arrow = (Arrow) event.getEntity();
        if (arrow.hasMetadata("fish")){
            turn(event.getHitEntity());
        }
    }
}```

When I hit a mob the mob is supposed to turn into a fish but when the mob is turned to fish, i get a bug which doesn't let me type anything in chat until i relog

lost matrix
harsh totem
eternal oxide
lost matrix
harsh totem
#

it was fine until i hit a sheep with an arrow

eternal oxide
#

Chat hidden

lost matrix
harsh totem
#

hmmm i just made it so that the arrow also disappears when hitting an entity and the bug isn't happening anymore

mortal hare
#

copying method contents to the third class worked

dire marsh
#

@harsh totem check microsoft account settings

mortal hare
#

finally i have properly synced merchant inventory which can hold items

#

without dropping them or returning to the player's inventory after he quits the GUI

harsh totem
#

nice for you :)

mortal hare
lost matrix
mortal hare
#

I think I finally understood how NMS container handling works. This kinda seems useful for inventory gui creation, by using this I can make UI's independant from plugin and easily shaded to any plugin (Without using wacky stuff like InventoryHolder, etc.)

#

also no overhead from OBC and I can freely customize how items should be handled without bukkit api notice.

#

seems neat

humble tulip
#

how do u listen to click events tho?

#

regularly?

mortal hare
#

click events are called in inside those menu classes

#

you don't need to do anything

#

bukkit api still works for these types of containers

humble tulip
#

ah ok

mortal hare
#

you just hook your own code to the NMS class, bypassing the bukkit api, and by not using listener for inventoryclickevent

humble tulip
#

how do u know it's your container?

harsh totem
#

when I use entity.remove(); on an enderDragon it doesn't work, why is that?
I debugged the entity and it is CraftEnderDragonPart

mortal hare
#

you create your class

humble tulip
#

right makes sense

mortal hare
#

Opened menus are stored in nmsPlayer.containerMenu

#
if (nmsPlayer.containerMenu instanceof UIMenu) {
  // He's using UI.
}

#

simple as that

humble tulip
mortal hare
#

yes

#

or you can create OBC CraftInventory class

humble tulip
#

that's nice

mortal hare
#

that way you're not depedant on NMS

#

that much

humble tulip
mortal hare
#

but you'll still need to create custom InventoryMenu class anyways

humble tulip
mortal hare
humble tulip
#

like a scrolling list?

mortal hare
#

you dont need to add items everytime player opens UI

covert karma
#

are scoreboards permanently saved to disk automatically?

mortal hare
#

thus multiple people can see the same view

humble tulip
harsh totem
mortal hare
#

at the same time

humble tulip
#

technically u can do the same currently

#

just store one inv and open for everyone

mortal hare
#

it acts the same as chest

mortal hare
humble tulip
#

not a merchant inv

mortal hare
#

it throws an exception

humble tulip
#

ye

mortal hare
#

this bypasses it

#

and functionality of trading is not lost

#

you can still trade with it

quaint mantle
#

Ratio

mortal hare
#

that's the speed of python's intepreter

quaint mantle
#

๐Ÿ˜Ž

tardy delta
#

snek

harsh totem
#

i just did entity.remove()

#

and it removes parts of the dragon, not the entire boss

eternal oxide
#

do you mean the bossbar is still there?

harsh totem
#

i can ss

quartz basalt
#

if im using the @EventHandler public void onCommandSend(PlayerCommandPreprocessEvent e) { event to allow players to "create" commands instead of the plugin how can i stop it from sending unknown command

eternal oxide
#

you cancel the event insteead of letting it continue

quartz basalt
#

ill try it ty

harsh totem
# eternal oxide do you mean the bossbar is still there?

I made it so that the dragon is removed if it's hit by an arrow.
when I hit the dragon in one of his hit boxes, i can no longer hit that hit box because this part of the dragon was removed but there are other hit boxes in the dragon that hasn't been removed and therefore the dragon is not removed.

humble tulip
#

part.getParent.remove

#

to remove the whole dragon

eternal oxide
#

An Enderdragon is a multipart Entity, you need to get the main part

tardy delta
#

wdym with multipart?

humble tulip
tardy delta
#

oh so multiple hitboxes for the whole entity too?

eternal oxide
#

yes, If it was a single hitbox it would be huge and inaccurate

harsh totem
humble tulip
#

you gotta check if the entity is an enderdragon part

#

then cast it

eternal oxide
#

cast to a ComplexEntity

lethal roost
#

uh is it possible to get the slot of which a picked up item is placed into
like i pick up an item and it appears in the first hotbar slot, how do i get that slot

#

none of these seemed to be connected to EntityPickupItemEvent

harsh totem
#

ok thank you it works now

humble tulip
#

@lethal roost it goes in a specific order

#

think it starts at 0 and goes up from there

#

so u can check which slots can accept the item

lethal roost
#

yeah but how do i know which slot the item got picked up into

humble tulip
#

if slot 0 is null, it goes there

lethal roost
#

cause i wanna see if the picked up item appeared in the player's current mainhand slot

humble tulip
#

unless u have another slot that can accept it

lost matrix
lethal roost
#

i want to give an effect to the player if a wooden axe is picked up from the ground and it's also picked up into the current mainhand slot

lost matrix
humble tulip
#
private int firstPartial(ItemStack item) {
        ItemStack[] inventory = this.getStorageContents();
        ItemStack filteredItem = CraftItemStack.asCraftCopy(item);
        if (item == null) {
            return -1;
        } else {
            for(int i = 0; i < inventory.length; ++i) {
                ItemStack cItem = inventory[i];
                if (cItem != null && cItem.getAmount() < cItem.getMaxStackSize() && cItem.isSimilar(filteredItem)) {
                    return i;
                }
            }

            return -1;
        }
    }
#

this is from the inventory class

#

oh it's an axe

#

well get firstempty

#

Inventory#firstEmpty()

mortal hare
#

yea... Click method for abstract container menu 170 lines long

#

maybe i shouldnt touch this

#

๐Ÿ˜

#

dupe glitches

#

no thanks

lethal roost
#

aight lemme try those solutions, thx

charred blaze
#

how do i remove item from player's inventory with InventoryClickEvent?

mortal hare
#

event.getInventory().setItem(event.getSlot(), null)

humble tulip
# lethal roost aight lemme try those solutions, thx
public class InventoryUtil {

    public static int getSlotWhenAdded(Inventory inventory, ItemStack itemStack) {
        int possible;

        if (itemStack.getMaxStackSize() == 1)
            possible = -1;
        else
            possible = firstPartial(inventory, itemStack);
        if (possible == -1)
            return inventory.firstEmpty();
        return possible;
    }

    private static int firstPartial(Inventory inventory, ItemStack item) {
        ItemStack[] contents = inventory.getStorageContents();
        if (item == null) {
            return -1;
        } else {
            for(int i = 0; i < contents.length; ++i) {
                ItemStack cItem = contents[i];
                if (cItem != null && cItem.getAmount() < cItem.getMaxStackSize() && cItem.isSimilar(item)) {
                    return i;
                }
            }

            return -1;
        }
    }

}
#

wrote a util class for u

charred blaze
#

nice

#

um

placid basin
#

Can I ask paper questions here too?

eternal oxide
#

not really

humble tulip
#

item is null

#

most likely

charred blaze
humble tulip
#

send ur code then

charred blaze
humble tulip
#

what is line 168

charred blaze
#

wait

#

this

humble tulip
#

check if it has a displayname first

#

default names are not display names

#

thus all is null

charred blaze
#

hm

humble tulip
#

if it has no displayname, u can assume the item is fine

subtle folio
charred blaze
#

any ideas about antiswear plugin's name?

hybrid spoke
charred blaze
hybrid spoke
#

then pscht

charred blaze
#

meh x2

hybrid spoke
#

you are meh

charred blaze
#

can i rename my spigot account?

summer scroll
humble tulip
#

that's genius

twilit roost
#

What does Chunk#markDirty does?

summer scroll
twilit roost
#

ye same
thats the reason im asking ๐Ÿ˜„

summer scroll
#

That means it's not exist?

twilit roost
#

someone clearly use it

summer scroll
#

Oh it's from nms

twilit roost
#

imma try without it
Buuut for testing I also need PacketPlayOutMapChunk but again I can't find it in any docs

#

--> into NMS w/Mojang Mappnig

summer scroll
#

In mojang mapping the name of the packet would be different.

twilit roost
summer scroll
#

Clientbound or Serverbound something for packet

twilit roost
#

it has to be Clientbound

quaint mantle
#

seems like it's ClientboundLevelChunkPacket

summer scroll
#

ClientboundLevelChunk and let the auto-complete do the rest

#

ah there you go

twilit roost
#

I tried importing non remapped version for a minute
and PacketPlayOutMapChunk doesn't even exist
I though of Unloading Chunk packet

quaint mantle
twilit roost
#

im using 1.18.1

covert karma
#

how do i intercept the death message?

twilit roost
#

EntityDeathEvent i think
it prob has getMessage or setMessage

summer scroll
#

PlayerDeathEvent

twilit roost
#

^^

covert karma
#

what about named mobs

twilit roost
#

EntityDeathEvent

#

ยฏ_(ใƒ„)_/ยฏ

covert karma
#

that doesnt have a death message

#

also i need to get if the death was caused by an entity and if so what entity

#

so for example killed by a zombie

#

or something

humble tulip
#

Entitydamagbyentityeventevent

#

Check if the damaged entity health will be 0

#

Get the damaged health and subtract the damage

#

If <=0 entity will be dead

#

Use a priority like high so other events can get chance to cancel

covert karma
#

hm feels saver to delay 1 tick and check entity isdead instead

#

what about resistance or armor and stuff like that

#

oh i guess getFinalDamage?

summer scroll
#

yes getFinalDamage will return the reduced damage

twilit roost
#

how to convert 0x5C5C64 into int ?

smoky tinsel
#

guys

covert karma
#

ok so how would i convert an EntityType to a localized string?

smoky tinsel
#

what did the override change to?

#

and so string

mortal hare
#

whenever you input it

#

0x5C5C64 is an int

#

but in hex form

twilit roost
eternal oxide
#

In the EntityDeathEvent you can use getLastDamageCause()

twilit roost
#

ohh
one tutorial was saying I need to Parse it

eternal oxide
#

that will give you the last damage event that Entity was hit by

humble tulip
#

Just do int = 0x whatever

humble tulip
mortal hare
#
int fogColor = 0x5C5C64;
#

simple as that

eternal oxide
#

if its instanceof EntityDamageByEntityEvent you can cast it and get the damager

twilit roost
#

yeye got it

#

thx

smoky tinsel
#

guys i can not use override any more

#

what is happen to me

#

im using 1.19 api

humble tulip
#

Do u extend the class?

smoky tinsel
#

i try to

humble tulip
#

?paste your pom

undone axleBOT
smoky tinsel
#
 @Override
    public void onEnable() {
        getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "hi");


    }
humble tulip
#

That's not your pom

smoky tinsel
#

i cant use this

wild reef
#

Hey guys, I wanted to use nms. While I was watching a tutorial on some examples I tried I noticed that some classes are missing for me. Stuff like CraftPlayer can be found, but other things like ServerPlayer or ServerLevel can't be found, any ideas on that?

twilit roost
#

in order for us to help you
please atleast try and give us stuff we ask for

smoky tinsel
#

i already extend Javaplugin

#

but Override is not enable

#

i cant use @Override

summer scroll
twilit roost
#

?paste

undone axleBOT
tardy delta
#

why would you write an int in hex format?

twilit roost
#

colors:)

tardy delta
#

why not write the real int then

smoky tinsel
#
package plugin;


import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public class lobby extends JavaPlugin {


    @Override
    public void onEnable() {
        getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "hi");


    }

    @Override
    public void onDisable() {
        super.onDisable();
        getServer().getConsoleSender().sendMessage(ChatColor.RED + "ใ…‚ใ…‡ใ…‚ใ…‡");
    }
    
}
#

this is whole code

twilit roost
#

POM.XML

smoky tinsel
#

but override in this code is not working

#

what is POM.XML

tardy delta
#

you shouldnt use color codes in your console output

smoky tinsel
#

no i mean

twilit roost
humble tulip
#

He isn't using maven

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

humble tulip
#

Resd that^^

tardy delta
#

you should be using maven or gradle

smoky tinsel
smoky tinsel
#

im using 1.19

twilit roost
#

its the same

humble tulip
#

Just use maven

#

It's so much easier

twilit roost
#

100x easier

covert karma
#

no matter what language you have set in the settings

humble tulip
#

Well yeah how do u want it

covert karma
#

translated?

smoky tinsel
#

can you help me

#

im noob

humble tulip
#

Well u gotta provde translations

twilit roost
humble tulip
covert karma
ivory sleet
humble tulip
#

I think

ivory sleet
#

bungee chat api or use adventure

smoky tinsel
humble tulip
#

Download that

twilit roost
#

try searching for Minecraft Development in plugins

humble tulip
#

And create a new project

twilit roost
#

when you press create new project :

covert karma
smoky tinsel
golden turret
twilit roost
#

*JetBrains Plugins

golden turret
#

player.spigot().sendMessage

covert karma
golden turret
#
while(true) {
  for(;;) {
    new Thread(() -> System.gc()).start();
  }
}```
tardy delta
#

no

golden turret
covert karma
covert karma
#

like including the message

golden turret
#

you can use a ComponentBuilder

#

or whatever it is called

#

when i get home in 10 mins i will show you

#

remember me

tardy delta
covert karma
#

so i would need to like split the death message

tardy delta
#

wtf was i doing months ago

lethal roost
#

does EntityDropItemEvent include dropping the item via clicking outside the inventory?
like you're open in the inventory and you click an item to pick it up with your cursor and drop it by clicking outside the inventory interface

twilit roost
#

you can debug it urself
by souting when event happens

covert karma
lethal roost
#

probably yeah

covert karma
#

ok ok ok i just tried something and for some reason this works

tardy delta
#

#runTask is the same as runTaskLater(1)

covert karma
#

oh good to know

tardy delta
#

and use dependency injection for your plugin instance

#

?di

undone axleBOT
brittle lily
#

Hey Guys! If I set a block Block Break event on a Custom Item, will it only happen for that custom item or will it happen for all blocks of that custom item's type?

agile anvil
agile anvil
#

Cause this event is thrown each time a block is broken, you'll have to listen for which block is broken

lost matrix
#

The BlockBreakEvent is always fired when a block is broken by a player. And there is nothing you can do about that.

brittle lily
#

I mean for example "Emerald Block" with name "Healer Block" If I break this block I will get 1 heart. If I do that. It will only that block ? EmeralBlock with "Healer Block" .

golden turret
#

what you can do is to store the location of the blocks you want

lost matrix
#

*States can. To be specific the PDC of any TileState

golden turret
#

then check the broken block location against the list you have

agile anvil
#

You'll have to check in the event that : the block is an emerald block, and then check if it is a "custom block" (maybe you can input some metadata on it, or put it in a list, etc...)

brittle lily
#

Ah I guess Fault is about my english... I couldn't explain that.. But Thanks

lost matrix
brittle lily
#

I see thanks!

lost matrix
#

Isnt there a simple persistent block API?

quaint mantle
#

@tender shard

#

advertise

agile anvil
#

In this episode, I show you how to use Persistent Data Containers with blocks in Spigot MC Plugins. Previously, I showed you how to use these containers with items and players but many of you were asking me about blocks, so here ya go! #Java #Spigot

Code: https://gitlab.com/kody-simpson/spigot/persistant-data-with-blocks

โญ Kite is a free AI-po...

โ–ถ Play video
quaint mantle
#

customblockdata

lost matrix
agile anvil
tardy delta
#

better not codedred

lost matrix
#

This only works for TileStates. So exactly those:

golden turret
#

simply rewrite spigot to allow pdc on all blocks

river oracle
tardy delta
#

true

river oracle
tardy delta
#

i once watched a video of him hoping to get some good code but it was trash

river oracle
lost matrix
#

RedLib also has this. But he does IO on the main thread. He insists that it doesnt cause any issues but im still not fully convinced.

covert karma
golden turret
#

i was talking about somethin like Block#getPersistentDataContainer()

tardy delta
#

kody

#

TileState#getpersistentDataContainer

#

or Chunk if you wish

golden turret
#

that is only for TileState

river oracle
#

look at the lib I sent

#

it allows for blocks to contain persistent Data

golden turret
#

it would be simplier all blocks have pdc

#

instead of using chunk pdc

tardy delta
#

memory overhead i guess

eternal oxide
outer wadi
#

Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null

#

yes i tried every google thread

#

it is marked as a dependency yes

#

yes i do have <scope>provided</scope>

#

and yes the protocollib.jar is in my server

lost matrix
outer wadi
#

build -> recompile project

agile anvil
eternal oxide
#

Maven _ scope Package

lost matrix
outer wadi
#

should be around here

if (ProtocolLibrary.getProtocolManager() == null)
            return;

        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(Main.INSTANCE, PacketType.Play.Client.UPDATE_SIGN)```
eternal oxide
#

not the way you are

outer wadi
#

well what then

lost matrix
outer wadi
#

im very new to all this

eternal oxide
#

right side of screen, Maven tab - Lifecycles - package

outer wadi
#

ah so thats what its used for

#

then, do i rebuild?

lost matrix
eternal oxide
#

no

eternal oxide
#

you get teh jar from your target folder

outer wadi
#

or what do i do now

eternal oxide
#

no

lost matrix
# outer wadi im not

Then just run
mvn clean install
And you should be fine.
On the right side you even have a tab for the livecycles of maven.
Afterwards the compiled jar should be in your "target" folder.

eternal oxide
#

you run package in teh maven menu. Thats all

outer wadi
lost matrix
outer wadi
#

ah aight

eternal oxide
#

No the faries do that

outer wadi
#

thank you guys

lost matrix
mortal hare
#

man i hate this button on paperweight

#

it literally fucks up your gradle build temporarily

#

and its evil placed next to build task

dire marsh
#

dont use nms

#

๐Ÿง 

river oracle
#

dont use gradle

#

๐Ÿง 

mortal hare
#

blinking villager uis yay

river oracle
#

does this gui do something the current Merchant bukkit implementation can't do

mortal hare
#

it can store items

#

like a normal chest

#

while bukkit one cant

river oracle
#

ahhh

#

why is it blinking thats wack

mortal hare
#

that's just a test

river oracle
#

ahh

winged birch
#

Is there another way to obtain the name of the item in the player's main hand? currently I'm trying to see if they're using a pickaxe

    @EventHandler
    public void onOreDestroyed(BlockBreakEvent e) {
        var itemInMainHandIsPickAxe = e.getPlayer()
                .getInventory()
                .getItemInMainHand()
                .getType()
                .getData()
                .getName()
                .toLowerCase()
                .contains("pickaxe");

        if (e.getPlayer().getGameMode() == GameMode.SURVIVAL
            && itemInMainHandIsPickAxe) {
            e.getPlayer().sendMessage("Pickaxe equipped");
        }
    }

But I'm getting this error:

Could not pass event BlockBreakEvent to MyPlugin v1.0.0
java.lang.IllegalArgumentException: Cannot get data class of Modern Material

worn tundra
#

Huh

#

Why are getting data?

mortal hare