#help-development

1 messages Ā· Page 61 of 1

chrome beacon
#

Don't shade LuckPerms

#

Bad idea

echo basalt
#

shade spigot instead 🤔

river oracle
#

if your going to shade LP just shade spigot tbh might as well throw it all int here

echo basalt
#

shade minecraft's client while at it

#

say it's an integrated testing env

chrome beacon
#

Shade JRE

echo basalt
#

yoo

#

true

#

shade jdk as well

shadow zinc
#

I'll shade your mum

echo basalt
#

0 bytes

shadow zinc
#

oh shit

slate mortar
sturdy frigate
#

How can I make a worldedit BaseBlock from a Bukkit Block?
I've tried:

        editSession.setBlocks(selection, new BaseBlock(trailBlock.getState()));
``` but that constructor is protected
chrome beacon
#

BukkitAdapter

sturdy frigate
#

Oh okay let me see

shadow zinc
#

How can I retrieve the permission node of a command from another plugin?

#

Or at least test if a player has permission to that command

sturdy frigate
# chrome beacon BukkitAdapter

thanks, this seems to work java editSession.setBlocks(selection, BukkitAdapter.asBlockState(new ItemStack(trailMaterial, 1)));

wary harness
#

I am registering aliases for main command so user can change it to what ever they want in config.yml
aliases are registered you can type them in they work
but
you can't tab complete them like when you type / PressTab
So what would be solution is there some other map which contains are command names when u press tab
On normal restart of server I use same method to register aliases from my config file and then they you can tab them
so am I missing some thing
on my plugin reload
code

eternal oxide
#

if you change teh command map be sure to update all online players

#

somethign like Player#updateCommands()

fiery prairie
#
            ArrayList<String> lore_sila = new ArrayList<>();
            lore_sila.add(ChatColor.translateAlternateColorCodes('&', "&7Daje efekt sily"));
            lore_sila.add(ChatColor.translateAlternateColorCodes('&', "&2Cena w Blokach Emeraldow: &a") + ChatColor.translateAlternateColorCodes('&', instance.getConfig().getInt("cenasila")));```

so basically since the arraylist is made of strings i cannot use `config.getInt()` even though the path in the config has to be an int. I have tried putting  `instance.getConfig....` inside of toString() or adding toString at the end of it, but it doesnt work, how would i transfer it into a string?
lost matrix
# fiery prairie ```java ArrayList<String> lore_sila = new ArrayList<>(); ...
  1. What does the arraylist have to do with you not being able to call getInt() on a config?
  2. The path in a config does not have to be an int. That would be ridiculous
  3. "adding toString at the end of it" at the end of what?
  4. "how would i transfer it into a string" transfer what into a String.

You are speaking gibberish

shadow zinc
#

dfsgdfg?

fiery prairie
#
  1. the arraylist is ArrayList<String> so i cannot put an int inside
  2. well if i want to make a price for something and put it inside of an item lore how would i do that without an int?
  3. almost every ) at the end of the third line except for the last one cause that would make no sense
  4. instance.getconfig.getint
lost matrix
#

You mean this line?

ChatColor.translateAlternateColorCodes('&', instance.getConfig().getInt("cenasila")));

Just use one of

ChatColor.translateAlternateColorCodes('&', "" + instance.getConfig().getInt("cenasila")));

or

ChatColor.translateAlternateColorCodes('&', String.valueOf(instance.getConfig().getInt("cenasila"))));

But then translating the color makes no sense because an int never has any color.
So you can simply do

"" + instance.getConfig().getInt("cenasila");
#

Or

String.valueOf(instance.getConfig().getInt("cenasila"));
fiery prairie
#

Thanks!

#

makes sense

quiet hearth
#

How can I play an evoker's spellcasting animation?

terse raven
#

when i set the inventory if a player and then listen for the inventory click event, can i then just compare the two inventory objects, or is there some other way to compare them

oblique geyser
#

How Can I create different inventories per world?

terse raven
wary harness
lost matrix
lost matrix
# oblique geyser How Can I create different inventories per world?

You need to serialize inventories and store them mapped to a world.
So each player has a Map<UUID, ItemStack[]> which is a simple mapping of the worlds UUID and the
inventory contents. When a player joins, you load the map and if he changes a world you first save the current content
and then load the corresponding content for the target world.

drowsy helm
#

Anyone know exactly how Player#swingOffhand works?

Makes this entity swing their off hand. This method does nothing if this entity does not have an animation for swinging their off hand.```
Does this mean there is no punch animation for every item?
eternal oxide
#

A creeper has no hand animations (no hands)

#

oh Player

drowsy helm
#

im trying to make them "attack" with a piece of paper

eternal oxide
#

but its probably from LivingEntity

drowsy helm
#

but it doesnt seem to swing

#

yeah it is

eternal oxide
#

a Class thats not in Player

drowsy helm
#

doesnt seem to swing a sword either

sturdy frigate
#

I have an array of locations that completes to a polygonal outline, how can I flood fill with blocks inside the outline? Is there a world edit api for this or how can I do it manually?

lost matrix
#

Big areas will lag or even crash the server

#

For this you can do

#

?workdistro

gaunt pendant
#

How to use a String in minimessages hover? "rohlik" is a name of the string

young knoll
#

ā€œStringā€ + variableName + ā€œotherStringā€

#

Or use a StringBuilder

tardy delta
#

String.format

#

String#formatted

#

MessageFormat

#

šŸ‘Œ

young knoll
#

That too

tardy delta
#

oh i forgot String#replace

gaunt pendant
#

thanks

tardy delta
lost matrix
#

Map only has the forEach(BiConsumer) method

tardy delta
#

or do i need to define it as a hashmap?

lost matrix
#

or you do skills.entrySet(). Then you can use a for loop.

lost matrix
tardy delta
#

ah weird

young knoll
#

ON CONFLICT

#

That’s SQLite right

tardy delta
#

yes

#

trying to figure out upsert thing

lost matrix
#

Postgres has that too

lost matrix
tardy delta
#

this will work ig

young knoll
#

I usually do ON CONFLICT REPLACE

#

Not sure if there’s much of a difference

tardy delta
#

idk i did some research on stackoverflow but ye... stackoverflow....

#

replace does an delete and insert so ig on conflict is better than

onyx fjord
#

hhow do i check if player joined beofre

#

without saving uuids to file

tardy delta
#

Player#hasPlayedBefore

onyx fjord
#

W

#

spigot api W api

tardy delta
#

tbh i dont know impl

#

ah nvm

#

it will work

onyx fjord
#

i think it uses uuid cache

tardy delta
#

it checks player files iirc

#

checked the impl once

lost matrix
#

It uses the playerdata file

tardy delta
#

šŸ˜Ž

onyx fjord
#

bet

#

top 10 W apis

#
  1. spigot api
tardy delta
#

lol

onyx fjord
#
  1. bungeecord api
lost matrix
#
  1. Burgerking foot letuce
minor garnet
#

whyythe armor stand is dont spawning ignited or with items on hand?

young knoll
#

Gotta send the meta packet

#

PacketPlayOutEntityMetadata or something

minor crest
#

Im new to spigot development, and im following a tutorial I linked. https://www.youtube.com/watch?v=spggI5Dmfp0&t=321s
When I get to 1:48 in the video, it has you import the event. For him it worked immediately first try, but for me it's an error. Do i have to import it another way or something?

Love the video or need more help...or maybe both?
šŸ’¬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ā¤ļø

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

ā–¶ Play video
reef lagoon
#

how do I get all potion effects without hardocidng it

young knoll
young knoll
reef lagoon
#

ty

lost matrix
reef lagoon
#

types, not with amplifiers

reef lagoon
lost matrix
#

Then PotionEffectType.values()

boreal seal
#

make a constractur as well

#

between the classes

#

check dependecy injection guide

#

it wont work since main class doenst regocnize your listener..

#

i would either reccomend learn some java before because its the basics

#

if you will learn spigot api without knowing java you will run into many problems later

onyx fjord
#

6cry6

#

gud code 🄵 ?

tardy delta
#

lmao why another method

ivory sleet
#

isNew could be static

#

helper method in principle

lost matrix
#

isNew could also be non-existent

onyx fjord
#

haters gonna hate

ivory sleet
#

Also I am one of the proponents who advocate to never inline if, for statements etc

onyx fjord
ivory sleet
#

Somewhat faster

onyx fjord
#

k

ivory sleet
#

Altho you lose polymorphism

onyx fjord
#

when static when no

boreal seal
#

static

#

is for utils

onyx fjord
#

tf is polymorphism

boreal seal
#

and shit like that

#

and for methofs

#

methods

#

like voids ..

ivory sleet
boreal seal
#

it really depends

onyx fjord
#

is DI good for utils?

lost matrix
#

No. Utils should be stateless.

onyx fjord
#

bet

#

when does static abuse start

lost matrix
#

Right after the access modifier

ivory sleet
#

Static can be used for
(Singletons, tho scarcely)
(Multitons and monostate, even more scarcely)
(Utilities, always)
(Helper methods, mostly always)
(Factory methods, scenario dependent but not a bad choice often)
(Constants, almost always)

onyx fjord
#

thanks for good advice

#

does it matter if umm

#

i do Utils.isNew() or isNew()

ivory sleet
#

I like the former

onyx fjord
#

which one is former

ivory sleet
#

But I think thats a preference

lost matrix
#

Just remove that method. It literally adds no clarity to the code.

ivory sleet
#

Class.staticMethod();

onyx fjord
#

oh

ivory sleet
#

Choco likes just
staticMethod() iirc

#

So that is mere preference :>

onyx fjord
#

tbh i did it because i thought more code was needed

#

but its one liner

ivory sleet
#

I’d do sth like
boolean isNew = player.hasPlayedBefore(); in this case

#

Assuming I wanna be elaborate on the code

torn shuttle
#

hey guys what kind of object is in-game fire?

onyx fjord
#

and umm how do people make apis for ther plugins

torn shuttle
#

tile entity or smth?

onyx fjord
small current
#

if it works it works

onyx fjord
#

well

small current
#

use static whenever you feel it needs

onyx fjord
#

if you dont want a job then sure

lost matrix
onyx fjord
#

OH HEL NO

#

i feel attacked

small current
#

static abuse is a lie

ivory sleet
#

Well APIs are usually for the entire world to consume, thus we think about

  • having a small surface area where necessary functionality is exposed, what can we do with the api?
  • because we wanna make sure the consumers can rely on the api against retro incompatible changes we as the api providers might commit, then having a module of interfaces will help with separating concerns
onyx fjord
small current
#

i only done 1.8 plugins for a lobby server and a little bedwars

onyx fjord
#

on later java intellij gives more cool tips

dusk flicker
#

I get 1.8 for lobby servers

late sonnet
onyx fjord
lost matrix
onyx fjord
#

i never needed nms

young knoll
onyx fjord
#

i feel like if theres something that cant be done with spigot api, it should be pull requested or made as external api

torn shuttle
#

just a normal block?

small current
#

and its not a lobby core

dusk flicker
#

speaking of I need to make my main plugin different version compatable lol

small current
#

just some item thing

onyx fjord
#

since 1.16

torn shuttle
#

thanks

small current
#

and i just coded a small amount of the bedwars thing

onyx fjord
#

back in a day you could hold lava

small current
#

easier to bug fix if we coded it ourself

onyx fjord
#

antipopup teached me a lot

torn shuttle
#

this is really cool, I can't commit on intellij

#

I think it bugged out

onyx fjord
#

yeah happened to me

torn shuttle
#

keeps telling me another git process is running

onyx fjord
#

fr

tardy delta
#

why

torn shuttle
#

I like it, it's pretty rare that it messes up

tardy delta
#

just click commit and push

torn shuttle
#

commit is broken, I'm debugging it rn

#

there we go

#

had to delete .git/index.lock and restart intellij

onyx fjord
#

i see all C00l devs make their own libs

#

is it cool or nah

ivory sleet
#

Mye

#

Well it does help

#

Having to write everything out every time gets exasperating rather quickly

hardy swan
#

Yes it is almost essential tbh

crude charm
#

For mongo, how do I search for a field in every document in a collection?

#

Like:

Paul's document
Code: 1234

Joe's Document
Code:4321

and I want to search all codes and see if any match

onyx fjord
hardy swan
#

Only one im proud of, largeraids

#

But i dont think thats why you think i look familiar

lost matrix
crude charm
#
getMongoManager().getClient().getDatabase("Documentation").****
lost matrix
#
    MongoCollection<Document> collection = ...;
    Bson filter = Filters.eq("Code", 400);
    FindIterable<Document> iterable = collection.find(filter);
crude charm
#

Aight thanks

onyx fjord
#

how do ppl do stuff like
"{player}" and then replace {player} with something else?

#

placeholders i mean

#

ik format() exists

ivory sleet
#

"{player}".replace("{player}",player.getName)

sonic wharf
#

Cannot resolve symbol 'EventPriority'

#

why

onyx fjord
#

thx conclure

ivory sleet
#

Can be chained even more since replace returns a new string with the modifications applied <:

sonic wharf
#

whcih one

lost matrix
#

You need to write regex which finds every element between { and } and then replace them based on a mapping and the context

sonic wharf
#

didnt import

rough basin
#

should i just leave api-version to real api's version?

knotty gale
#

sorry if I seem a little stupid but I havent donee this in a while, how would I get the opposite of a players direction

#

like ik how to get the direction, just not the opposite

crude charm
#

Is there ANY way to get an instance of player in a JDA event method?

ivory sleet
#

I mean a Member or User object sure

#

Might be called GuildMember idr

crude charm
#

I mean spigot Player

ivory sleet
#

Probably not

crude charm
#

Aight

ivory sleet
#

JDA doesnt have anything concerning spigot

#

You’d have to bridge that yourself im afraid of

crude charm
#

Yup

lost matrix
#

either inject it or get the player by UUID

crude charm
#

My brain is gonna explode from this

#

I don't wanna get a specific player

#

so UUID wouldn't work

lost matrix
#

Then just get a random one

ivory sleet
#

You can use sth like Iterables.getFirst from guava

crude charm
#

Infact the reason I want an instance of player is for UUID

hardy swan
ivory sleet
hardy swan
#

Pitch sure, yaw?

#

Actually both cant right

ivory sleet
#

I mean the direction is a vector, vector multiplied by scalar -1 always gives the opposite direction but same magnitude

hardy swan
#

Ah

ancient plank
#

quicc maffs

tardy delta
#

ive written all my messages with hardcoded placeholders lol

zealous osprey
#

"Conorsmine has vanished. Poof"

worldly ingot
#

I mean placeholders are inherently "hardcoded" ;p

knotty gale
tardy delta
#

well i mean you cant just put %player% in any of the messages as it wouldnt know what to do with it

#

its hardcoded what should be filled in

lost matrix
#

Just pipe every string through papi

tardy delta
#

im not even using papi on my server

knotty gale
#

what should I do to fix this?

ivory sleet
#

Get the direction as a vector

knotty gale
#

ok lemme try it

young knoll
#

Doesn’t blockface have a getOpposite

knotty gale
ivory sleet
#

Yeah look what coll said, you might not need to mess w vector

knotty gale
#

I tryied looking that up and found nothing

#

it worked tho

#

wait but its not block face sorry, its getting the face of the player, and puting it down there

#

im kinda stupid sorry

#

so lemme try the same thing with that['

ancient plank
#

hi kinda stupid sorry, I'm mom

knotty gale
#

ok but now I have that, how could I add the normal direction and the opposite direction together? because I cant use the normal + symbol using these types of faces and such

wary harness
#

any one can explain where the hack is loadPlugins() method from SimplePluginManager called

#

I am scoped thru all imported libs

#

I have and there is no usage of that method anywhere

#

how the hack are plugins loaded then

eternal night
#

CraftServer#loadPlugins

ashen quest
#

Is there an event for when a potion effect is ending?

eternal night
#

EntityPotionEffectEvent should be called

wary harness
#

is something wrong with my intellj

#

because still can't find it in search box

sturdy frigate
#

I want to create a utility package for spigot, I don't want it to be ran as a plugin/mod, how can I achieve this?

eternal night
#

plugins would have to shade it as a library

wary harness
#

I am still trying to find out how to make new aliases or command registered to be TAB compatible

sturdy frigate
eternal night
#

no

#

just a plain java project

sturdy frigate
#

Ah okay I see

#

Thanks

crude charm
#

Am I missing something, why isn't this working?

            MongoCollection<Document> collection = plugin.getMongoManager().getClient().getDatabase("aqua_core").getCollection("Documentation");


            Bson syncCodeFilter = Filters.eq("syncCode");
            FindIterable<Document> iterable = collection.find(syncCodeFilter);

            if (event.getMessage() != iterable) {

            if (event.getAuthor().isBot()) return;

                event.getMessage().delete();
                event.getMessage().reply("Not a valid sync code").queue();

            } else {
                event.getMessage().reply("valid").queue();

            }
tardy delta
#

why !=

#

isnt event.getMessage() a string

quaint mantle
#

That looks like jda

crude charm
#

^

#

but yeah I didnt compare right

#

it shouldn't affect it though?

#
            MongoCollection<Document> collection = plugin.getMongoManager().getClient().getDatabase("aqua_core").getCollection("Documentation");


            Bson syncCodeFilter = Filters.eq("syncCode");
            FindIterable<Document> iterable = collection.find(syncCodeFilter);

            if (!event.getMessage().equals(iterable)) {

            if (event.getAuthor().isBot()) return;

                event.getMessage().delete();
                event.getMessage().reply("Not a valid sync code").queue();

            } else {
                event.getMessage().reply("valid").queue();

            }
supple elk
#

I'm trying to make a boat step-up feature which needs to work at high boat velocities (boats which run into a 1 block tall wall will go on top of it). I'm using raytracing right now to achieve this, and have got it to work. However, my current system is unreliable as a lot of the time the boat will lose it's velocity when it steps up the wall. I was wondering if anyone had any ideas as I am kind of stumped

#

My current code

#

I suspect it's a ping issue when the client hits the wall before the server tells it to teleport up, so loses it's velocity. I tried setting the velocity of the boat again after it gets teleported, and tried delaying this by a tick too, but in both cases the velocity was still sometimes lost

tardy delta
#

getType().isAir() kek

supple elk
#

oh right

#

I'll change

#

Any thoughts, FourteenBrush?

tardy delta
#

whats a boat step-up feature supposed to mean?

supple elk
#

So when it hits a 1 block wall it goes on top of it

#

or when it approaches

crude charm
supple elk
tardy delta
#

mye

#

im starting to talk like conclure

supple elk
#

lol

#

mye = yes?

tardy delta
#

yes

supple elk
#

kk

#

so any ideas then?

#

I don't know what's causing the boat to lose velocity even when I set the velocity of the boat again

kind hatch
#

Does teleporting entites reset their velocity?

supple elk
#

I've tried setting the velocity of the boat again after the tp anyway

#

still, sometimes the boat loses velocity

#

if you want to see it in action you can join my server

quaint mantle
#

My guess is the client hits the wall before the boat does

#

Because I've noticed sometimes the clients hitbox can be in front of the boat sometimes

supple elk
#

yeah, that's what I'm thinking. Setting the velocity again after the tping should fix that though but it doesn't

kind hatch
#

That should only happen if they are on the side of the wall no? Isn't the boat hitbox larger than the player's?

supple elk
#

boat hitbox is larger than player's, why would that stop it from hitting the wall tho?

kind hatch
#

The player's hitbox shouldn't hit the wall first then.

median trench
#

Probably not but is there a way to change how particles move? Like make a redstone dust particle move like an enchant particle for example

supple elk
quaint mantle
#

Yeah

supple elk
#

mhm

kind hatch
#

Oh, I see.

eternal oxide
#

If it collides the client shoudl send a steering packet

supple elk
eternal oxide
#

I believe

quaint mantle
#

Because on servers there's a delay between the boat updating to the players actual position

supple elk
#

What's a steering packet?

eternal oxide
#

last I was messing boats and riding

supple elk
eternal oxide
#

see if you are getting that packet

quaint mantle
supple elk
#

Any other ideas then? Maybe if you saw it you might see other problems? I could send you server IP

#

or anyone here

quaint mantle
#

Maybe sometimes the client updates after the boat has already hit the wall and the velocity was set

supple elk
#

hmm

#

I did try delaying the setting of the velocity

#

up to 5ticks

#

5ticks it got weird

#

1 tick I didn't notice any changes

#

I didn't try inbetween times

supple elk
obsidian drift
#

Is there a way to see how much damage the item in the players hand caused to the entity damaged?

terse raven
#

is there a better way for doing this?

@EventHandler
    public void onPlayerDropItem(PlayerDropItemEvent event) {
        PlayerData playerData = RoleplaySystem.getInstance().getPlayerData(event.getPlayer());

        if (playerData.getLockedSlots().contains(event.getPlayer().getInventory().getHeldItemSlot()) &&              
                event.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.AIR)) {
            event.setCancelled(true);
        }
    }```
kind hatch
onyx fjord
#

tf does that mean

late sonnet
#

method bad readed...

obsidian drift
terse raven
terse raven
#

because right now if the locked slot is empty and the selected hot bar slot dropping is impossible

late sonnet
shy rock
terse raven
#

thats why i tried to filter it in that stupid way

#

or is there a event that only gets called when q is pressed

late sonnet
#

so strange no body request the event show the slot used

terse raven
#

you can detect through the inventory click event if a item from the inventory is dropped and cancel it

#

but that doesnt work if you use q

late sonnet
shy rock
#

i made a command that works and i can obtain the item

tardy delta
supple elk
#

bruh

#

A string is not an object apparently

eternal night
#

smh you cannot switch over classes

tardy delta
#

but this is valid :/

#

java moment

eternal night
#

Yes

#

that is pattern matching

#

not a straight up switch with a jump table

#

jep 406

tardy delta
#

my sserver doesnt like the fact that i need to enable preview features lol

tame elm
#

Hello I need an event when Water break a crop, what is it?

tardy delta
#

im on java 17

#

well not sure about this

quiet ice
#

Hm, then it might still be like that for switches

vital sandal
#

any let me know what is the problem here

tardy delta
#

uhh hover over it lol

onyx fjord
#

something: []

is empty list in yml right?

tardy delta
#

ye

#

sometimes i like json more than yaml

subtle folio
#

fourteen

#

java.sql or jdbc?

tardy delta
#

jdbc ig

#

PreparedStatement is java.sql lol

rotund pond
#

Hello !
I'm reading a spark from a lagging server and there's something I don't understand.
Most of the problems come with the function NMS.level.WorldServer.tickNonPassenger() ...
I don't really know how NMS works and I looked at google, I can't find anything about this function.
Can anyone explain pls ?

tardy delta
#

check my code on gh lol

glossy scroll
glossy scroll
rotund pond
glossy scroll
#

you cant fix it because there are just too many entities in your world it seems

rotund pond
#

Mh

#

And what if I remove entities IA ?

glossy scroll
#

removing their AI will definitely help

rotund pond
#

Alright, gonna check ty

quaint mantle
#

How I set SpawnWorld When someone dies

#

anyone can help me with this error?

tawdry python
#

What better way to know how many blocks the player has walked in the world? Is there a way to get the stats in minecraft?

ashen quest
quaint mantle
ashen quest
wary harness
#

got this error

#

my pom file

quaint mantle
wary harness
#

you see there are not glowing red

#

in pom file

wary harness
ashen quest
#

how do check if a potion effect is ending

#

is there any event for it?

quaint mantle
#

Cannot resolve method 'setData' in 'Block'

quaint mantle
quaint mantle
onyx fjord
#

do yall know any free service for hosting small maven repo?

boreal sparrow
#

Could this fail? I'm using it to check if a player joins certain worlds

public class Test implements Listener {
@EventHandler
public static void onChangeWorld(PlayerChangedWorldEvent event) {

boolean EnteredWorld1 = false;

boolean EnteredWorld2 = false;

boolean EnteredWorld3 = false;

Player player = event.getPlayer();
String world = event.getPlayer().getWorld().getName();

switch (world) {
  case "World1" -> {
    EnteredWorld1 = true;
  }

  case "World2" -> {
    EnteredWorld2 = true;
  }

  case "World3" -> {
    EnteredWorld3 = true;
  }
}

So will the booleans always be false unless the player entered one of the worlds in the switch statement? (Noob question sorry but I wanna fullproof as much as I can)

glossy scroll
#

will it ... work? yes

#

is it good? absolutely not

worldly ingot
#

lol

#

Beat me to it

glossy scroll
#

just do the per-world action in the switch statement

boreal sparrow
#

Ok that was dumb

glossy scroll
#

and just use event.getWorld()

boreal sparrow
#

thanks

glossy scroll
#

not player.getWorld because we dont know if the player's world has changed yet when that event fires

boreal sparrow
vital sandal
glossy scroll
#

?jd-s

undone axleBOT
glossy scroll
#

i would assume getWorld() would mean the world the player is switching to

boreal sparrow
#

yea

#

since there is a getFrom()

vital sandal
glossy scroll
#

no

#

its not

wet breach
vital sandal
#

why not ?

glossy scroll
#

player.getWorld is not defined behavior when the player switches worlds in that event

#

it could very well change between API versions

wet breach
#

because the player.getWorld() is possible to not be updated when the event fires

boreal sparrow
#

event.getWorld() it is

#

holdup

sturdy frigate
#

When making dependency libraries for spigot plugin programming, which library should I use? spigot-mc or spigot?

glossy scroll
#

spigot-api for api

quaint mantle
glossy scroll
#

and spigot for nms

#

?whereami

boreal sparrow
glossy scroll
#

that doesn't look like spigot ?

sturdy frigate
glossy scroll
#

i should do a better job at reading

ashen quest
#

how do check if a potion effect is ending
is there any event for it?

glossy scroll
#

player.getWorld it is lol

vital sandal
boreal sparrow
glossy scroll
#

i thought spigot-api and spigot were different...

wet breach
vital sandal
boreal sparrow
wet breach
#

spigot-api is the well the API, spigot is the server implementation which does also contain the api, but lets you target NMS as well

vital sandal
glossy scroll
#

oh no please arrest me

#

anyways

#

here the player's world changes before the event is fired

vital sandal
glossy scroll
#

so you will get the correct world

boreal sparrow
#

ok good

#

thanks

glossy scroll
#

sorry for confusion

quaint mantle
boreal sparrow
#

np thanks for your help

glossy scroll
#

i thought PlayerWorldChangedEvent extended a different class...

glossy scroll
#

it doesnt look like it

#

based on your pic

#

(hes on PE)

quaint mantle
#

bro I use GeyserMC

wet breach
glossy scroll
#

event isnt cancellable

boreal sparrow
#

delightful

vital sandal
#

there is an damage event

glossy scroll
#

yes

#

several

vital sandal
#

you can cancel that damage

quaint mantle
#

So I downloaded plugin for Java to my server

glossy scroll
#

are you developing the plugin?

quaint mantle
glossy scroll
#

yes

#

are you developing the plugin

quaint mantle
#

Sometimes yes

glossy scroll
#

so im confused by your question

#

you're asking for a code snippet

echo basalt
glossy scroll
#

to change where a player respawns

quaint mantle
#

OK how

glossy scroll
wary harness
quaint mantle
#

Ok I downloaded 1m

wary harness
#

is wrong

#

?

sturdy frigate
#

Is there a name for the lowest level folder in a project sturcture?
so org.commands.dot, what is dot?

vocal cloud
#

That's usually the artifact id

sturdy frigate
#

Okay makes sense

ashen quest
glossy scroll
#

ok so if you dont know what to do with that

#

?learnjava

undone axleBOT
wary harness
#

Well is any one able to explain why I can't axes NMS

glossy scroll
#

pom?

wary harness
wary harness
quaint mantle
crisp steeple
#

change spigot-api to just spigot

glossy scroll
wary harness
#

you taking to me

glossy scroll
#

also use ?paste

#

?paste

undone axleBOT
glossy scroll
#

i want to see your pom in full

floral mauve
#

Does anyone have an updated tutorial for getting started writing mods compatible with spigot using either vscode or intellij idea?

crisp steeple
glossy scroll
#

he has the spigot dependency there

#

and spigot-api is commented out

boreal sparrow
#

anyone have a easy method for a countdown, bukkit runnables are freaking me out

crisp steeple
#

i am blind

#

lol

boreal sparrow
#

true

crisp steeple
#

maybe just refresh maven

vital sandal
#

how to draw a circle

#

with a given direction

quaint mantle
#

Gast tell me the file who i should to edit @glossy scroll

wary harness
#

@glossy scroll by rebuild you mean do maven clean

glossy scroll
#
Bukkit.getScheduler().runTaskTimer(plugin, bukkitTask -> {
    if (this.countdown-- <= 0) {
        bukkitTask.cancel();
    }
}, 0, 20);```
wary harness
#

and then again try to maven package it

glossy scroll
floral mauve
#

Where can I find up to date tutorials for developing mods using Spigot?

tardy delta
#

maven tab

glossy scroll
#

cleaning can sometimes help

glossy scroll
#

do it in terminal

wary harness
#

and rebuild thing can't be run because project is maven

glossy scroll
#

what is the output then?

#

Rebuild Project isnt a mven thing

#

its an intellij thing

#

its just like a cache clearing tool thingy idk

#

whenever i have weird behavior i run it

wary harness
#

well I get this

#

sec

ashen quest
#

If a premium plugin needs to be able to run without internet (rules say that)

What happens when the plugin wants to connect to a database?

vital sandal
#

there are buttons for that

wary harness
#

@glossy scroll

glossy scroll
vital sandal
glossy scroll
#

oh wait

wary harness
glossy scroll
#

sory

onyx fjord
#

is there an event that triggers when player leaves server no matter if its kick or manual leaving or server stop?

quaint mantle
#

Bro What now @glossy scroll

vital sandal
#

it is install button i think

glossy scroll
#

looks like your java version is wrong

wary harness
#

and this is from mvn clear install

glossy scroll
#

in your mvn compiler plugin

#
                    <configuration>
                        <source>17</source>
                        <target>17</target>
                    </configuration>```
delicate lynx
glossy scroll
tardy delta
#

when the server crashes no player quit is called >:

wary harness
#

@glossy scroll all fine

onyx fjord
glossy scroll
delicate lynx
#

quit still runs if the player is kicked, the kick event is called first then quit

wary harness
#

I just did rebuild thing and changed java to 17

glossy scroll
#

did u put that in ur pom tho

wary harness
#

after rebuilding project maven thing works

#

thanks

#

for help

glossy scroll
#

ok but did u put that in ur pom

#

you should

ashen quest
quaint mantle
glossy scroll
wary harness
glossy scroll
quaint mantle
#

I don't care if it's a code or plugin

glossy scroll
#

is that you need to find a different solution

true perch
#

I've been wondering how to efficiently sort a list of objects based on member variables for a long time.

Here's an example:

public class MainClass {
    public static HashMap<Integer, Weapon> weapons = new HashMap<>();
    public static void main(String[] args) {
        for (int id = 1; id <= 1000; id++) {
            weapons.put(id, new Weapon(id, (int) (Math.random() * 1000)));
        }
    }
}```
The above code stores 1,000 instances of a `Weapon` object within a HashMap called `weapons`.
```java
public class Weapon {
    private int id;
    private String name;
    private int damage;
    public Weapon(int id, int damage) {
        this.id = id;
        this.damage = damage;
        this.name = "Unknown";
    }
}```
What is an efficient way to make a list of these `Weapon` objects **from** the `weapons` HashMap sorted from highest `damage` to lowest `damage` (Weapon member variables)?
glossy scroll
#

SQLite or just disable the internet database if theyre offline

tardy delta
wary harness
#

this should work

glossy scroll
#

where is java.version

glossy scroll
#

oh i see

#

yes

#

you should be fine

tardy delta
wary harness
#

well thanks for help

supple basin
#

I am not able to translate progress messages in the HoverEvent, I have tried to put the key in several ways and have not been successful.

I'm using TranslatableComponent, has anyone managed to deal with this ?

advancements.husbandry.safely_harvest_honey.description not work (example)

glossy scroll
#

you can sort a NavigableMap

#

(by keys)

tardy delta
#

whats a navigablemap

#

i think a treemap is enough here

true perch
glossy scroll
#

there is

#

map.values

wary harness
#

Finally figure out how to make commands tab complitble

glossy scroll
#

its the superclass of TreeMap

wary harness
#

thanks god

glossy scroll
#

(you should downcast TreeMap to navigableMap)

wary harness
#

whole day spended on that shit

#

I love my self

onyx fjord
#

whats the diff

wary harness
#

after you edit CommandMap you need to call

        cs.syncCommands();   CraftServer cs = (CraftServer) pl.getServer();
        cs.syncCommands();```
ashen quest
quaint mantle
glossy scroll
#

i mean im not an expert on all premium plugins

#

whats the db for

ashen quest
#

basically imagine you are making a skyblock plugin

onyx fjord
#

database can run on localhost?

ashen quest
#

oh yea

glossy scroll
#

SQLite my guy

onyx fjord
#

that too

#

or H2

ashen quest
#

but not every database runs on localhost

glossy scroll
#

so your plugin will not work without db?

#

sounds like a bad premium plugin...

ashen quest
#

kinda

#

i m not gonna make it prem anyway

onyx fjord
#

have 1 remote and 1 local database option

#

like every other plugin

ashen quest
#

nice

tardy delta
#

my plugin doesnt work without db too lol

wary harness
tardy delta
#

whats bad about that

ashen quest
#

another question

#

is there an event for a potion effect ending

#

or ended

gray merlin
#

I can't download these sources, I just click on Download Sources and nothing happens...

tardy delta
#

no

wary harness
gray merlin
glossy scroll
#

yea theres no sources available for nms

gray merlin
#

ah alright

wary harness
gray merlin
#

ty

ashen quest
# wary harness make runable

a runnable that loops through all players checking if they have a potion effect and if they do, getting its duration

#

that sounds so bad performancewise

wary harness
wary harness
#

which would track potion as key

#

and value would be runnable task

ashen quest
#

ohhh you are so smart

#

i got an idea influenced by yours

wary harness
#

Just to make it look nicer

glossy scroll
#

I believe youre looking for

wary harness
glossy scroll
#

Collections.sort(map.values(), Comparator.comparingInt(Weapon::getDamage))

#

could be wrong

#

that just comes to mind

true perch
#

That seems very useful

#

that may just be what I'm looking for

glossy scroll
#

actually

true perch
# glossy scroll could be wrong

Basically what I want is this. If I have a large list of objects, how can I sort the list based on the member variables within the objects?

glossy scroll
#

map.values() wont work

#

cuz its not a list

#

well it depends

true perch
#

could be any form of stored data, doesn't necessarily need to originate from a HashMap

glossy scroll
#

you'll be using Comparator

#

many of these methods accept functional interfaces

#

which can be used with a lambda

boreal sparrow
#

can you register events for more than one class in your main class?
as in:

getServer().getPluginManager().registerEvents(new Events(), this);
getServer().getPluginManager().registerEvents(new Events1(), this);
glossy scroll
#

yes!

#

in fact it is encouraged!

boreal sparrow
#

oh ok great!

onyx fjord
#

i have this code

public static boolean joinedBefore(Player player, Boolean shouldSave) throws IOException {
#

are booleans false by default?

#

or true

glossy scroll
#

Boolean is null by default

#

boolean is false by default

onyx fjord
#

good thanks

glossy scroll
#

use the primitive version plz

#

not the boxed

eternal needle
#

hi this is my code now

    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {

        if (args.length == 1){
            List<String> playernames = new ArrayList<>();
            Player[] players = new Player[Bukkit.getServer().getOnlinePlayers().size()];
            Bukkit.getServer().getOnlinePlayers().toArray(players);
            for (int i = 0; i < players.length; i++){
                playernames.add(players[i].getName());
            }
            return playernames;
        }

        return null;
    }
}```

and i want so if i type * after that i seleckt all player what do i need to add? tag me
glossy scroll
#

uh

#

well

#

first

#

Bukkit.getOnlinePlayers().stream().map(Player::getName).toList()

#

and second i dont know what youre asking

#

@eternal needle

spare sky
#

It is possible to somehow find out how many hours (ticks or something else that can be converted to hours) the player has on the server (BungeeCord)

glossy scroll
#

not without tracking yourself

#

well actually there are statistics but i believe those are per-server

eternal needle
#

it's like if i want to give everyone on mye server i don't want to type every name so i can type * and it seleckt all player so /eco give * 100

spare sky
#

I watched some forums and there is bukkit.getstatistics but thats bukkit

glossy scroll
#

...yea?

glossy scroll
eternal needle
quaint mantle
#

I fix it withe /spawnpoint 🄲@glossy scroll

onyx fjord
#

can i listen to events that i have no access to?

basically i want user to place a list of events that my plugin will listen to (including custom plugin events)

#

for example com.github.somebody.someplugin.SomeEvent

glossy scroll
#

what is the purpose of this?

onyx fjord
#

my plugin will execute commands on any event server owner can imagine

#

and i know its possible, kiteboard does that

glossy scroll
#

then can you look at kiteboard's source?

onyx fjord
#

id have to buy it

#

maybe a different question, is there event that runs on any event šŸ˜‚ ?

glossy scroll
#

no but im helpin just hold on

#

looking at code

onyx fjord
#

thanks!

tardy delta
#

if you want it to show nothing, use Collections.emptyList()

eternal needle
tardy delta
#

ig create a new arraylist with the player names then and add "*"

eternal needle
#

ok thx

quaint mantle
#

Can someone send me discord plugin redstonepvpcore

tardy delta
#

lol

glossy scroll
onyx fjord
#

what does that do

glossy scroll
quaint mantle
#

I want plugin When someone kills a player throw him item

glossy scroll
onyx fjord
#

ooo

#

thats cool

#

thx

glossy scroll
#

if im being honest

#

im not sure what Listener should be

ivory sleet
#

The listener passed when registering

#

But keep in mind registerEvent still takes an instance of Class<extends Event> which requires an event class that has handlers

glossy scroll
#

yes

#

this person would need to cast the user-defined class to that type

#

and just trust that the user put in the necessary handler stuff

ivory sleet
#

Ye

golden turret
#

do you think that storing data on the ItemStack instead of using a database is a good idea?

glossy scroll
#

@onyx fjord you will need to catch the error IllegalPluginAccessException

ivory sleet
#

Depends on what type of data

onyx fjord
#

ill see what i can do

glossy scroll
#

well im telling u to catch that error

onyx fjord
#

yee will do

glossy scroll
#

otherwise your whole plugin will just stop when trying to register events and things

onyx fjord
#

if i ever make it to work

#

yall get free copy

gray merlin
#

Is there no way to wait for a certain amount of ticks without a scheduler?

onyx fjord
#

there is sleep afaik but doesnt it kill the thread?

#

for X time

ivory sleet
#

BukkitScheduler or ScheduledExecutorService in principle

gray merlin
#

The normal time sleep? Yeah that blocks the thread

glossy scroll
gray merlin
ivory sleet
#

It does

#

ScheduledExecutorService

#

It still schedules

#

But far more efficiently compared to CraftBukkitScheduler

glossy scroll
#

it wont be synched with the server thread tho

ivory sleet
#

That too

glossy scroll
#

if you want to use ticks as your timing device (you really should...)

#

unless

#

its db related

ivory sleet
#

You can always callback to server thread with the BukkitScheduler <:

glossy scroll
#

yes lol

boreal sparrow
#

How do I disable damage to minecarts?
I tried this but it doesnt work

if(event.getEntity() == Minecart){
                event.setCancelled(true);
            }
gray merlin
#

I see, thank you

glossy scroll
#

i mean you can also use CompletableFuture too

#

theres many ways

#

but BukkitScheduler should be used for all gameplay/api purposes

ivory sleet
glossy scroll
#

yes

ivory sleet
boreal sparrow
#

i tried that as well

glossy scroll
#

what does your event look like

eternal needle
glossy scroll
#

list.add?

boreal sparrow
#
@EventHandler
public static void onAttack(EntityDamageByEntityEvent event){

if(event.getEntity() instanceof Minecart){
    event.setCancelled(true);
}
glossy scroll
#

looks like itll work

#

wait

quaint mantle
#

I want to make a place inaccessible to only those with special ranks Is there plugin like this

glossy scroll
#

yea should owr

#

?services

undone axleBOT
glossy scroll
#

please stop making plugin requests

onyx fjord
#

@quaint mantle if you are willing to pay drop me a dm

echo basalt
#

🤔

#

dont

onyx fjord
#

wdym?

tardy delta
#
List<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toCollection(ArrayList::new))
names.add("*");
return names;
```but streams bruhh
onyx fjord
#

is making money illegal or what

echo basalt
#

it's just like

#

not cool

#

to approach clients on a dev help chat

onyx fjord
#

wdym not cool, he literally asked if someone can do it

glossy scroll
#

?services

undone axleBOT
glossy scroll
#

its also unethical to prey on someone looking for a plugin that already exists

#

and offer to make a custom one

onyx fjord
#

well idk what he wants

glossy scroll
quaint mantle
onyx fjord
#

^ say in that channel what exactly you need

quaint mantle
#

Ok

supple elk
#

I'm getting it every tick driving the boat

#

So I'm not sure how I can use this to determine if the boat hits the wall or not

#

50% of the time it goes over blocks fine

#

other 50% all velocity is lost for no apparent reason

ancient plank
#

My favorite thing to use boats for is to place it inside a door and move through it, on servers with door lock plugins

supple elk
#

that's possible?

#

I'm trying to make a boat step-up feature

ancient plank
#

Yub

supple elk
#

so it can ride over one block walls

ancient plank
#

boat hitboxes are larger than you place them in the corners

#

so you can angle it to clip through blocks

tardy delta
#

lol thats possible?3

onyx fjord
#

make a plugin that fixes it šŸ˜Ž

ancient plank
#

another server I was on had a plugin that prevents you from placing boats on land but you can use that hitbox to get boats on land anyways

#

keke it's funny

azure hawk
#

why is this not working

ancient plank
#

method no existo @azure hawk

azure hawk
#

it works in my other projekt

boreal sparrow
#
Player player = event.getPlayer();
for(Player p : player.getWorld().getPlayers()){
                    p.teleport(somewhere);
                }

Will that teleport all players in the players world? If not, how do I do that?

supple elk
#

should work

undone spindle
#

how do i get a class out of main from another project?

#

ive linked one with the other

#

and i can get the main class

#

but i don't want to make a new main cus that will make it that its dubble

flint coyote
#

huh?

#

Every plugin has it's own main. That's normal

undone spindle
#

yes

#
public class Main extends JavaPlugin {
public Select select = new Select(this);

    @Override
    public void onEnable()
    {
        
        new CancelEvents(this, select);
        getServer().getPluginManager().registerEvents(select, this);
    }
    
    public Select getSelect() {
        return this.select;
    }
    

}
#

so i want to get the select in another project

#

Select is a class

flint coyote
#

You have to add your plugin as a dependency in the other plugin

#

and then import your main class

#

I would recommend not naming your main class "Main" in every plugin

#

Instead just name it after the plugin. If it's for warps the plugins Main can either be "Warp" or "WarpMain"

undone spindle
azure hawk
#

how can i ban a player

azure hawk
azure hawk
undone spindle
#

uh....

flint coyote
#

One time you have an instance of "Player" the other time you have an instance of "OfflinePlayer"

#

Also OfflinePlayer#setBanned is deprecated. You should not use it

#

you can get it via getServer().getBanList()

undone spindle
# flint coyote You have to add your plugin as a dependency in the other plugin

this is the other project i tried what you said and is this what you meant??

package com.dami.kingdomServerCommands;

import org.bukkit.plugin.java.JavaPlugin;

import com.dami.Commands.KingdomCommand;
import com.dami.main.Main;


public class KingdomServerCommands extends JavaPlugin
{
    @Override
    public void onEnable()
    {
        Main main = null;
        new KingdomCommand(this,main.select);
    }
    
}
#

import com.dami.main.Main is the other script i showed earlier

flint coyote
#

Yeah but you can't do main.select if main is null

ornate patio
#

this is probably more of a twitch question but im not really sure so im just gonna ask here

#

lets say i was to make a minecraft plugin that integrates with twitch

#

would I be able to use the server to host my twitch bot?

flint coyote
#

Yes. I had a website running as a plugin on my minecraft server for a while

ornate patio
#

Ah alright

#

thankfully i dont need to pay for hosting then

#

i'll just make the server host an instance of the bot for one twitch channel

flint coyote
#

yup that works

#

Just make sure everything is async / doesn't take too much time

#

otherwise the bot will lag your server when it's under load

ornate patio
#

yeah i found twitch4j

#

which is async

flint coyote
#

šŸ‘

azure hawk
undone spindle
azure hawk
#

same

onyx fjord
glossy scroll
#

Class.forName

flint coyote
onyx fjord
#

i end up with this crap

flint coyote
onyx fjord
#

ij fails to generify it

glossy scroll
#

(Class<? extends Event>) Class.forName("")

onyx fjord
#

šŸ˜„ yeah i know

#

should i just suppress unchecked?

undone spindle
glossy scroll
#
            Class<? extends Event> aClass = (Class<? extends Event>) Class.forName("");
            Bukkit.getPluginManager().registerEvent(aClass, new Listener() {}, EventPriority.NORMAL, (listener, event) -> {}, plugin);```
flint coyote
golden turret
#

do you think that storing data on the ItemStack instead of using a database is a good idea?

flint coyote
#

Usually you would use DI but since you are in different projects that will not be possible. Unless spigot has a method to retrieve the JavaPlugin class of a plugin. I don't know if that's the case

boreal sparrow
#

Is there a way to remove arrows that hit blocks and not entities? So they don't clog up?

flint coyote
golden turret
#

always basically

#

I want to store phone data on the item

glossy scroll
undone spindle
golden turret
#

like, applications, application data

glossy scroll
#

you should use your own values

flint coyote
onyx fjord
#

i also put listener and executor in own classes

flint coyote
undone spindle
flint coyote
sterile token
flint coyote
#

Then you just have to cast it to your own main class and you can retrieve the Select

flint coyote
#

But the pluginManager method sounds promising

sterile token
ornate patio
#

How can I update the config file within a plugin

#

like change a setting for when a player runs a command

flint coyote
#

Yup that's what I said after I checked whether spigot has a method for that. Before I said I'm unsure if one exists

sterile token
ornate patio
#

lemme see FileConfiguration javadocs

sterile token
oblique geyser
#

projectile source exist in 1.18.2?

flint coyote
#

yes

crimson scarab
#
package dev.tapwatero.greatgear;

import org.bukkit.Particle;
import org.bukkit.attribute.Attribute;
import org.bukkit.entity.*;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;

import java.util.Comparator;
import java.util.List;
import java.util.Optional;

public class HomingArrowRunnable extends BukkitRunnable {

    private Entity arrow;
    private Player player;
    private Entity target;

    public HomingArrowRunnable(Entity arrow, Player shooter) {
        this.arrow = arrow;
        this.player = shooter;
    }

    @Override
    public void run() {
        Projectile proj = (Projectile) arrow;

        if (target == null || player.hasLineOfSight(target)) {
            setTarget();
        }


        if (arrow.isDead() || target.isDead() || target.getLocation().distance(arrow.getLocation()) <= 3) {
            cancel();
            return;
        }

        Vector newVector = target.getBoundingBox().getCenter().subtract(arrow.getLocation().toVector()).normalize();

        arrow.setVelocity(newVector);
    }


    private void setTarget() {
        List<Entity> nearbyEntities = arrow.getNearbyEntities(50, 50, 50);

        if (nearbyEntities.size() == 0)
            cancel();


        Optional<Entity> optionalEntity = nearbyEntities.stream()
                .filter(entity -> entity instanceof LivingEntity && ((Projectile) arrow).getShooter() != entity)
                .min(Comparator.comparing(entity -> entity.getLocation().distanceSquared(arrow.getLocation())));

        if (!optionalEntity.isPresent())
            cancel();

        target = optionalEntity.get();
        ParticleBeam.spawn(player.getLocation(), target.getLocation(), Particle.FIREWORKS_SPARK, 20, 40, 0, 0, 0, 0, null, false, null);
    }
}

Can you guys help me make it so that only entites that can be seen by the player are targeted and the arrow doesn't go through blocks

#

not through blocks

#

but stop it from hitting blocks in its journey

zealous osprey
#

you can take the entities in "nearbyEntities" and check if the player can see that entity

crimson scarab
#

how do i add this to the Optional

ornate patio
#

is there a way I can get the config file location of a plugin

#

just looking for a built in method before i do it manually

naive bolt
#

how can i copy comments to my config.yml

flint coyote
#

it's always in the same folder

#

plugin.getDataFolder()

cold tartan
#

Is there a way to get the event when an entity targets another entity for breeding, I know EntityTargetEvent, but I couldn't find the reason for breeding

naive bolt
#

i use ```java
private void registerConfig() {
File config = new File(this.getDataFolder(), "config.yml");
if (!config.exists()) {
getLogger().info("Generating config.yml... It may take a while.");
saveDefaultConfig();
}
}

#

on enebale ```java
registerConfig();
getConfig().options().copyDefaults(true);
saveDefaultConfig();
saveConfig();
getConfig().set("plugin.version", version);
saveConfig();
getLogger().info("Config.yml was generated..");

flint coyote
#

You don't need that for the default config