#help-development

1 messages Β· Page 570 of 1

next zinc
#

?paste

undone axleBOT
next zinc
#

could 100% be wrong for some of them though

#

but blame chatgpt for that

#

:)

woeful crown
#

a quick look and anyone can see its wrong haha, never rely on chatgpt for facts

echo basalt
#

nothing on bukkit but if we check nms

echo basalt
next zinc
#

Β―_(ツ)_/Β―

echo basalt
#

doors are also a thing

#

what the fuck

next zinc
#

makes sense

echo basalt
#

Here's blocks that also break if you break the block under

woeful crown
#

amazing, much appreciated!

echo basalt
#

I don't see scaffolding tho

woeful crown
#

scaffolding is behaving different

glossy venture
#

scaffold is just built different

woeful crown
echo basalt
#

give an example of a drop that drops nothing

woeful crown
#

vine

echo basalt
#

uhm

#

Block#getDrops#isEmpty

#

nms should match it

echo basalt
#

the devs couldn't bother writing proper checks

#

so they recalc the distance for each scaffold

#

every tick

#

It's like a tile entity

opal carbon
#

nah rust is sexy

warm light
#

is it possible to check if mob killed by powered creeper in EntityDeathEvent ??

echo basalt
#

Yeah

#

I'd rather use EntityDamageByEntity

#

just because it's easier to have context

#

and just check the damage and health

#

if health - damage <= 0

#

type deal

warm light
#

like if dead, then do stuff

echo basalt
#

The event is cancellable to the entity won't be dead at the time the event is fired

warm light
#

oh

warm light
# echo basalt Yeah

can you give me a flowchart of doing it in EntityDeathEvent please? or just explain in short?

grave kayak
#

im making a large advancement tree and i need to store player data eg. how many potions they have brewed to date. what would be the best way to store all this data.

sweet sonnet
#

file-based database?

quaint mantle
#

im so lost here not sure why im even getting this java.io.FileNotFoundException: decompiled\org\benf\cfr\reader\api\CfrDriver$Builder.java (The system cannot find the path specified)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.example.commands.command.Decompile.decompileJar(Decompile.java:84)
at org.example.commands.command.Decompile.lambda$execute$0(Decompile.java:53)
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670)
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:575)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:594)
at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:457)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172) im trying to make decompiler

sweet sonnet
#

use this;

#

?paste

undone axleBOT
quaint mantle
#

whoops

sweet sonnet
#

the system cant find the path

quaint mantle
#

The path to what though?

sweet sonnet
#

the jarFile parsed to decompileJar (i think idk)

quaint mantle
#

hm

#

It shoots the werror out at File zipFile = new File("decompiled.zip");

dawn hazel
#

!paste

#

fuck whats the command

#

?paste

undone axleBOT
dawn hazel
sweet sonnet
dawn hazel
#

yeah, im trying to find out why its returning null. it wasnt before now it is which is really confusing

quaint mantle
#

I tried using JD Core to decompile but it didn't seen to work it just gave me an empty file

dawn hazel
#

oh wait

#

i think i know

hidden saffron
#

im trying to have the player drop a newly spawned in apple on the floor when they die. This is my code so far

#

i very new to this so idk what im doing πŸ’€

quaint mantle
#

Why kotlin?

dawn hazel
#

so im trying to convert my json userdata array to a hashmap. it doesnt throw any errors but when i log it to console it says that the map is null in that position and i have no idea why

public void ConvertDataToMap() {
        required2FA.dataListMap.clear();
        for (int i = 0; i < required2FA.dataList.size(); i++) {
            required2FA.dataListMap.put(required2FA.dataList.get(i).UUID, required2FA.dataList.get(i).Password);
            System.out.println(required2FA.dataList.get(i).UUID);
            System.out.println(required2FA.dataListMap.get(i));
        }
    }```
glacial narwhal
#

Hi, does anybody know how to change Kill message ? (with a Listener)

sweet sonnet
#

Does 1.8.8 just not like configs?

noble lantern
#

not really

sweet sonnet
#

fuck me sideways

sweet sonnet
hybrid spoke
undone axleBOT
noble lantern
#

?paste

undone axleBOT
noble lantern
ocean hollow
#

Why it doesn't work?

#

why it trying to find it in papermc?

noble lantern
ocean hollow
#

i have it

noble lantern
#

tried reloading the project & invalidatinging intellij cache?

#

send me the imports too i can try em

ocean hollow
#
            <groupId>com.github.plan-player-analytics</groupId>
            <artifactId>Plan</artifactId>
            <version>5.5.241</version>
            <scope>provided</scope>
        </dependency>```


```        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>```
noble lantern
#

seems they pushed a bad build

ocean hollow
#

oh, thanks πŸ˜™

noble lantern
sweet sonnet
subtle folio
sweet sonnet
#

InteliJ moment

subtle folio
#

Yep

subtle folio
sweet sonnet
#

I just do what it says so it shuts up

subtle folio
#

lmao

#
Permission receiveReport = new Permission("snowreports.report.receive");
getServer().getPluginManager().addPermission(receiveReport);```
#

You yourself aren't making a permission plugin.. what's the need for this?

sweet sonnet
#

Uhhh.... 🀫

#

If you need a permission for a command, does it just create one?

subtle folio
#

Other plugins like vault or lp will do this for you and it may actaully cause an exception

subtle folio
sweet sonnet
#

Okay, thanks

subtle folio
#

okay ,

import static org.bukkit.Bukkit.getOnlinePlayers;
import static org.bukkit.Bukkit.getPlayer;
``` Import static is not something you should use lightly. As the makers of java have officially stated:

> So when should you use static import? Very sparingly! Only use it when you'd otherwise be tempted to declare local copies of constants, or to abuse inheritance (the Constant Interface Antipattern). ... If you overuse the static import feature, it can make your program unreadable and unmaintainable, polluting its namespace with all the static members you import. Readers of your code (including you, a few months after you wrote it) will not know which class a static member comes from. Importing all of the static members from a class can be particularly harmful to readability; if you need only one or two members, import them individually.
sweet sonnet
#

So just import Bukkit and call it from Bukkit right

subtle folio
#

Bukkit.getOnlinePlayers Bukkit.getPlayer()

#

Yes

sweet sonnet
#

πŸ‘

subtle folio
#

Now, on the surface, this isn't totally horrible.

if (!(Objects.equals(config.getString("discord-webhook-url"), ""))) {
                DiscordWebhook webhook = new DiscordWebhook(config.getString("discord-webhook-url"));
                webhook.addEmbed(new DiscordWebhook.EmbedObject()
                        .setDescription("**" + reportedPlayer.getName() + "** has been reported for: " + reason)
                        .setFooter("Reported by: " + reporter.getName(), "https://mc-heads.net/avatar/" + reporter.getUniqueId()));
                webhook.setUsername("SnowReports");

                try {
                    webhook.execute();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
``` But because you run the same if check every time a command is run, might be best to make a seperate class that wraps all this info
#

for this type of if check you should run it in onEnable and then throw an error

sweet sonnet
#
if (Objects.equals(config.getString("discord-webhook-url"), "")) {
            getLogger().warning("discord-webhook-url is not set, reports wont be sent to discord!");
        }

I have this in onEnable, but not throwing an error.

ocean hollow
subtle folio
#

Not sure if you saw this, but also act upon that.

sweet sonnet
#

okay

subtle folio
#

And the url scheme is quite literally the same

#

other than that, great plugin!

sweet sonnet
#

Thanks

#

I made something similar to this about a year ago but lost interest in Java and plugin development

sweet sonnet
subtle folio
subtle folio
noble lantern
#

whats the purpose of increasing buffers for reading btw? Is it bad to set them too high/low? i normally just see most examples online using 1024

noble lantern
#

i kept getting that notification earlier tbh but didn't know what it meant

#

sec googling

#

ahh so inlined

chrome beacon
#

It will ensure things are closed

#

So mem leak if there's an error

noble lantern
#

so instead of the regular try / catch i would do

try (//variables that throw io in here; //another; //another) {

}

Havent ever really played with em whats really the different between the two? Or is it like with inlined variables in the new instance of checks?

#

with the assurance that the resources will be closed after the execution of that block

Ahh

chrome beacon
noble lantern
#

so it just ENSURED 100% the failed variables get destroyed

chrome beacon
#

Yeah

noble lantern
#

i always kinda assumed they did in try/catch tbh

#

good to know ty!

chrome beacon
#

In old Java you'd use try catch and close in a final statement

quaint mantle
#

yo whats the prefix for todays date and year

#

?

#

in mc

noble lantern
#

a lot of my brain is still stuck in old java mode, for exmaple the try/catch, and then not using bufferd readers earlier 🀣

noble lantern
quaint mantle
#

1s

#

this

#

%%

#

like prefix

noble lantern
#

you mean placeholder haha?

quaint mantle
#

yes it is

#

but

#

whats the prefix for it

#

like

#

Jun 16 2023

#

but

#

it does it auto

noble lantern
#

not entirely sure i assume spigot/mojang just do it themselves

Or the Calender API might be able to abreviate months

#

you can always just splice the first 3-4 letters of the month too (prolly best option)

quaint mantle
#

no its a prefix

#

people usually use for scoreboard

#

like papi or sum

noble lantern
#

i-

quaint mantle
#

like the same u have %vault_balance% and it displays

#

on scoreboard

noble lantern
quaint mantle
#

but i need it as a date

#

yeah ik

noble lantern
#

its a placeholder one sec

quaint mantle
#

i alr seen this

#

but ive trid

noble lantern
#

should be able to display it using the SimpleDateFormat

quaint mantle
#

and cant find

#

whats the %%

#

for i

#

t

noble lantern
#

then another plugin is registering it as a placeholder

quaint mantle
#

wym

#

%localtime_time_<SimpleDateFormat>%

#

this i thinj

noble lantern
#

actually no you can do it with sdf

noble lantern
#

and you said you tried it lmao

tardy delta
#

hmm in my maven project with different modules, i need to depend on another module, is there a way to tell maven to not look into maven central?

#

for whatever reason it doesnt work anymore

quiet ice
#

Does the module build order match?

tardy delta
#

i have a distribution module that depends on two modules it needs at runtime, for the rest not really

quiet ice
#

What I'm saying is if you build the parent module, does it build the modules in the order you'd expect?

noble lantern
#

i think hes having issues actually reloading the project

#

so buildings prolly off the table rn

tardy delta
#

wait looks like it tries to pull thr wrong version

#

πŸ’€

noble lantern
#

mf

#

πŸ’€

tardy delta
#

shouldnt be hardcoding them

noble lantern
#

same but idk how to automate it so i dont bother

#

i just ctrl + f my version

tardy delta
#

could probably do ${parent.version}

#

but then i still have the version in my parent tag

noble lantern
#

i always find it hard to do small qol things

quiet ice
#

Yeah, versions in multi-module builds can be a pain

noble lantern
#

like i just cant

tardy delta
#

cant i like specify one 'lastest version' property somewhere?

quiet ice
#

there is the maven-versioning-plugin (or however it is called) to alleviate the difficulties of version changes but I never used it and I don't think that it is a super useful plugin

noble lantern
#

doesnt work sadly

#

i tried :c thought i could be slick doing latest too

quiet ice
#

Also isn't great if you want to build an older version for whatever reason only for it to use a newer version that may be incompatible

tardy delta
#

hmm project.version in a sub module is the same as project.parent.version πŸ’€

quiet ice
#

not necessarily

tardy delta
#

just to keep it interesting :)

noble lantern
quiet ice
noble lantern
#

oops

#

didnt mean to reply to that sorry

#

however reply does fit the message tbf

quiet ice
#

If you are a fan of SemVer you could use version ranges to have it only break half the time though

#

Beware to not use the range [1,2) but rather use the range [1,1.999]

noble lantern
#

no thanks its bad enough my code only works half the time, dont need my maven doing that too CH_Kek

tardy delta
#

btw is System.console() actually a thing? it always returns null

#

or does it rely on some system prop

#

"returns null if there is no console" hmm ij doesnt have a console then :|

wraith bane
#

"Unfortunately, your recent report has been rejected: Resource Update in <resource name> - Demno obfuscation"
What does that mean? I obfuscated using allatori not demno

tardy delta
#

hmm now it still searches in maven central, am i supposed to install those modules to my local repo or smth?

#

ye

#

im wondering how it worked before then lol

quiet ice
#

Eclipse will do the hardest part for you anyways

vital sandal
#

:l I’ve seen server packet contain chunk data with numbers

#

So if those numbers referred to block ID so where are the nbt of the block storages ?

tardy delta
vital sandal
#

Like there are chest and stuffs have those data

sullen marlin
wraith bane
#

What free obfuscator can I use?

sullen marlin
#

Yes, the demo version is a demo version

wraith bane
#

What other obfuscators that are free can I use?

sullen marlin
warm mica
wraith bane
#

Ok, but also allori is on that list, so I don't really understand what's the issue, why is only the paid version allowed, what's the difference?

chrome beacon
#

It's for demo not releasing things with it

noble lantern
#

How come this keeps happening when trying to clean its soo annoying intellij has administrator perms

#

is there just no way to make maven force clean without any care cause its just a large hinderance for my project (or any of them, happens on any moduled project) at this point

Seems the file is semething from some test task even though im just doing clean package

full glade
#

How to create a wither skeleton with a custom item in his hand and on his head?

true perch
#

Although my api-version is set to 1.20 within my plugin.yml file, I am getting this error:console [12:17:40 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin '7rbuild-1.0-SNAPSHOT.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.2 Any advice?

#

thank you

noble lantern
#

?paste

undone axleBOT
cinder abyss
#

Hello, how can I do something like an EntityMoveEvent ?

hollow beacon
#

what

cinder abyss
hollow beacon
#

google πŸ™‚

#

what have you tried, what didn't you try

#

etc etc

cinder abyss
hollow beacon
#

show the code that you have now

cinder abyss
cinder abyss
hollow beacon
#

oh entitymove doesn't exists iirc

cinder abyss
hollow beacon
#

you can use protocollib

cinder abyss
noble lantern
#

https://paste.md-5.net/awogidonoh.java

Anyone have any ideas why files from the zip files are being written to as null text?

File names and everything is fine but the actual contents are just null for everything

cinder abyss
#

(and this is not what I want to use)

hollow beacon
cinder abyss
hollow beacon
#

or use a specific fork of spigot we can't name here

#

Β―_(ツ)_/Β―

cinder abyss
cinder abyss
# hollow beacon there is no other solution

I forgot ! I have this :java manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.REL_ENTITY_MOVE) { @Override public void onPacketReceiving(PacketEvent event) { Player player = event.getPlayer(); PacketContainer packet = event.getPacket(); } });

noble lantern
#

this isnt the paper discord you wont get banned for saying other forks in here lol

cinder abyss
noble lantern
#

most in here use paper anyways

for tehyre server software

cinder abyss
subtle folio
noble lantern
noble lantern
cinder abyss
#

okay I see thanks

subtle folio
#

@noble lantern i’d console.log everything

#

and see where that gets me

noble lantern
#

idk what to log because i is just a byte kek

#

oh

#

seems buffer was breaking it

#

writing the byte directly is fine

#

and doesnt sacrifice speed weird

#

then wtf is buffer for FUUUK

wraith bane
#
public static final String COPYRIGHTED =
            """
            Copyright Β© 2023 Kyren223. All rights reserved.
            """;

Is adding this to every class in my project fine by spigot?
I got rejected for using an obfuscator, so instead of obfuscating it, I'll just add this.
Just wanted to make sure spigot won't reject my plugin because of it

vast ledge
#

You can add the copyright as a comment at the top of ur class or use intellij copyright feature

wraith bane
#

My question is if it's allowed and I won't get rejected again because of it

hollow beacon
#

maybe this suffices

#

automation is always better πŸ˜„

wraith bane
#

I am not asking for better ways to do it, I am asking if what I did is fine and won't get rejected

hollow beacon
#

cry about it

wraith bane
#

Bruh

hollow beacon
#

i'm just giving a tip man

wraith bane
#

If you cannot help with my questions then don't answer, don't tell me better ways to do stuff I already did

hollow beacon
#

ok mr knowall

subtle folio
subtle folio
#

you’re good

quiet ice
wraith bane
quiet ice
subtle folio
#

having a copyright string is fine

wraith bane
quiet ice
#

However noone really knows whether it applies in the real world

subtle folio
#

all spigot plug-ins must be under gplv3

quiet ice
#

In theory

#

Also, just saying it is ARR suffices too and is technically a pretty safe route

subtle folio
wraith bane
quiet ice
# subtle folio ??

There is the other school of thought that says that the GPLv3 cannot apply to plugins

#

Well it can (as in you can use the GPL if you want), but the issue we are talking about cannot apply

noble lantern
#

windows, the most useless software on the face of the planet smh

quiet ice
#

It should be just configure

noble lantern
#

same thing

quiet ice
#

Are you sure that you don't have a configure.bat file somewhere?

noble lantern
#

hmm its as file on here

quiet ice
#

Also did you install GNU Autoconf or however that application is called?

noble lantern
#

(im using the binaries)

#

im trying to get this to work on MC server but the java lib wont accept the raw class files so tbh i have no idea wtf im doing

quiet ice
#

What do you need ffmpeg for?

noble lantern
#

mp3 -> ogg

subtle folio
#

and i run this on mac

#

and i see \

noble lantern
#

is this not universal bruh

#

for fucks sakes

#

why is this so hard

#

i just want mp3 -> ogg fucks sakes

#

im rly about to make a rest server

#

this is a one liner in any other language this is some horse shit

subtle folio
#

lmaoooo

#

i’ll make one

noble lantern
#

pissin me off fr

subtle folio
#

spring boot will help you

noble lantern
#

dont get why mp3 -> whatever cant just be a library

subtle folio
#

is it not?

noble lantern
#

noooo gotta use shit meg

quiet ice
#

The issue is that mp3 is proprietary iirc

noble lantern
#

cant find one ANYWHERE

subtle folio
noble lantern
#

so is there no way to have a universal ffmpeg container then? i have to sit here and build it per os?

subtle folio
#

πŸ˜…

quiet ice
#

You could ask the libGDX people about this. They are bound to know an answer. Using ffmpeg is meh

noble lantern
subtle folio
#

lmao

noble lantern
#

just something about it screamed im not gonna work

subtle folio
#

you seem to have trust issues when it comes to java

grave kayak
#

I'm creating a large advancement tree, I need a way to save data such as how many potions a player has made so I can grant the advancement when they reach 200. there are a bunch of other advancements like that. at the moment I am creating a new custom yaml file for each one to save and track the data. is there a better way i can do this ? I'd rather not use SQL but i can if i have to

quiet ice
#

Are you sure that you must do that mp3 -> ogg conversion at runtime?

noble lantern
#

so has to be ogg

subtle folio
noble lantern
subtle folio
#

why not get rid of the middle man

noble lantern
#

because the downloader lib only does mp3

#

or only shows mp3/mp4 examples

subtle folio
#

oh shit

quiet ice
#

I guess you can't use FLAC then

cinder abyss
noble lantern
subtle folio
#

In this series, you'll learn how to create a full stack application with node.js that converts a YouTube video to MP3. In this video, we subscribe to the YouTube MP3 API from Rapid API. We also setup our endpoint and begin making requests to the API.

Watch the entire series here:
https://www.youtube.com/playlist?list=PLtMugc7g4Gaq1FdZMF3BUTQPx...

β–Ά Play video
cinder abyss
#

ffmpeg -i input.mp3 output.ogg

subtle folio
#

make a webserver ong

quiet ice
#

Not to speak how are you going to compile it for each OS?

noble lantern
noble lantern
#

alr lemme try that class

#

gotta refactor my ffmpeg shit i wrote smh

#

that downlaoder was slick asf too

#

i shall be back in 15 mins with results

cinder abyss
#

Hello, how can I not broadcast named mob death ?

[13:03:09 INFO]: Named entity EntitySalmon['Salmon 3 HP'/43, uuid='8aef6c78-1304-4bbe-a33f-f65307dfb967', l='ServerLevel[world]', x=247.63, y=61.91, z=-3.63, cpos=[15, -1], tl=196713, v=true] died: Salmon 3 HP was shot by PauLem79YT```
quiet ice
noble lantern
quiet ice
#

I guess you could do PCM -> wav instead of PCM -> FLAC which should be easier to do yourself without a library

noble lantern
#

sounds like a lot of converting

quiet ice
#

PCM is basically the raw audio data. Wav is only a small wrapper around PCM from what I know

noble lantern
#

but ide need ogg

#

mp3 -> ogg

#

online this is simple and other language just have this as a built in thing normally

quiet ice
noble lantern
#

i think imma just suck it up and get ffmpeg to run on all 3 platforms

#

second thought fuck apple users

#

why tf they running a mc server on apple anyways

#

weird ah mfs

subtle folio
#

well

#

whatt abotu linux

#

unix

#

mac is unix

tender shard
subtle folio
#

shit u got alex in here

noble lantern
subtle folio
#

what

#

MacOS is built off of unix πŸ’€

noble lantern
tender shard
#

macOS is the only actual unix you'll see people running minecraft on

subtle folio
#

what

noble lantern
subtle folio
#

80% of all mc servers are on linux

tender shard
noble lantern
#

linux binaries
windows binaries
macos binaries

subtle folio
#

wait

#

shit

#

but like

#

swap the i and u

#

unix

#

linux

noble lantern
#

and i cba to push macos binaries to my repo

subtle folio
#

same diff tbh

quiet ice
#

Linux is a unix-like OS

tender shard
#

linux is "a bit like unix" but not actually

subtle folio
#

they both use the same file structure

noble lantern
#

its a kernal thing

quiet ice
#

True Unix would be BSD and Solaris

subtle folio
#

okbro

tender shard
noble lantern
#

round 3, 3rd times a charm

quiet ice
#

MacOS diverged ages ago

tender shard
quiet ice
#

Huh

#

I guess it is a similar story like DOS and Windos

tender shard
#

idk, all I know is that macOS is actual unix and it's posix compliant

quiet ice
#

yt-dlp supports the --audio-format=opus -x option btw, but I am not sure if yt-dlp has ffmpeg and ffprobe bundled or if you need to download them seperately (I already have both of those installed on my OS so I cannot check without breaking a lot of stuff)

noble lantern
#

HOLY

#

got ffmpeg working :DD

#

now to fix up my shitty async, dont question that error

grave kayak
#

I'm creating a large advancement tree, I need a way to save data such as how many potions a player has made so I can grant the advancement when they reach 200. there are a bunch of other advancements like that. at the moment I am creating a new custom yaml file for each one to save and track the data. is there a better way i can do this ? I'd rather not use SQL but i can if i have to

eternal oxide
#

?psc as it's player specific data

#

?pdc

quaint mantle
#

If I placed down a wheat block named like β€œHay Bale” instead of whatever it’s usually named how do I know which hay blocks are named hay bale and which are normal

tender shard
#

?blockpdc

undone axleBOT
tender shard
#

that sucks

#

then you have to keep track of it using mysql, yaml, json, or whatever

quaint mantle
#

So like the coordinates of it

#

?

#

And obv the name of it

tender shard
#

yeah I'd use some data object that serializes into mysql or json or whatever like this

world-uuid: String/UUID
x, y, z: int
name: String

#

alternatively you could use the world's name but I guess UUIDs are better

#

in case the world gets renamed, or recreated with the same name

quaint mantle
#

Cool, never heard of world UUIDs lol

tender shard
#

maybe they were added post 1.13

#

nah, even 1.8 has World#getUID()

#

so yeah I'd use UUIDs for the world

#

that avoids issues with e.g. farming worlds that get reset once per month

worldly ingot
#

World UUIDs have been around since very OG Bukkit

tardy delta
worldly ingot
#

I hate that

tardy delta
#

i never knew apache commons was that interesting

echo basalt
#

I was looking at nms block states last night

#

and I found this

tardy delta
#

ah i just wanted to ask if it was worse than this

worldly ingot
#

fwiw that's likely a decompile issue

cinder abyss
tardy delta
#

apache commons fast math

#

whats wrong with Math.abs bruh

opal juniper
#

faster

worldly ingot
#

Looks like potentially they're trying to avoid division as much as possible

tardy delta
#

they fooling us

opal juniper
#

i think that delegates to the OS sqrt which delegates to some modern CPU stuff has sqrt handling

worldly ingot
#

And doesn't Math#sqrt() just call to java.util.FastMath#sqrt()?

tardy delta
#

StrictMath.pow yes

#

and if youre lucky it uses a jvm intrinsic

tender shard
opal juniper
#

who reads java java docs pfft

#

they are always too long

tardy delta
#

Note: this implementation currently delegates to Math.sqrt(double) hmyes

worldly ingot
#

I'm very grateful for Javadocs after dealing with C++'s poor excuse for documentation

#

cppreference is decent but it pales in comparison to Java's stdlib Javadocs

tardy delta
#

c++ documentation ha

ocean hollow
#

how can i get all information from mysql table?

worldly ingot
#

Gotta be a little more specific than that

opal juniper
#

Python docstrings are like the same thing as javadocs

worldly ingot
#

You can SELECT * FROM table; if you'd like which will get you all entries

tardy delta
#

are we talking about information scheme?

tender shard
opal juniper
#

ugh image emojis

ocean hollow
echo basalt
#

You loop through the entries

tardy delta
opal juniper
#

i just need faster internet, there was a noticable delay between url and embed

tardy delta
#

ah shit ive been caught

worldly ingot
#

Though it has some questionable decisions...

#

JDBCTutorialUtilities.printSQLException(e); ???

#

Just fucking e.printStackTrace(). For a tutorial? Really?

opal juniper
#

e.printStackTrace();

#

yeah lol

opal juniper
#

ur executing 2 times

worldly ingot
#

Sure but you have a dead ps.executeQuery() there

#

Other than that (and the fact that your dataManager doesn't exist), LGTM

tardy delta
#

and use a try with resources

opal juniper
#

are the collumns 0 indexed?

#

i cant remember

ocean hollow
worldly ingot
tardy delta
#

have fun changing column names :)

worldly ingot
#

If you have to change column names, you failed to design your schema

tardy delta
#

whatever...

ocean hollow
#

maybe i need to use while? to get all data

opal juniper
#

yes

worldly ingot
#

Didn't even notice you were using if lol. Yes, while

jolly forum
#

Hello in my code i have a error

hazy parrot
#

show code and error

jolly forum
#

Okay

#

Wait

smoky anchor
#

missing ()

cinder abyss
#

Hello, how can I display a customName with a heart ?
I tried this java entity.setCustomName("\\u2754");
But I get \u2754

smoky anchor
#

try just \u2754 ?

cinder abyss
#

well...

smoky anchor
#

Then use the correct unicode for the heart

cinder abyss
tardy delta
#

\❀️ just paste this in your code id say

worldly ingot
cinder abyss
#

I thought this was the correct

#

perfect

high pewter
#

I have this codejava @EventHandler public void onInventoryMoveItem(@NotNull InventoryMoveItemEvent event) { if (event.getDestination().getViewers().stream().anyMatch(this::isInOngoingGame)) { game.addLoreTo(event.getItem()); } else { game.removeLoreFrom(event.getItem()); } event.calledGetItem = false; }Which is supposed to show/hide lore from an item moved between two inventories depending on if a player is viewing the destination inventory. It works, but for some reason whatever it does to the item not only happens to the individual item moved to the destination, but the entire stack it originated from. For example, if I put a stack of stone into a hopper placed above a chest, one stone will move from the hopper to the chest at a time and event.getItem() returns an ItemStack containing one stone which is what I'd expect. However, when I add/remove the lore from that "one stone", it not only happens to the one stone moved but also to the 63 stone remaining in the hopper. My best guess as to why this happens is that the ItemMeta for that one stone is still the same as the ItemMeta for the stack it originated from and the lore is set on the ItemMeta not the ItemStack, but I'm not sure how I could fix this. Any ideas?

tardy delta
#

πŸ™

hazy parrot
#

what is event.calledGetItem

high pewter
#

If you modify an item moved via InventoryMoveItemEvent, it doesn't remove the item from the source inventory by setting event.calledGetItem or event.calledSetItem to true for some reason, so in order to avoid cancelling the event I have to set it back to false

tardy delta
#

cant even find that calledGetItem lol

thorn crypt
#

Hello, does anyone know why I can't see debug markers through blocks anymore ? (1.20)

high pewter
#

Well it's there lol. I guess just not documented

wraith fjord
#

Who knows how to transfer item meta data via BungeeCord Plugin Messaging Channel? I know how to use writeUTF, but ItemMeta is not a String.

tardy delta
#

well you sent it as a bytearray?

wraith fjord
tardy delta
#

sendPluginMessage takes a byte array to send

wraith fjord
#

i could convert ItemMeta into string and send it via writeUTF but i cant convert String to ItemMeta to use it later

tardy delta
#

cant you use some object input stream thing or smth to deserialize those bytes back to an itemmeta obj

#

sounds goofy to send itemmeta but whatever

#

BukkitObjectInputStream#readObject

wraith fjord
tardy delta
#

create one with a ByteArrayInputStream as param

wraith fjord
# tardy delta create one with a ByteArrayInputStream as param

so i should do like this?

    @EventHandler
    public void onEntityPortalEnter(EntityPortalEnterEvent event) {
        Entity entity = event.getEntity();
        if (!(entity instanceof Item || entity instanceof Mob)) return;
        try {
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            BukkitObjectOutputStream out = new BukkitObjectOutputStream(outputStream);
            out.writeUTF("Forward"); // forward message
            out.writeUTF(Objects.requireNonNull(getConfig().getString("teleportTo")));
            out.writeUTF("EntityPortalEnter"); // sub channel
            out.writeUTF(entity.getType().toString()); // message
            if (entity instanceof Item) {
                Item item = (Item) entity;
                ItemStack itemStack = item.getItemStack();
                String itemName = itemStack.getType().name();
                int itemAmount = itemStack.getAmount();
                ItemMeta itemMeta = itemStack.getItemMeta();
                out.writeUTF(itemName);
                out.writeInt(itemAmount);
                out.writeObject(itemMeta);
            }
            
            getServer().sendPluginMessage(this, "BungeeCord", outputStream.toByteArray());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
high pewter
# hazy parrot what is `event.calledGetItem`

Ok I removed that line and it doesn't seem to actually do anything anyways lol. Maybe modifying the lore doesn't count as modifying the item itself? Still have the same issue as before though

tardy delta
#

i thought you were reading it?

wraith fjord
tardy delta
#

ah for writing id say BukkitObjectOutputStream#writeObject

wraith fjord
#

here?

#

BukkitObjectOutputStream#writeObject

quaint mantle
#

]d

tardy delta
#

create one and write your meta to it

#

then send the toByteArray()

#

ive never used plugin messages lol

fervent prawn
#

Can I get Respawn Reason from PlayerRespawnEvent in modern version of spigot?

near crypt
#

hi, can someone explain to me whats new in 1.20 coding wise?

eternal oxide
near crypt
#

no, i mean for example that you can strech blocks now and so on

gilded hinge
#

I need the nms for 1.20.1. I use maven

wraith fjord
tardy delta
#

could be useful if you said what error

wraith fjord
# tardy delta could be useful if you said what error

part of error:

[16:38:24 ERROR]: [server connection] ADAMADA8 -> survival: exception encountered in com.velocitypowered.proxy.connection.backend.BackendPlaySessionHandler@10d42d9b
java.lang.IndexOutOfBoundsException: readerIndex(2) + length(44269) exceeds writerIndex(53): PooledSlicedByteBuf(ridx: 2, widx: 53, cap: 53/53, unwrapped: PooledUnsafeDirectByteBuf(ridx: 72, widx: 72, cap: 2048))
        at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1442) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1428) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:895) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.protocol.util.ByteBufDataInput.readFully(ByteBufDataInput.java:54) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at java.io.DataInputStream.readUTF(DataInputStream.java:614) ~[?:?]
        at com.velocitypowered.proxy.protocol.util.ByteBufDataInput.readUTF(ByteBufDataInput.java:121) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.connection.backend.BungeeCordMessageResponder.process(BungeeCordMessageResponder.java:327) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.connection.backend.BackendPlaySessionHandler.handle(BackendPlaySessionHandler.java:197) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
        at com.velocitypowered.proxy.protocol.packet.PluginMessage.handle(PluginMessage.java:104) ~[velocity.jar:3.2.0-SNAPSHOT (git-bda1430d-b259)]
tardy delta
#

what the

wraith fjord
#

when im replacing ByteArrayDataOutput out = ByteStreams.newDataOutput(); to ```
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream out = new BukkitObjectOutputStream(outputStream);

tardy delta
#

?paste the full code

undone axleBOT
wraith fjord
tardy delta
#

for that stuff ye

tardy delta
#

uhh

wraith fjord
wraith fjord
tardy delta
#

no

#

might wanna ask someone else

wraith fjord
#

😦

tardy delta
#

hmm that posOffset kinda pisses me off, its already better than before tho

#

its only 0 for the first invocation

river oracle
#

Do while loops piss me off

#

They are so dumb

tardy delta
#

damn i refactored 6 lines into 6 lines

river oracle
#

Good job

cinder abyss
#

Hello, how can I stop broadcasting named mobs death ?
Named entity EntityCow['Cow 1.0 ❀'/12653, uuid='1ece2207-7a0f-41ea-935b-e9734517fce4', l='ServerLevel[world]', x=360.52, y=72.68, z=-312.32, cpos=[22, -20], tl=265, v=true] died: Cow 1.0 ❀ was slain by PauLem79YT

young knoll
#

iirc it's in spigot.yml

ivory sleet
cinder abyss
tardy delta
#

you better

#

hi conclure πŸ‘‹

cinder abyss
#

Hello, is there an event before an entity die ?

#

(do EntityDeathEvent execute after the entity is already dead ?)

tardy delta
#

before id say, otherwise you wouldnt be able to cancel it

#

ah you cant even cancel it lmao

native edge
#

What's the solution ?

cinder abyss
#

Hello, what is volume and pitch for playSound ?

native ruin
#

loudness and frequency

tardy delta
#

HIGHEST_PRIORITY = Stream.of(values()).max(Comparator.comparing(Operator::getPriority)).orElseThrow().getPriority(); myes i love streams

native edge
meager lynx
#

guys how do we connect to supabase postgresql in spigot

#

i have seen people use normal jdbc connections

#

but im tryna use a supabase one

#

it keeps erroring saying that theres no suitable drivers (i installed postgre one for it)

opal juniper
#

did you shade it?

#

essentially firebase

meager lynx
meager lynx
#

i directly used the host,password etc

#

similar to the locahost connection

eternal oxide
#

shade = package teh driver in your jar

meager lynx
eternal oxide
#

thats not shaded

meager lynx
#

oh

#

so what do i need to do

cinder abyss
#

hello, how can I make a block have the particles of when a block has water above it?

opal juniper
#

the drips?

cinder abyss
opal juniper
cinder abyss
#

okay thanls

remote swallow
meager lynx
#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
#

so i gotta add this?

#

im kinda lost

#

the postgresql docs didnt mention needing to shade it

young knoll
#

It’s ticks

#

Hence the name

native edge
remote swallow
meager lynx
#

guys i shaded it

#

still doesnt seem to work

#

so what do i do

#

welp ima just go and use mongodb

native edge
full glade
#

How to make a custom mob not despawn?
Spigot 1.20

drowsy apex
cinder abyss
#

Hello, how can I get the time being in a clear weather ? (bump)

native edge
drowsy apex
#

Register your custom entity with Bukkit using EntityTypes.register(EntityTypes.a("custom_mob"), YourCustomMobEntity::new) Make sure to replace "custom_mob" with the desired name for your custom mob entity

chrome beacon
#

I wouldn't recommend that

drowsy apex
#

What would you recommended πŸ™‚

cinder abyss
chrome beacon
#

First approach you said or what I mentioned

cinder abyss
#

the time being in the actual weather

golden spear
#

Hi, does anyone know how to get rid of these yellow ping numbers in a tablist scoreboard?

drowsy apex
cinder abyss
tardy delta
#

damn intellij, would eclipse also be able to generate that?

drowsy apex
#

Never

ivory sleet
#

looks like a standard clone impl

tardy delta
#

sorry but i have to laugh at eclipse every time

ivory sleet
#

:,)

tardy delta
#

Object#clone does a shallow copy right?

#

"contents of the fields are not cloned" ig so

full glade
#

Mobs won't spawn in some places. I think this is due to the fact that I am trying to spawn them in an unloaded chunk, but loading the chunk before spawning them does not help. setPersistent() is enabled. How to fix it?

full glade
chrome ferry
#

why is CreatureSpawner#getSpawnedType now returning null on block place on 1.20.1?

Yes its a spawner, yes it has a mob assigned to it. Yes it worked on a previous version

river oracle
#

spawners no longer have a default type of Pig

full glade
tardy delta
#

i hate it when java hides all the useful internal stuff

river oracle
#

reflection time :P

tardy delta
#

too slow

river oracle
#

cache the fields

#

/ methods

#

it'll speed it up

tardy delta
#

ye its just awful what java does sometimes

river oracle
#

or you could just recreate the method

tardy delta
#

meanwhile other langs where enums are just numbers

full glade
full glade
ivory sleet
#

what exactly r u trying to do then

#

if I so may ask?

full glade
#

I need the mob not to despawn.

ivory sleet
#

is it a custom entity or not?

#

u can set persistent

#

but u prob wanna set remove when far away to false

fluid river
full glade
hard socket
#

how to stop ender dragon from breaking blocks

glacial narwhal
#
public class KillListener implements Listener {
    public void onKill(EntityDeathEvent e) {
e.setMessage() 
}
``` Like so ?
#

playerdeathevent?

#

oh yes thx

remote swallow
glacial narwhal
#

oh yes

#

how can i get the death player ?

remote swallow
#

e.getPlayer probably

tender shard
tender shard
tardy delta
#

ye only once and then caches it, but whatever

tender shard
tardy delta
#

mye

orchid trout
#

where is my pom.xml

tardy delta
#

java enums are just weirdly implemented

#

values() making a copy, like meh

#

but atleast they are not just numbers like in other langs

#

rust enums <3

worldly ingot
#

I'd almost rather them be numerical

tardy delta
#

but that sucks when you gotta map fields to them

tender shard
tardy delta
#

could do some kind of index lookup, but the moment you start assigning indices that are not packed together :(

orchid trout
glacial narwhal
#

i started and idk why this time i got this error i tryed to restart the server but it didn't work please help "io.netty.AbstractChannel$AnnnotedConnectException: Connection refused: no further information"

golden spear
#

Does anyone know how to remove the yellow ping number in a tablist?

wise mesa
#

I’m pretty sure

brazen violet
#

how can i post java code in discord i dont know how xd

subtle folio
#

?paste

undone axleBOT
subtle folio
#

or ```java

quiet ice
subtle folio
#

?format

brazen violet
#

so my problem is im trying to code a doubleJump all is working the cooldown too but the cooldown messages dont appear and i dont know any further so please help...

https://paste.md-5.net/ejihatiwix.cs

glacial narwhal
#

i started and idk why this time i got this error i tryed to restart the server but it didn't work please help "io.netty.AbstractChannel$AnnnotedConnectException: Connection refused: no further information"

quiet ice
brazen violet
#

yes

#

in my join listener he always spawns in adventure

quiet ice
#

Could you send the body of Cooldown.checkCooldown?

brazen violet
#

im sending the hole cooldown.java

quiet ice
#

the method name is really ambiguous fyi and may be an issue later on if you want to debug it

brazen violet
#

yes i know that but thats not the problem now

#

so do you have an idea why i dont get these messages

quiet ice
brazen violet
#

yes and thats my probem :/

#

no error no nothing it should work fine...

#

oh no wait there is an error in my console

sacred mountain
#

guys for the ENTITY_ATTACK damage cause, will it ever be the cause when the EntityDamageEvent is not an instance of EntityDamageByEntityEvent?

#

is not*

brazen violet
quiet ice
#

Ideally yes

quiet ice
brazen violet
#

but its not an error for double jump so its irrelavent

quiet ice
# brazen violet yes and thats my probem :/

what I'm saying is that
A) I cannot comprehend what you are attempting to do
and/or
B) I do not have sufficent knowledge about called methods or other methods that do other things that just happen to affect the global state of the application and thus your piece of code

brazen violet
#

mhh okay im trying to fix it on my own

hazy parrot
glacial narwhal
#

Oh yes....

#

sorry

young knoll
#

Dang

#

Spigot doesn’t have any way to remove some of the vanilla tree generation does it

remote swallow
#

nerd

echo basalt
#

probably something to do with block populate

dense arrow
#

Hi, I think I found a bug that maybe should be fixed. I cannot find the place to report it to the devs, could you guys tell me?
The bug:
EntityPortalEvent doesn't trigger if a NPC travels through an end gateway, while it works as i think it should be with nether and end portals.

echo basalt
#

End gateways huh

remote swallow
#

?jira

undone axleBOT
young knoll
#

Do I need to make an api for accessing vanilla populators now

echo basalt
#

paper has a EntityTeleportEndGatewayEvent

remote swallow
#

yeah

echo basalt
#

otherwise for players it fires PlayerTeleportEvent

#

otherwise no event fires, yeah

next zinc
#

Anyone know if there is a way to detect if a FallingBlock converts back into a regular block?

#

So far I've tried making a runnable that detects if a fallingblock hits the ground, but that didn't work

young knoll
#

EntityChangeBlockEvent

orchid trout
#

how do i check if playerloginevent gives me fake player

#

like citizens npc player

cinder abyss
#

Hello, how can I add nms net.minecraft.server.v1_19_R1 to my gradle plugin ?

eternal oxide
#

I did tell you when you started to use maven not gradle

#

you have to use a 3rd party plugin for nms

cinder abyss
eternal oxide
#

using maven you just...

#

?nms

cinder abyss
#

okay thanks

brazen violet
#

how can i ask if a player is jumping? i didnt find one in the internet that worked

cinder abyss
young knoll
#

Sigh

#

Biome features are private and immutable

brazen violet
remote swallow
#

you probably want to check if the difference is like over .5, could also just use the statistic event

cinder abyss
brazen violet
#

ah yes thanks

#

my english is really bad so sorry

young knoll
#

Not very reliable

#

There are many ways to go up other than jumping

brazen violet
#

yes i know i done !isSwimming and !isFlying after that with an &&

#

if you can undertsand my english i hope xd

eternal oxide
#

listen to the statistic event to increare the jump stat

#

about as good as you can get

subtle folio
#

Database question.

If i’m storing like, ability and progression paths for my game modes, Woild MongoDB be the best approach?

vocal cloud
#

Is it a private or public plugin?

subtle folio
#

private

vocal cloud
#

Then whatever you feel most comfortable with

subtle folio
#

Though I’d probably build it in public,

#

I’ve never used mongo before. Was hoping to use this project as a maybe reason to learn, but not sure if this is the right justification

vocal cloud
#

Most people use SQL so people might not want to have 2 DBs on their server

subtle folio
#

The project itself is a server core. πŸ˜…

#

If i’ve got multiple unstructured sets of data, I don’t know if mysql could keep up

vocal cloud
#

If you're slowing down SQL then that's a you problem not a SQL problem

cinder abyss
#

Hello, is EntitySpawnEvent applicable when a player join the world ?

#

yes

#

okay thanks

#

not clear

#

Player = Entity

young knoll
#

You are doing string - long

queen niche
#

I want to make a sorta claim plugin for my server. Is worlguard a good API for claimed lands?

young knoll
#

You can't do that

#

Don't try and subtract a long from a string?

queen niche
#

why does that response sound so AI Generated?

young knoll
#

Idk how you expect that to work

subtle folio
queen niche
#

lmao why respond with an ai generated response?

queen niche
#

yea but it does not really answer my question

#

its more explains what worldguard is

#

stop responding using AI generated shit

#

thats because you are trying to do math using a string. Convert it to whatever datatype you need.

north hornet
#

what's the difference between setComments() and setInlineComments()?

#

in YamlConfiguration

subtle folio
#

chatgpt isn’t always accurate when it comes to coding with spigot, suggested me methods that didn’t even exist πŸ˜…

#

i asked it for a method to send the player to mars and it gave me #sendToPlanet(PlanetType.MARS)

#

then tried to link me the java doc to that

#

okay @somber sinew stop

chrome beacon
eternal oxide
#

Stop with the AI responses. It's an idiot and annoying. Only respond if you know the answer.

subtle folio
#

right, doesn’t really matter. People came here to talk to humans, if they wanted to ask chatgpt they could have.

north hornet
subtle folio
#

people living under a rock??

#

highly doubt anyone here doesn’t know what that is

#

especially in a programming discord

queen niche
#

This is not really spigot related. Just use a math formula to do that

#

figure out how many ms there are in a second

#

s = ms / 1000

#

m = s / 60

#

m = (ms / 1000) / 60

#

you have to replace the s with the value of your seconds

#

and the ms with the value of your miliseconde

#

and m = minutes

tender shard
tender shard
#

you could do that, yes

warm mica
#

Literally anyone who is on social media knows chatgpt

#

or reads news

#

No AI is accurate

tender shard
#

isn't that quite self-explanatory?

// Create cooldown, save it as field or sth
Cooldown cooldown = new Cooldown();

// set cooldown
cooldown.setCooldown(somePlayer, 20, TimeUnit.SECONDS); // Player has cooldown for 20 seconds now

// check cooldown
if(cooldown.hasCooldown(somePlayer)) {
  // Still in cooldown
}
``` @sage hare
round finch
#

chatgpt is differently not known to be perfect at math

tender shard
#

uuuugh where can I delete my fork on spigot's stash, it used to be in repository settings but I can't find it anymore lol

#

?learnjava

undone axleBOT
round finch
#

basic java

#

bullin

#

πŸ€“

subtle folio
#

@somber sinew you should ask ur buddy chatgpt

tender shard
#

why are you calling cooldown.get() on setting it?

#

And why are you calling TimeUnit.DAYS.SECONDS?!

cooldown.setCooldown(player, 20, TimeUnit.SECONDS);
#
if(cooldown.hasCooldown(player)) {
  ...
}
remote swallow
tender shard
#

?learnjava

undone axleBOT
remote swallow
#

did you create the class as it shows, and then use methods on Duration??

#

is your variable called timeleft?

#

so modify it to your usage

#

use it where you need cooldowns

#

just modify the ifs if it is a command or not

hollow beacon
#

also a little tip, try to use if-not-return, makes the code a little cleaner IMO. so:

public class CooldownCommand implements CommandExecutor {

    private final CooldownManager cooldownManager = new CooldownManager();

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        // Player only command
        if (!(sender instanceof Player)) {
            sender.sendMessage("Player-only command");
            return true;
        }
        Player player = (Player) sender;
        UUID playerId = player.getUniqueId();
        Duration timeLeft = cooldownManager.getRemainingCooldown(playerId);
        if (timeLeft.isZero() || timeLeft.isNegative()) {
            player.sendMessage(ChatColor.GREEN + "Feature used!");
            cooldownManager.setCooldown(playerId, Duration.ofSeconds(CooldownManager.DEFAULT_COOLDOWN));
        } else {
            player.sendMessage(ChatColor.RED + timeLeft.toSeconds() + " seconds before you can use this feature again.");
        }
        return true;
    }
}
#

depends on your use case too ngl

remote swallow
hollow beacon
#

oops

next zinc
#
AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attackSpeed", swordSpeed, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND);
        meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, modifier);

Anyone know why this doesn't seem to be changing the speed?

#

I'm not sure if there is an easy way to check if its working besides just starring at the cooldown sword thing which from what I can see doesn't appear to change even when I change the variable for swordSpeed

young knoll
#

Does it show on the item

next zinc
#

yeah

young knoll
#

Then it's working

next zinc
#

Then how can I set the base of the attribute to be that number as it's adding to it which I don't want

young knoll
#

You are adding to the players default

#

Which is 4

next zinc
#

So a player by default has a attackSpeed of 4?

young knoll
#

yes

#

Which is 4 attacks per second

next zinc
#

So the attack speed on something like a netherite axe is x + 4?

young knoll
#

A netherite axe has a default attack speed of 1

#

So it has a -3 attack speed modifier

next zinc
#

Ah

#

Gotcha

gloomy thunder
#

Does anyone know how rankup works?

flint coyote
#

what's rankup

gloomy thunder
#

yes

flint coyote
#

Helpful

gloomy thunder
tender shard
#

and account age

echo basalt
#

hacks

tender shard
#

and duration of nitro subscription

subtle folio
#

duration of deez nuts 🀣

#

gotteem

noble lantern
#

hey guys HomosexualDemon here

gloomy thunder
#

I am also nitro and it won't let me

remote swallow
#

it depends on when your account was created too

#

if you had nitro when the update started you will join nitro 2022, if you didnt your in the normal 2022 lot

#

its on like the 2017 no nitro atm or smething

gloomy thunder
#

In my other account I have been with the nitro since 2015 and it does not let me

remote swallow
#

i got mine with the 2019 nitro group Β―_(ツ)_/Β― contact support or something

gloomy thunder
#

And how I do it

remote swallow
#

you'll have a popup telling you you can do it

gloomy thunder
#

I look at it with my mobile and it doesn't come out

remote swallow
#

no idea if the name update shows on mobile

flint coyote
#

Yes it does

#

I changed mine on mobile - without nitro since I registered in 2017

#

your discord app could be outdated

remote swallow
#

did you have nitro like 2 months ago

flint coyote
#

But since discord is basically just chromium I think you don't have to update for features like that anyway

flint coyote
#

and only had it once before, like a year ago

remote swallow
#

huh

flint coyote
#

Well I was able to change because I registered in 2017, not because I have nitro

remote swallow
#

yeah, i thought they handnt gotten to 2017 no nitro yet

flint coyote
#

That's what I wanted to explain with it

young knoll
#

They have

#

They are quite far

remote swallow
#

huh

#
 private void createTables() {
        try (Connection connection = connectionPool.getConnection()) {
            @Cleanup PreparedStatement createBloodlineStmt = connection.prepareStatement("CREATE TABLE IF NOT EXISTS bloodlines (" +
                    "uuid VARCHAR(36) PRIMARY KEY," +
                    "exp INTEGER" +
                    ");");
            @Cleanup PreparedStatement createTraitsStmt = connection.prepareStatement("CREATE TABLE IF NOT EXISTS bloodlineTraits (" +
                    "bloodlineUuid VARCHAR(36) PRIMARY KEY," +
                    "name VARCHAR(20)," +
                    "level INTEGER" +
                    ");");
            @Cleanup PreparedStatement createPlayerDataStmt = connection.prepareStatement("CREATE TABLE IF NOT EXISTS playerData (" +
                    "playerUuid VARCHAR(36) PRIMARY KEY," +
                    "bloodlineUuid VARCHAR(36)" +
                    ");");
            createBloodlineStmt.executeUpdate();
            createTraitsStmt.executeUpdate();
            createPlayerDataStmt.executeUpdate();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }
``` anyone know a better way i could do this, bloodline can have mutiple players, a player can only have 1 bloodline, a bloodline has no set limit for possible traits
hard socket
#

how can I prevent the ender dragon from going through blocks

gloomy thunder
hard socket
quaint mantle
fluid river
#

so much learnjava in 1 hour

#

what's goin on

flint coyote
#

We need @fluid river for free java lessons

fluid river
#

😭

remote swallow
fluid river
#

well you can get a dragons boundingbox, check all full blocks it contain, and if there is at least one solid block, teleport dragon somewhere

remote swallow
#

nuker is the jree fava lessons

fluid river
#

yes

quaint mantle
flint coyote
#

oh

#

guess I mixed them up

fluid river
flint coyote
#

fixed it

fluid river
#

fourteen is a self-made equation calculator guy

flint coyote
#

In my defense: I didn't get much sleep

fluid river
#

and i'm jreefava guy

wraith bane
#

How should I approach making a 1.20 plugin that makes certain entities look like they are glowing only for specific players
(So using packets to "fake" the glowing effect, without actually using the glowing effect)

flint coyote
fluid river
#

partially

fluid river
#

he haven't added trigonometry staff iirc

wraith bane
fluid river
#

?nms

tardy delta
#

trigonometry stuff as in?

fluid river
tardy delta
#

have all those functions

fluid river
#

i kinda lost myself

fluid river
tardy delta
#

check the gh if you wanna figure out

fluid river
#

no thanks

wraith bane
flint coyote
fluid river
#

we had like 2-days conversation about how to add stuff to your calculator

tardy delta
#

ill make it have variables and multiline expressions

fluid river
#

i remember

flint coyote
#

I need that, too

fluid river
tardy delta
#

it has functions for those, im thinking about actually making them operators

flint coyote
#

e.g.
CURRENT_DAY == MONDAY

tardy delta
#

ah

#

but no variables yet

fluid river
fluid river