#help-development

1 messages ยท Page 2161 of 1

river oracle
#

1.8 servers: bubububu spammmm clicks sadness

tender shard
#

that's actually how I started doing plugins

#

ClickSort was broken in 1.13 so I made ChestSort lol

#

so yeah I am glad about 1.13

river oracle
#

i started with the 1.8 api

humble tulip
#

Same

river oracle
#

than I was like this is so shit so I started using the 1.12 api then I was like fuck this I'm going to 1.16.5 screw everyone I'm not giving you guys support

tender shard
#

well my first plugin was in 1.4 but it was so bad, I never uploaded anything to the public back then

river oracle
#

I sold my first plugin for 20 dollars

quaint mantle
#

1.2.5 good old days

tender shard
#

people who still use 1.8 or 1.12 should also not expect new plugins to be released imho

#

after all noone does games for windows xp today

river oracle
#

ignores me the greatest new windows xp developer

tender shard
#

I am sorry

#

I didn't mean to hurt your f33lings :<

sterile token
quaint mantle
#

fr?

tender shard
#

fr

sterile token
#

fr

river oracle
#

I was so young i don't even remember what version I started playing mc on

tender shard
#

bless you

#

mine was beta 1.2

#

beta 1.3 was released on my 16th birthday

river oracle
#

I started playing when I was 5 lmao

sterile token
#

You can be my granpda lmao

tender shard
river oracle
#

I'm the greatest US citizen

tender shard
#

my people skills are really bad

quaint mantle
#

1.2.5 was king. we didnt even had chat in single player sheesh

sterile token
#

hat the heck dutch isnt "dama"?

tender shard
#

did you have a stroke or sth

river oracle
#

there is no way this kid isnt drunk

sterile token
#

Why?

#

Im am dumb

tender shard
#

your english is weird sometimes lol

sterile token
#

I was smooking a bit of wheel

tender shard
#

a yes

#

smoking the wheel

#

then listen to some sad songs

river oracle
#

you should try eating spicy food

#

oh okay mfnalex suggestion works too i guess

tender shard
#

or eat spicy food while listening to sad songs

#

that's the best solution

river oracle
#

yea thatll be the greatest solution

sterile token
tender shard
#

lol

#

the food doesn't have to be THAT spicy

sterile token
#

Supposedly the spicy makes you shit a lot

tender shard
#

depends on the person I guess

river oracle
#

I finally made readable ItemStack to Config and Config to ItemStack translation y2dance6

tender shard
#

I never had any toilets explode after eating spicy food

sterile token
#

Oh fortunatlu

#

Luxen Burgo germany righ? an out of context

river oracle
tender shard
eternal oxide
#

Now see if it retains enchantments

river oracle
#

it also retains item flags

eternal oxide
#

nice

sterile token
river oracle
#

I could make it retain PDC but I don't really need too

tender shard
sterile token
#

oh weird

tender shard
#

and everything is extremely expensive there

#

I once was in their capital, I think it's called Vaduz and I had to pay 18โ‚ฌ for a menu at mcdonalds

#

in germany it would have been like 8โ‚ฌ

sterile token
#

I dont know why smooking weird or wheel relax me

tender shard
#

not weird or wheel lol

sterile token
vocal cloud
#

lmfao

sterile token
#

Too much for now

tender shard
#

noone

sterile token
#

I will keep it fornext month

tender shard
#

and also remember: don't smoke wheel and drive

#

lol

#

no

sterile token
tender shard
#

I "only" do plugins

#

that's my job

#

I once had a counter strike server lol

#

back in the days when people played counter strike source

sterile token
#

Oh stormy days are perfect for taking a snap

tender shard
#

yeah taking a snap, smoking a wheel, lol verano you should really go to sleep lol

sterile token
#

lmfao i dont know why im saying idiots things

vocal cloud
#

You need a nap sheesh

tender shard
#

I don't mind lol

desert loom
sterile token
river oracle
#

if you can get the lore to be an intenger it would break the code

desert loom
#

I mean what happens if I put a list of numbers into a configuration and call section.get() on it

#

does it return a List<String> or a List<Integer>?

sterile token
tender shard
#

generics are removed on compile time anyway

#

the JVM will always only see a List<Object>

#

even for getStringList etc

desert loom
#

yeah true, but I'm just saying what if the setLore method calls string methods on the objects it assumes to be String wouldn't that throw an error

desert loom
#

is what I'm saying

ivory sleet
#

yes Theone

#

the compile time check should hinder an instance of List<Object> from being passed tho

tender shard
#
    List<String> myStringList = getConfig().getStringList("my-list");
    String firstString = myStringList.get(0);

this basically compiles to this:

    List<Object> myStringList = getConfig().getStringList("my-list");
    String firstString = (String) myStringList.get(0);
desert loom
#
        if (objLore != null) {
            if (!(objLore instanceof List)) {
                ArcticLib.LOGGER.log(Level.WARNING, "Your Lore Must Be A String List");
                return arcticStack;
            }
            arcticStack.setLore((List<String>) objLore);
        }

I was talking about this bit in Y2K's code.

river oracle
#

I'm blindly casting

#

which could return in error but in the circumstance it would your formatting is already incorrect

tender shard
#

i'll continue learning this song on keyboard, brb lol

desert loom
#

I haven't looked through your code that much so I'm not sure if there is but is there a reason you're not just utilizing the getString, getStringList, etc methods from configuration?

#

and instead opting for doing the type checks yourself?

river oracle
#

yea there is I'm handling errors myself so they are more readable for idiotic people I've yet to add something for the lore list though

#

as its still a WIP

#

I can't expect server owners to beable to read java errors

#

Basically trying to prevent people from doing stupid formatting and then coming to me like askdjfhlaksjdhflaj wTF bro it don't work and paste an error only for me to figure out they typed something wrong

desert loom
#

alright makes sense.

quaint mantle
#

Why can I not use player.openInventory(); to open an inventory to a player ?

tender shard
#

you can do that just fine

quaint mantle
#

For some reason, it doesn't want to.

tender shard
#

what kinda inventory are you trying to open? and when?

quaint mantle
#

when a player right clicks

#

PlayerInteractEvent

tender shard
#

when rightclicking what? obviously if an inventory is opened "by the event itself" then you either have to cancel the event or open your inventory one tick later

quaint mantle
#

Action.RIGHT_CLICK_AIR and BLOCK

spiral hinge
#

I have no clue what that means

tender shard
#

is your event listener code actually running? try to add some message like Bukkit.broadcastMessage to see if it actually runs

quaint mantle
#

It does.

#

The problem is, when it checks the display name

tender shard
#

displayname of what?

quaint mantle
#

the Item that i'm holding

tender shard
#

so that's the problem, and not the openInventory(...) part

quaint mantle
#

yes.

tender shard
#

how are you checking the item's display name? and keep in mind that players can rename items on an anvil themselves

quaint mantle
#

Just added some "sout" and figured itout

tender shard
#

normally you rather should use custom PDC tags to identify your custom items instead of doing it by name

quaint mantle
#

ooh

#

I modify my items with PDC

#

so does it somehow edit it

#

if(p.getInventory().getItemInMainHand().getItemMeta().getDisplayName() == "Harvester Hoe")

#

this is how i check

#

public static String hoeName = colored("&aHarvester Hoe");

tender shard
#

Oh yeah two things I have to mention:

quaint mantle
#

And this is how i save it

tender shard
#

First of all You should always use equals() to compare Strings, and NOT ==

quaint mantle
#

OMG

tender shard
#

and second, your custon name has a color code in it

#

so it'll never be equal to "Harvester Hoe" anyway

#

and third, as said, keep in mind that people could simply rename items on an anvil to have this name anyway

quaint mantle
#

Would it trigger if the color is not green /

tardy delta
#

use ChatColor.stripColor to strip the color

tender shard
#

You should instead add a custom PDC tag to your item and then check if that item has this tag

#

that's probably the only proper way to identify your custom item

quaint mantle
#

Oh okay, i'll do that right now.

#

Thx for the advice.

tender shard
#

oki ๐Ÿ™‚ np

#

you're on 1.14+ right?

tardy delta
#

i was thinking about making a customitems plugin but some things came in between lol

tardy delta
#

@sterile token do you have your code btw

#

pdc is basically a wrapper around nbt stuff

sterile token
#

Oh ok

#

I was told pdc = key-value tmp storage

tardy delta
#

its persistent

tender shard
#

I'd do it like this

public static void markAsMyCustomItem(ItemStack item) {
        ItemMeta meta = item.getItemMeta();
        meta.getPersistentDataContainer().set(new NamespacedKey("my-custom-item"), PersistentDataType.BYTE, (byte) 1);
        item.setItemMeta(meta);
    }
    
    public static boolean isMyCustomItem(ItemStack item) {
        return item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("my-custom-item"),PersistentDataType.BYTE);
    }
sterile token
#

oh yeah i rememember some say it was saved on world file or something like that

tender shard
#

the PDC internally gets stored as an NBT tag called "BukkitValues" or "PublicBukkitValues"

sterile token
#

Oh ok

#

Allright thanks and sorry for always being annoying

tender shard
#

no problem lol

#

this channel is made for questions about spigot lol

#

so yeah one could kinda say "PDC is a wrapper for NBT but you can only use it to access data that was also added using the PDC methods"

tardy delta
#

or using nms aaa

tender shard
#

yeah but only if they were added to the "PublicBukkitValues" NMS compound tag

tardy delta
#

yes

tender shard
#

and if someone would use that, there's no need to use NMS in the first place

#

they could just directly use the PDC methods

sterile token
#

So with pdc i can assign custom data to a itemstack and then compare it but getting it with event.getBlock ?

tender shard
#

hm no not really

#

you can assign data to itemstacks but once the item is placed, all this PDC data is lost

sterile token
#

So how you can do a placed block unique for others?

tender shard
#

you'd have to somehow add it to the block yourself

#

and blocks do not have any PDC

sterile token
#

Weird so

tardy delta
#

only tilestates, entities and chunks have a pdc

tender shard
sterile token
#

Oh ok

tender shard
sterile token
#

I will take a look

tardy delta
#

ah mye

tender shard
#

although for worlds it was only added recently

tardy delta
#

and some blocks 'host' a tilestate, like a chest, barrel etc

sterile token
#

Its strange because you can add meta to item stacks, but not for blocks, too much weird

tender shard
#

chunk has PDC since 1.16.3, itemmeta, entities and tileentities have it since 1.14.1 and I think World was added in 1.18.1 but not sure about the last part

tardy delta
#

its not really meta

#

well uh

sterile token
#

Because if you can set a item meta to a beacon, why then it doesnt keep it?

#

Hmns

tender shard
#

I guess it has something to do with how blocks are stored in the vanilla server "save file format"

#

itemstacks basically always supported NBT but blocks never did

sterile token
#

Oh allright, but ts not cause of client-side right?

vocal cloud
#

Yeah only tile entities have every supported it.

tender shard
#

no it has nothing to do with client/server

sterile token
#

Hmn wft

#

Minecraft its too much extrange

tender shard
#

why do my fingers smell like cake wtf

vocal cloud
#

beacons are tile entities uwu

tender shard
sterile token
#

I dont event know what the dfinition of an entity

tender shard
#

as said, I was so annoyed by this that I made a library for this which "abuses" the chunk pdc to give you a PDC for every block. It should really be builtin though

vocal cloud
#

Indeed, however it'd require a lot more data to be stored for each block

tardy delta
#

ah i did that too

#

a plugin to lock blocks i made

#

when i was a java noob

tender shard
#

so I guess that can't be a reason to not add it

vocal cloud
#

I mean if each block had the ability to store data. It's not something moyang needs

tardy delta
#

then you might aswell add a lot of data to a chunk to break it

vocal cloud
#

IE they have no reason to store anything in a dirt block so they don't need that functionality

tender shard
#

I once tried to check how much data a PDC can handle. I added about 1 MB of data to EVERY loaded block. the server took like half an hour to shutdown properly but it still worked

#

so yeah it's definitely not good to store huge amounts of data

fossil lily
#

Is there a way to get a list of every single block in the game

vocal cloud
#

Yup

fossil lily
#

How :O

tender shard
#

or manually load those chunks

#

both are shitty methods

fossil lily
#

No not in the world

#

In that GAME

tender shard
#

so I'd say there is no proper method

#

in that game? i don't understand what you mean

fossil lily
#

Like I want every block that minecraft has made in an ItemStack array

tardy delta
#

ah

tender shard
#

I don't get it

fossil lily
#

smh

#

you know the creative menu

vocal cloud
tardy delta
#

loop over Material.values() and check if Material#isBlock

fossil lily
#

i want all of it

vocal cloud
#

There have all of it

fossil lily
#

oh thanks FourteenBrush

tardy delta
#

no checking then

tender shard
#

oooh that's what you mean

sterile token
#

So its not possible to keep track of unique blocks hmn

tender shard
#

so you are talking about materials ant not blocks

fossil lily
#

yea yea

sterile token
#

Like i yes or yes need to keep track of a unique block, because i need to hide / unhide a protection block

#

๐Ÿ˜

tender shard
#

yeah as fourteen said, check material.values() and then check if that material is a block there's an isBlock() method)

#

e.g. a diamond_hoe obviously is not "a block"

vocal cloud
#

Load every block in the world and detect if it exists in your hashset

#

Get all 3 dimensions

tardy delta
#

very optimized

vocal cloud
#

Wouldn't take too long. Save it to a txt file with /n separator for efficiency

tender shard
#

and then do some crack cocaine

#

to stay awake while it runs

tardy delta
#

save te json in a database

sterile token
#

My pl only allows world protection

tender shard
sterile token
tender shard
#

yes, my messages mine diamonds. yours only mine coal

sterile token
#

okay?

vocal cloud
#

Move to Columbia. I hear it's safe there. Free cocaine

sterile token
#

Wait so its possible or not

#

Im being seriou....

tender shard
#

what exactly?

sterile token
#

Im not trolling

#

I need to hide unhide a custom block

#

So i need to set a custom data or unique identifier to each protection block

tardy delta
#

hide/ unhide?

#

wha

sterile token
#

So then if a protection is a block coal, it doesnt hide every coal block

#

Do i explaine?

tender shard
#

as said, you can use my lib to get a PDC for every block. otherwise you have to use some workarounds

sterile token
#

Atm we dont use pdc for multiversion support, that our main issue

tardy delta
#

oh god

tender shard
#

then you have to use some weird thing like a json file or sth

tardy delta
#

1.8 user i hear

#

or some crappy version

tender shard
#

yeah for real we should add a new rule here like "1.8 = no help" lol

sterile token
vocal cloud
#

Forge does that

tardy delta
#

even better

vocal cloud
#

1.16.5 and 1.18.2 only

tardy delta
#

whats wrong with the 1.12 graphics

sterile token
#

I think every version for coding its okay, becuase as people said, for preferences you have colors

tender shard
#

in 1.16 you have 16 million colors

sterile token
#

hy 1.8?

#

I dont use that

#

Its too much oddy

tender shard
#

ok but 1.12 the same thing applies

sterile token
#

No, its no the same 1.12 its not 10.999.999.999.999 kms away

#

๐Ÿ˜‚

tender shard
#

not even the sun is that far away

sterile token
#

please be serious :(

tender shard
#

I am serious. 1.12 sucks and everyone who still uses it is weird imho lol

vocal cloud
#

was great for modding

tardy delta
#

1.12 doesnt have pdc iirc

tender shard
#

as said, PDC was added in 1.14.1

#

and on chunks it was added in 1.16.3

#

and for worlds in 1.18.1 although not sure about this part

sterile token
#

Why yes or yes pdc?

crisp steeple
#

not sure how they did it though, ive been curious for a while

vocal cloud
#

Yeah but hypixel is probably an incredibly heavily modified server written by 6 figure java senior devs

sterile token
#

PDC are not the only way, you have NBT for setting custom data into items

tender shard
sterile token
#

Oh i have find something more im tracking each protection location

tender shard
#

and load that on chunkload/unload event

#

and then keep it inside a map

sterile token
eternal oxide
#

NBT is not API though

tender shard
#

and save it again when the chunk gets unloaded

tardy delta
#

shit its already 1 am and i got school tomorrow

#

gn yall

sterile token
#

SQL == ๐Ÿคฎ i hate sql

crisp steeple
eternal oxide
#

not until PDC was added.

sterile token
tardy delta
#

why doesnt school let me sleep an hour longer, its like study the first hour

vocal cloud
#

SQL is faster than other langs so it's hard to not use it. Plus it's really mainstream

sterile token
tardy delta
#

not yet...

crisp steeple
#

as an example: if you place a tile entity in the same block as one of their custom ones, it will completely bug it and put it in kind of a ghost state out and cause a lot of other issues

tender shard
crisp steeple
#

plus a ton of dupes/weird things with island freezing involving tile entities that they forgot existed and didnt think to fix manually

tender shard
#

that doesn't have anything to do with SQL though. If something gets duplicated, that's definitely not the fault of the database system that was used

crisp steeple
#

yeah, didnt say it was

tender shard
#

true, just wanted to mention it ๐Ÿ˜„

crisp steeple
#

im saying that they use slimeworldmanager to store the worlds, which can also save worlds directly to sql

#

(slime is very cool btw)

sterile token
#

Why world edit cuboid api its one of the most used?

#

What do you think about that

tender shard
#

worldedit's API is overly complicated imho

sterile token
#

Yeah

#

I think doing your own cuboid its even more simple than using their api

#

๐Ÿ˜‚

tender shard
#

well spigot has cuboids builtin

#

called erm

#

how are they called again

#

BoundingBox

sterile token
#

Yeah, but its doesnt things like rotate over Y/X/Z

tender shard
#

yeah it actually has nothing to do with blocks

#

it simply represents a "region" in an XYZ world

sterile token
#

Yeah, does it keep at Location 1 and 2 right?

tender shard
#

yes

sterile token
#

And them it calculate

#

I thought they were more diff

#

I finally did a cuboid and worked

tender shard
#

and then you smoked wheel

#

lol

sterile token
#

But i have some issues hahah, that the protection block can be breaked by everyone, but the claim is not deleted

#

So im raging

#

And that why i smoked wheel

#

I get too much stressed and ancious

tender shard
#

i'd probably /kill myself if I had to use 1.12 api ever again

#

I couldn't live without PDC today

sterile token
#

but which pdc<'

#

your own ?

#

Also why windows mc edition its != java one?

spiral hinge
#

Can someone help?

sterile token
#

๐Ÿค”

tender shard
#

did you add the repository for the toml dependency?

eternal oxide
#

Win10 edition is C++. Windows version is Java

sterile token
spiral hinge
#

This was 2 hours ago. I'd say I am patient

sterile token
#

๐Ÿ˜‚

spiral hinge
#

Well even then, I'm not saying it's urgent I was just bumping

tender shard
#

I just saw that the toml4j is on maven central. did you click on the maven reload button in your IDE?

spiral hinge
tender shard
spiral hinge
tender shard
#

hm well if you already clicked on that than all I can recommend is to click on the "m" button in the maven window and then enter mvn clean package -U

eternal oxide
spiral hinge
#

Well is there any other steps I was supposed to do than add what I added to my pom.xml?

tender shard
#

click on this button and enter mvn clean package -U

#

then wait a few seconds and it should work fine hopefully lol

#

and if it worked let me know pls because then I can stop googling

tender shard
#

hm weird. sorry no idea, I gotta go to sleep now. try to run mvn with the -X switch and see if the log contains some more information

#

did you add any dependencies manually?

spiral hinge
tender shard
#

sorry I have no idea then

#

it's working fine for me

spiral hinge
#

Alright well thanks

eternal oxide
#

You could invalidate caches and restart

tender shard
#

yeah but that wouldn't explain why maven itself throws an error

#

invalidating caches basically only helps when intellij is weird

eternal oxide
#

maven has a timeout after it fails to find a resource

tender shard
#

yeah that's why I asked them to run mvn clean package -U

#

and if it cannot find a dependency, the error would look different

eternal oxide
#

if maven can;t find the resource he should have all kinds of errors in his IDE

tender shard
#

it seems like it does indeed find the correct dependency but the package name is just not correct

#

otherwise maven would be complaining before it would even run javac

#

so yeah I have no ideas left lol

eternal oxide
#

would be interesting to see hsi full maven log

tender shard
#

they posted it

eternal oxide
#

I only saw a partial

#

ah ok

#

I see no attempt to download, is he in local repo only or seomthing?

#

offline mode

tender shard
#

hm the log says "downloading from ..." for paper-api so probbaly tehy are not in offline mode

eternal oxide
#

no attempt to download the other dep though

tender shard
#

and the toml dependency they wanna use is on maven central

#

yeah I guess they simply use the wrong pom xml file or sth, I really have no idea

#

maybe they have two pom files or sth and are trying to use the wrong one or sth

eternal oxide
#

could be

tender shard
#

I really gotta go to sleep lol. have a good night everyone :3

eternal oxide
#

night

naive loom
#

im teleporting two players into a new world and for some odd reason my one account and see the other player and the new one cannot see the old one

#

anyone have a clue on why this is happening?

spiral hinge
#

Hey so can someone help me out. Im trying to use toml4j on a project and it seemed to give me errors when trying to compile so I tried it out on a seperate test project and its giving me the same error

Error:

package com.moandjiezana.toml does not exist

The test project:
https://github.com/Christian-Madlansacay/toml-test

eternal oxide
#

either you showed us the wrong pom earlier, or I'm going to guess you clicked the offline button in InteliJ

#

You log shows no attempt to download that dependency

spiral hinge
eternal oxide
#

do you have multiple poms?

spiral hinge
#

You can check the repo I sent

eternal oxide
#

checking now

#

odd, but you are using java conpat for 1.8 but building for MC 1.18

spiral hinge
eternal oxide
#

ok, I got it to build. Changed the scope of the toml resource to compile

#

Maven has no shade scope

sharp flare
#

how do i check a block if it can be attached with a ladder

#

is it on any solid block

bright jasper
#

been looking at model engine and went on the demo server

#

found out that not only do they have custom models but some of the UIs are straight up actual custom. as in the rules page has a whole thing and https://i.kawaii.sh/U1Fn~VZ.png

#

This?

#

How tf did they do that with just resource packs? is there a guide lmao

humble tulip
#

4 armor slots

#

4 crafting slot

#

And off hand?

hexed hatch
#

formatted to create a shell in the inventory

#

underneath it's just a normal chest ui

bright jasper
#

how does it spawn a custom model over the inventory ui?

fossil lily
#

if I do Material.values() in the 1.8.8 API, will it return 1.18 blocks? I have some items not showing up. They aren't null. They aren't air.

#

This is showing on the 1.8.8 client, (Im using a 1.18 texture pack)

river oracle
drowsy helm
spiral hinge
#

Hey so how would I go about using a variable in another java class?

spiral hinge
drowsy helm
#

wdym?

#

like you are defining it in the onenable

spiral hinge
fossil lily
drowsy helm
#

define it outside of the scope

#

and make it public

fossil lily
spiral hinge
#

I just did this and it says it cannot resolve symbol in my other class

drowsy helm
#

show your code

spiral hinge
#

I have this outside

public Toml config;

Then I have this inside of my onEnable method:

config = loadConfig("config");
drowsy helm
#

right

#

which bit says cannot resolve

spiral hinge
#

I tried this inside of another class

config.getString("test.get");
#

It says

Cannot resolve symbol 'config'
drowsy helm
#

because you arent referencing the class

#

java wont know what config you are talking about

#

do you have an instance of the main class

spiral hinge
#

Oh I just put my main class.config then it worked

drowsy helm
#

yep

granite pond
#

is there a way I could hire someone to make a plugin for me? If this isn't the place to ask, where should I ask?

undone axleBOT
eternal oxide
odd adder
#

UUID.fromString("74c5424e-1e12-4c89-978a-cff4d6750ca6")
it java.lang.IllegalArgumentException: UUID string too large
how can i solve this?

eternal oxide
#

use a valid string

odd adder
#

I get this uuid from player..getUniqueId().toString()

eternal oxide
#

then thats not what you are passing to fromString

#

are you storing the string before you attempt to reassemble it?

odd adder
#

I stored it yet , and before I parse the UUID string to UUID , printed it to console , it shows "74c5424e-1e12-4c89-978a-cff4d6750ca6"

eternal oxide
#

?paste show some code

undone axleBOT
odd adder
#
System.out.println(ep.get(i).toString());
Player it = Bukkit.getPlayer(UUID.fromString(ep.get(i).toString()));```
eternal oxide
#

what is ep?

odd adder
#

enabled_player , it is a json_array

eternal oxide
#

you will not get a valid uuid from json

#

you have to parse it

odd adder
#

yes , i parsed it , ep.get(i).toString() is a String type now

eternal oxide
#
UUID.fromString(ep.get(i).getAsString().replaceFirst( 
                        "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5" ));```
#

you may not have to do the regex IF this is just pulled from a Player and not a quiery to Mojang

odd adder
#

java.lang.IllegalArgumentException: UUID string too large
: ( same

eternal oxide
#

remove the replaceFirst(

odd adder
#

it is parsing this string "74c5424e-1e12-4c89-978a-cff4d6750ca6"

eternal oxide
#

just do the getAsString()

#

UUID.fromString(ep.get(i).getAsString());

odd adder
#

thanks , it works.

dark arrow
#

Is there any agorithm to spawn custom mobs

crimson terrace
grim ice
#

Has way too much time

#

lul

sacred mountain
#

rly? theres generators online

#

or is it complicated

quaint berry
#

I'm having an issue which is simple to fix but yet I don't know how

#

If I were to summon a zombie I need 1000 lines of information about the zombie

#

How would I get this information and spawn a zombie with it?

#

Since I don't want a 3000 line class of pain

#

Does anyone know how you would do this or even if you can?

sonic cosmos
#

Zombie zombie = (Zombie) location.getWorld().spawnEntity(location, EntityType.ZOMBIE);

quaint berry
#

Thanks

#

But what if I wanted to use the list of booleans?

sonic cosmos
#

I dont understand, can you describe it?

quaint berry
#

Let's say I wanted to spawn a zombie that's a baby with no AI

#

How would I do this?

sonic cosmos
#

zombie.setBaby(true) maybe

quaint berry
#

Oh ok

#

Thank you

tardy delta
#

ah ye if you need a zombie object

drowsy helm
#

i dont think you can put any item on the chestplate

#

helmet yes

quaint berry
#

Uh oh

#

I tried to make the zombie "float over the players head" but the loop crashed the server?

eternal oxide
#

You can not sleep nor delay the main thread

drowsy helm
#

you would have to spawn an armourstand or something

#

because it doesnt display

drowsy helm
#

yeah probs

topaz moon
eternal oxide
#

a repeating task is enough. No need for async

#

but, yes you can sleep async threads

static hollow
#

Hi, I have items stored in a config like this:

shops:
  shop1:
    owner: eeced9a1-0f41-483b-870f-c826a0462d59
    id: 1
    items:
    - !!me.notro.playershops.Utils.ShopItem
      item:
        ==: org.bukkit.inventory.ItemStack
        v: 2586
        type: DIAMOND
      price: 20
    - !!me.notro.playershops.Utils.ShopItem
      item:
        ==: org.bukkit.inventory.ItemStack
        v: 2586
        type: GOLD_INGOT
        amount: 3
      price: 80

Friend said that just parsing it like this

List<ShopItem> items =  (List<ShopItem>) shopsConfig.getList("shops." + shop + ".items");
items.forEach(item -> s.addItem(item));

Will work, but i'm getting errors that !! is wrong

#

I'll send the logs soon

eternal oxide
#

yes, serialized objects start with ==:

#

If I remember correctly

static hollow
#

Uh, so? How i can get this to work?

#

Or I'll just create the variables manually

#

hmmm

#

okay, i'll do it

eternal oxide
#

How are you serializing yoru ShopItem?

static hollow
#
for (Shop shop : shops)
{
    shopsConfig.set("shops.shop" + shop.id + ".items", shop.items);
}
saveConfig();

this?

dark arrow
#
public class StrengthZombie extends EntityZombie {
    public StrengthZombie(Location location){
        super(EntityTypes.be,((CraftWorld)location.getWorld()).getHandle());
    

    }```I unable to use this code and it give me error"x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type"
#

also i am unable to use the entityfeatures

quaint berry
unkempt peak
#

Is it possible to set the compass direction for an individual ItemStack?

quaint berry
#

Without Y'know breaking everything

eternal oxide
quaint berry
#

Player Move Event

#

Hmmmm

#

Ok

eternal oxide
torn vale
#

Why does my event not get called?
Main Class:

public class FFAHardcore extends JavaPlugin {

    // CLOUD-TARGETGROUP: ffahardcore

    private static FFAHardcore plugin;

    @Override
    public void onEnable() {
        plugin = this;
    }

    @Override
    public void onDisable() {

    }

    public static FFAHardcore getInstance() {
        return plugin;
    }

    private void registerEvents() {
        PluginManager manager = Bukkit.getPluginManager();
        manager.registerEvents(new PlayerJoinListener(), this);
    }
}```
#

    public void onPlayerJoin(PlayerJoinEvent e) {
        System.out.println("debug");
        Player p = e.getPlayer();
        PlayerInventory inv = p.getInventory();
        inv.clear();

        getItems().forEach((item) -> {
            if (item.getType().equals(Material.DIAMOND_HELMET)) inv.setHelmet(item);
            if (item.getType().equals(Material.DIAMOND_CHESTPLATE)) inv.setChestplate(item);
            if (item.getType().equals(Material.DIAMOND_LEGGINGS)) inv.setLeggings(item);
            if (item.getType().equals(Material.DIAMOND_BOOTS)) inv.setBoots(item);
            if (item.getType().equals(Material.DIAMOND_SWORD)) inv.setItem(0, item);
            if (item.getType().equals(Material.GOLDEN_APPLE)) inv.setItem(1, item);
        });
    }

    private List<ItemStack> getItems() {
        List<ItemStack> items = new ArrayList<>();

        ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET);
        helmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
        items.add(helmet);

        ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
        chestplate.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
        items.add(chestplate);

        ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS);
        leggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
        items.add(leggings);

        ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS);
        boots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
        items.add(boots);

        ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
        sword.addEnchantment(Enchantment.DAMAGE_ALL, 1);
        ItemMeta swordMeta = sword.getItemMeta();
        swordMeta.spigot().setUnbreakable(true);
        sword.setItemMeta(swordMeta);
        items.add(sword);

        ItemStack apples = new ItemStack(Material.GOLDEN_APPLE, 10);
        items.add(apples);

        return items;
    }
}```
#

Event Class

#

it prints nothing

unkempt peak
eternal oxide
#

Is it annotated @fresh templethandler ?

crimson terrace
#

aww shit

crimson terrace
#

unlucky name there XD

eternal oxide
tardy delta
#

Poor dude who is tagged

crimson terrace
#

how can I make sure config comments are not deleted when setting config values?

unkempt peak
eternal oxide
crimson terrace
#

thanks

torn vale
#

?paste

undone axleBOT
torn vale
eternal oxide
#

No reason you should not see the debug message

torn vale
#

it does not get printed ๐Ÿคท

crimson terrace
#

save() method doesnt exist

eternal oxide
torn vale
#

just use auto-complete lol

eternal oxide
torn vale
#

bruh

unkempt peak
#

Is it possible to have 2 compasses with different targets in a players inventory in 1.12.2?

torn vale
#

ty xd

unkempt peak
#

Hmm ok well I'll have to figure something else out then

#

Thanks

eternal oxide
#

I don;t believe Lodestones existed before 1.16

tender shard
#

in 1.12.2 the compass target is set per player

quaint berry
#

How do you use bukkitTask?

eternal oxide
#

?scheduling

undone axleBOT
quaint berry
#

Yay

#

I still don't get it

#

:(

tender shard
#

do you actually need a BukkitTask? runnables are easier to use

eternal oxide
#

he needs a runnable

quaint berry
#

Uhhhhh

eternal oxide
#

its all in the wiki link

quaint berry
#

I want to do something every tick

#

So the wiki

#

Got it

tender shard
#
public void onEnable() {
        Bukkit.getScheduler().runTaskTimer(myPlugin, () -> {
            Bukkit.broadcastMessage("This message is printed every tick.");
        },0,1);
    }
#

0 is the initial delay, 1 means every other tick from then

quaint berry
#

I got that part but what is myPlugin?

tender shard
#

the instance of your main class

quaint berry
#

Oh

tender shard
#

if you do it in onEnable, you can just use "this"

#

because obviously "this" is your class that extends JavaPlugin in your onEnable method

eternal oxide
#

if you are doing it in your PlayerListener you use Dependency Injection

#

?di

undone axleBOT
eternal oxide
#

new PlayerListener(this)

quaint berry
#

Uhhh

quaint berry
eternal oxide
#

depends if you need it

tender shard
#

?learnjava

undone axleBOT
eternal oxide
#

you are going to float a zombie over the player when he logs in?

quaint berry
#

Lemme type this

eternal oxide
#

in that case you need to create your runnable when you spawn the zombie

tender shard
#

you probably want to schedule your runnable in your main class and in your command executor, simply add the player to a list / map whatever

quaint berry
#

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        if(!(commandSender instanceof Player)) {
            commandSender.sendMessage("Only players can use that");
            return true;
        }
        Player player = (Player) commandSender;
        if (command.getName().equalsIgnoreCase("auracheck")) {
            if (strings.length == 1) {
                Player target = Bukkit.getPlayer(strings[0]);
                if (target != null) {

                    Server server = target.getServer();
                    World world = target.getWorld();
                    Location playerLocation = target.getLocation();
                    Location playerAbove = target.getLocation();
                    playerAbove.setY(playerAbove.getY() + 5);
                    Zombie zombiespawn = (Zombie) world.spawnEntity(playerAbove, EntityType.ZOMBIE);
                    Bukkit.getScheduler().runTaskTimer(myPlugin, () -> {
                        Bukkit.broadcastMessage("This message is printed every tick.");
                    },0,1);


                }
            }
        }

        return false;
    }
}
tender shard
#

there's no need to schedule one runnable per player

eternal oxide
#

true

tender shard
#

I'd rather use one runnable for all players who have this feature enabled

eternal oxide
#

update all with a single runnable

tender shard
#

I mean it'll also work in this way but it's just not needed

quaint berry
#

OHHH

#

I get you now

#

I'm a spaz

#

If I put the getSchedular in the onEnable I can just use it for everything

tender shard
#

yes that's what I meant

harsh totem
#

What is the Material of a Clownfish item?

#

ok thx

tender shard
#

I hate how FileNotFoundException is not a runtime exception

harsh totem
#

I know that poison effect can't hurt you when you're at 1 hp but is there a way to bypass that?

tender shard
#

All I could think of is a very ugly workaround

#

like looping over players, check if they have a poison effect, then manually apply the damage if they are at 0.5 hearts already

harsh totem
#

ok i'll just use wither

jagged thicket
#

its not that ugly lol

#

its big brain ๐Ÿง 

quaint berry
tender shard
#

also intellij's "search for dependency" window is so useless. obviously I'm looking to add apache commons lang 3 but all it shows me is other libraries that include apache commons >.<

quaint berry
#

This is my onEnable

#

This is a separate class that I want to tp the zombie due to the variable being in this class

#

But they are to different classes?

tender shard
#

I'd store a List<Entity> as a Field in your main class

quaint berry
#

Uhhhhhh

#

I'm not to good at Java yet

granite owl
#

is there an event for the anvil when i actually use it?

earnest forum
#

learn java

#

please

#

it helps so much

granite owl
#

not the prepareanvilevent

earnest forum
#

inventory click event right?

tender shard
# quaint berry I'm not to good at Java yet

sth like this in your main class:

public class Main extends JavaPlugin {
    
    List<Entity> myZombies = new ArrayList<>();
    
    public List<Entity> getZombies() {
        return myZombies;
    }
earnest forum
#

check if the inventory is of type anvil

tender shard
#

then you can do myPlugin.getZombies()

#

whenever you spawn a zombie, add it to that list

#

myPlugin.getZombies().add(theZombieYouJustSpawned)

granite owl
#

like the FurnaceStartSmeltEvent and FurnaceSmeltEvent(finish)

tender shard
earnest forum
#

anvil doesnt

#

like i said just use inventory click event and check if the inventory is of type anvil

#

the outcome slot should be id 2

eternal oxide
granite owl
#

i want to set the required repair material to another

#

than the vanilla one

#

so

#

xD

quaint berry
#

God dammit

#

To make this easy, does anyone know where to learn Java?

eternal oxide
#

?learnjava

undone axleBOT
quaint berry
#

Thank you

crimson terrace
#

kek

quaint berry
#

Teacher made us do our python assessment on paper Lmfao

high ridge
#

Anyone having issues with their project not downloading required libraries?

tender shard
#

no

#

are you using intellij + maven?

eternal oxide
#

oh you remember last night a chap was having issues with building. It would not download a dependency

granite owl
#

is it by the bukkit api possible to change an items required material to repair it?

quaint berry
eternal oxide
#

turns out he had teh scope set to shade and maven completely ignored it as a dependency to download. Not even a valid scope

tender shard
#

wtf there is no "shade" scope

eternal oxide
#

InteliJ just completely ignored it, Eclipse warned of the scope

tender shard
#

oh yeah why didn't we see this earlier lol

#

it was the fifth line in the maven output lol

#
[WARNING] 'dependencies.dependency.scope' for com.moandjiezana.toml:toml4j:jar must be one of [provided, compile, runtime, test, system] but is 'shade'. @ line 78, column 20

eternal oxide
#

Yep we both missed it

#

It much more of a warning in Eclipse so I saw it when I tried to compile

tender shard
#

yeah intellij doesn't show any warning for this

#

I wonder why they set it to "shade" anyway lol

eternal oxide
#

beginner(ish) error

#

it had to be shaded and I guess it was guesswork on his part

granite owl
#

am i supposing it right that a material

#

a tool

#

has a hardcoded material thats required to repair it?

tender shard
#

does someone know if File#deleteOnExit() works for non-empty directories?

#

the javadocs don't say anything

ivory sleet
#

its name is deleteOnExit no?

tender shard
#

erm yeah

#

that's what I meant

ivory sleet
#

oh yeah well I believe it does work, not that I tried cuz File is kinda obsolete but ye

tender shard
#

File is obsolete? why's that?

eternal night
#

Path ๐Ÿ™

ivory sleet
#

many methods dont throw accurate exceptions, or exceptions at all when failing

#

well

#

Ill link you

eternal night
#

I mean it all is just Path and the Files class these days no ?

ivory sleet
#

Plugin::getDataFolder :c

eternal night
#

flame spigot

tender shard
#

oh well but many things simply work with Files and not with Paths

#

for example I'm using Zip4J and it only takes a File or String

ivory sleet
eternal night
#

flame zip4j

tender shard
#

I will hunt down the address of the author and burn their house down down

#

or I just keep using Files lol

ivory sleet
#

๐Ÿฅฒ

tender shard
#

ugh another question about Files

#

FileUtils.copyDirectoryToDirectory() creates a subdirectory

#

is there a similar method that simply merges two folders without putting the contents of the source into a subdirectory inside the destination?

rotund pond
#

Hello everyone !
I would like to do a file inside my plugin folder to write every little information about my plugin.
Something like README.md on github...
Which extension should I use please for your opinion ?

Ty ๐Ÿ™‚

tender shard
#

i'd just use .txt

rotund pond
#

Oh well, I though there were a "special" extension for this x)
Ty ^^

crimson terrace
#

On that note, is it possible to upload a zipped folder instead of just the jar file to spigot?

tender shard
#

yes

earnest forum
#

no

tender shard
#

of course

rotund pond
#

๐Ÿ‘€

tender shard
#

that works fine

#

but stuff like replacing the premium resource placeholders will then not work

crimson terrace
#

Great, that way its easier to supply documentation

#

What do you mean with placeholders?

tender shard
#

stuff like public String userId = "%%__USER__%%";

crimson terrace
#

Ive never made a premium resource, would you recommend I use another way to supply documentatiin for the user?

tender shard
#

I just always put all information on the spigot page itself

#

and I have a ton of comments in my .yaml files

crimson terrace
#

It seems half the people who download dont read the spigot page. I suppose that is different for premium resources

tender shard
#

I always start my config files with general information about permissions, commands etc

#

and then every config option always has a huge explanation too

crimson terrace
#

Oooo i usually make gigantic config files... That would make the size be like 1000 lines

granite owl
#

wow ive written a template to allow repairing any item with any material by replacing the material on corrisponding events to the vanilla repair material

rotund pond
#

"Main" :x

tender shard
crimson terrace
#

Currently Im making a plugin where people can define their own creatures based on vanilla creatures and I need all the data for each one which is like 50 lines in itself... Commenting that is horror tbh

rotund pond
tender shard
#

oki

quaint mantle
#

whats the resource prompt for?

rough drift
#

resourcepacks

quaint mantle
#

i just randomly put in test-prompt and it ended up with an error

rough drift
#

can we see the error

#

?paste

undone axleBOT
quaint mantle
#

i was assuming it changes the way the server asks you to change resource packs

rough drift
#

JsonReader.setLenient(true)

#

add that

#

to your json reader

#

mc json isn't actually valid json

quaint mantle
#

i'm not reading it though?

#

its from the api itself

rough drift
#

hm?

#

can I see some code

quaint mantle
#

no like I'm not reading this file at all

rough drift
#

can I see your code

quaint mantle
#

its in server-properties

#

you mean in my main?

rough drift
#

oh wait

#

yeah that could be useful

quaint mantle
#

its not really an issue for cause i can just leave it empty

#

i was just curious what its for so i just set it in server.properties as test prompt

fossil lily
#

Let's go!?!?!

quaint mantle
#

just googled abit, seems like it needs to be json format

tender shard
#

for those prices I'd just get a dedicated server instead

#

almost 3$ per HOUR for 64 gb of ram?!

eternal night
#

isn't code spaces free for individuals o.O

tender shard
#

idk I just looked at this page

quaint mantle
#

is it something that updates github as you code?

#

never saw this kind of thing before

eternal night
#

no

#

you still have to commit

tender shard
#

oh yeah

#

but it's still very expensive

#

like after 40 hours I could instead just get a 128 GB / 32 core dedicated server at hetzner instead

#

and use that the whole month

eternal night
#

Cannot wait for Fleet

#

to host that on a remote

#

and well, idk who in their mind uses codespaces

fossil lily
sullen fox
#

Is there something in java like setInterval() and setTimeout() in javascript?

dense falcon
#
package fr.program.testplugin.commands;

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

public class AnnonceCMD implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (command.getName().equalsIgnoreCase("annonce")) {
            if (sender instanceof Player) {
                Player plr = (Player) sender;

                if (args.length <= 0) {
                    plr.sendMessage(Color.RED + "ERREUR" + Color.WHITE + " | Veuillez donner des arguments pour votre annonce !");
                } else {
                    StringBuilder finalMessage = new StringBuilder();

                    for (String part : args) {
                        finalMessage.append(part + " ");
                    }

                    Bukkit.broadcastMessage(Color.WHITE + plr.getDisplayName() + "][" +  Color.RED + "ยง4ANNONCE " + Color.WHITE + " ] " + finalMessage.toString());
                }
            }
        }

        return false;
    }
}

Hello guys, why I am gettings this :

dense falcon
#

I can send an img wait.

wintry cloud
#

How can i create custom Hitboxes for armorstands?

dense falcon
sullen fox
fallow violet
sullen fox
fallow violet
#

your welcome

dense falcon
#

@fallow violet

fallow violet
#

you cannot use Color in your messages

#

I mean

dense falcon
#

It comes from Bukkit...

#

I tried with ยง4 and I am getting something like it as well.

fallow violet
#

well just use the colorcodes provides from spigot like &5 or &9. But replace the & with a paragraph

dense falcon
#

Yes.

#

Ah & and no ยง ?

fallow violet
#

no its paragraph

#

but you can use ConsoleColor instead of Color

#

And because Color comes from bukkit but it doesnt mean it works in console, yk?

dense falcon
#

ยง did not work as well.

#

It gives me but, I am getting this letter "a".

#

I did with ยง.

fallow violet
#

what minecraft versin

#

and what java version?

dense falcon
#

1.18.1 and Java 17.

#

```java
package fr.program.testplugin.commands;

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

public class AnnonceCMD implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

    if (command.getName().equalsIgnoreCase("annonce")) {
        if (sender instanceof Player) {
            Player plr = (Player) sender;

            if (args.length <= 0) {
                plr.sendMessage("ยง4ERREUR ยงf| Veuillez donner des arguments pour votre annonce !");
            } else {
                StringBuilder finalMessage = new StringBuilder();
                for (String part : args) {
                    finalMessage.append(part).append(" ");
                }
                Bukkit.broadcastMessage("ยงf" + plr.getDisplayName() + "][ยง4ANNONCEยงf] " + finalMessage.toString());
            }
        }
    }

    return false;
}}
#

I tried with & as well -> did not work.

#

It does not "understand" or idk.

granite owl
#

sorry to have to ask not that fit in java, is it somehow possible to store a "pointer to method" in a hashmap so i can call that method by the maps key?

dense falcon
#

Oh yeah thanks !

granite owl
midnight shore
#

You can save functions which are basically methods

granite owl
#

and how?

midnight shore
midnight shore
#

I guess

granite owl
#

i basically have rightclick abilities and instead of hardcoding every if else if to get the right ability i want to store them in a hashmap and target them by the items type which is also a pdc key

#

hm

tardy delta
#

that will be painful to handle method parameters with

#

why not having an enum or smth?

drowsy helm
midnight shore
#

You can just have a class for the ability and use that as the argument tbh

midnight shore
#

Or the rightclick event itself

#

Not that hard

granite owl
#

but then i have to write it for every item

#

with an if else if

#

which is not what i want

midnight shore
#

No

#

I mean

#

Pass the event as the function argument

granite owl
#

rn the items are hardcoded however later ill load them

#

using a parser

midnight shore
#

Or simply use an enum with a function

#

Which may be easier to handle

drowsy helm
#

depending on your usecase hardcoded items can sometimes be better

tardy delta
#
class Ability {
  String name;
  abstract void exec(PlayerInteractEvent e);
}```
#

anyways i'm currently having a Storage interface and some implementations for databases, should i let the storage methods return futures?

#

or is there a more elegant solution

ivory sleet
#

Is the storage interface a direct abstraction or is it an adapter or is it some sort of facade?

tardy delta
#

i dont understand anything of that sentence lol

#

i was trying to abstract all the storage logic

drowsy helm
#

so is this an interface to interact with a storage controller or the controller itself

tardy delta
#

wdym controller?

#

this is basically what its supposed to do

ivory sleet
#

That looks good

#

Donโ€™t return futures in that one

#

Create an adapter

#

Which does return futures by delegating an instance of its delegate type

tardy delta
#

so like the thing you recommended me before

ivory sleet
#

Yes

tardy delta
#

so i dont longer have to interact with that thing itself

#

ok

ivory sleet
#

Well it helps with concurrency a lot (separating actual business logic and multithreading as much as possible where we have humble classes that know as little as possible about the multithreaded environment they face)

tardy delta
#

x)

#

discord rich presence not working on linux brr

granite owl
#

BiConsumers work perfectly fine for me

#

๐Ÿ˜›

#

no error whatsoever

#

functions being called properly

#
public boolean onRightClickAbility(PlayerInteractEvent event)
    {
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR)
        {
            ItemWrapper item = new ItemWrapper(event.getItem(), null);
            
            if (item.getItemStack() != null)
            {
                if (item.isCustomItem())
                {
                    if (item.getRightClickable() != 0)
                    {
                        String item_type = item.getItemType().toLowerCase();
                        
                        if (CustomItems.itemList.containsKey(item_type))
                        {
                            if (CustomItems.itemList.get(item_type).getAbility() != null)
                            {
                                CustomItems.itemList.get(item_type).getAbility().accept(event.getPlayer(), item.getItemStack());
                                event.setCancelled(true);
                                return true;
                            }
                        }
                    }
                }
            }
        }
        
        return false;
    }
#

only need to register the ability to my item list then

tardy delta
#

do you know about the existence of early returns?

granite owl
#

uhm what for

#

xD

tardy delta
#

they will kill you in your sleep if you dont use them

granite owl
#

if one conditional check is not given

#

it exits

tardy delta
#

im nearly falling asleep in front of my pc

#

aaaa

eternal needle
#

hi i have a gui and i want to pick ho to take money from and i don't get the code rigth i get a white line over withdrawPlayer

            case WOODEN_AXE:
                //Get name
                String name = e.getClickedInventory().getItem(4).getItemMeta().getDisplayName();
                economy.withdrawPlayer(name, 1000);
tardy delta
#

a white line over withdrawplayer?

river oracle
#

He means depreciation probably using eclipse or something

#

It's super annoying that people don't learn what shit means and just describe how it looks

#

It definitely doesn't help people help you

tardy delta
#

yep

#

FINALLY

#

i got that rich presence to work on linux

eternal needle
#

yes like this withdrawPlayer

river oracle
#

Nice

river oracle
#

You should know what it means if your using java

tardy delta
#

withdrawPlayer

eternal needle
river oracle
river oracle
tardy delta
#

itz cuz i got it from flatpak

river oracle
#

Ahhh

tardy delta
#

installing it manually with the deb file worked

#

kde neon btw

river oracle
#

I use Ubuntu with KDE ui

#

Was using gnome but it ugly

spiral hinge
eternal needle
#

now i know what it means but i see that is the string name but how can i fix it?

glossy venture
#

you dont need to fix it necessarily, it will still compile and run, but it might be better to use a method that is not deprecated

#

you can look at docs or see it in the autocompletion

#

which ones are and arent deprecated

eternal needle
glossy venture
#

what api is it from?

#

vault?

#

also

#

?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.

tardy delta
#

vault ye

glossy venture
eternal needle
tardy delta
#

does the player has an account and has enough money?

glossy venture
#

u sure the code is being called?

eternal needle
eternal needle
tardy delta
#

add sysouts then

glossy venture
#

look at the vault source

#

they might have removed the functionality for deprecated methods

#

and yeah add sysouts

eternal needle
#

but nothing happens it's just not taking money

glossy venture
#

might be the problem too

tardy delta
#

check what the economy response is

#

the return type

harsh totem
#

What cauldron level is an empty cauldron?

glossy venture
#

id guess 0

river oracle
#

0

#

Probably

harsh totem
tardy delta
#

take a look at the docs i'd say

river oracle
#

Idk then just make a debug statement

harsh totem
#

Cannot set property BlockStateInteger{name=level, clazz=class java.lang.Integer, values=[1, 2, 3]} to 0 on Block{minecraft:water_cauldron}, it is not an allowed value

glossy venture
#

print the level

delicate lynx
eternal night
#

Empty cauldron is a different material

#

Not water cauldron

tardy delta
#

;o

#

everyone trying to help and all being wrong

harsh totem
#

so I need to check if it is the minimun and then set it to an empty cauldron?

#

i'll just cancel event

eternal night
#

Dunno what you are doing but yes you need to change it to a plain cauldron if you want the empty appearance

gaunt talon
#

Hello guys, I have a problem with my Spigot 1.18.1 / Java 18 plugin, console tells me ```err
Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "my.example.plugin.Main.getCommand(String)" is null

but ... command exists in my plugin.yml 

```yml
commands:
  test:
    description: it's a test bro

I tried to replace tabulations by spaces, but it's the same error ๐Ÿง

midnight shore
#

Do the plug-in command name and the main class one match?

#

You should have getCommand(โ€œtestโ€).setExecutor(your class);

gaunt talon
midnight shore
#

Weird

gaunt talon
#

yea duke

green prism
#

Cannot resolve method 'getPersistentDataContainer' in 'ItemMeta'
Help?

glass mauve
#

show your code

green prism
#

ItemStack creditStack = plugin.itemStore.getPlayerCreditCard(plugin.basicCardStack, player, String.valueOf(randomNumber));
ItemMeta meta = creditStack.getItemMeta();

                creditStack.getItemMeta().getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, Math.PI);
tardy delta
#

public fields aaa

#

on what version are you?

green prism
#

1 16 5

gaunt talon
# midnight shore Weird

Ok, I understand, I use for the first time the extension "Minecraft" of IntelliJ, this one create automatically "plugin.yml", so it's doesn't read my plugin.yml

#

thank you for trying to help me

terse raven
tardy delta
#

it probably returns a @smoky tinsel Integer

#

bruh

#

take a fking other name

#

lol

terse raven
#

it has the @NotNull tag

#

so this is kinda weird

coarse shadow
#

can we add a datapack to a world that we create through plugin?

#

in code i mean