#help-development

1 messages Β· Page 1376 of 1

carmine ivy
#

But its still giving me the other error that I sent earlier

rain flint
#

Try to employ "short-circuiting" of logic if at all possible. This means you should force a conditional to be the value needed to side step the code block to achieve your desired effect.
For example, to short circuit this:

if (!this.world.isClientSide && !this.isDead && (d0d0) + d1 + (d2d2) > 0.0D) {
this.die();
this.h();
}
You would do this:

if (false && !this.world.isClientSide && !this.isDead && (d0d0) + d1 + (d2d2) > 0.0D) {
this.die();
this.h();
}

#

Well, it just says, force the condition to what you want

#

It makes no sense

eternal oxide
#

its wrong. the second would never pass

rain flint
#

Yeah that's the point

eternal oxide
#

they are missing a !

rain flint
#

It just says: "Make your code never executed"

#

I don't understand why the hell would they do this

eternal oxide
#

thats true it would never execute and yoru IDE shoudl warn of unreachable code

#

You would never do it

rain flint
#

That's NMS so I'm not using it, I'm only using the bukkit api, not the source code

#

But I had to bypass this by calling myself the code inside the "if statement" because it's never executed

#

They could just simply delete the code, I really don't get it

eternal oxide
#

I can;t see any context so as it stands that small section makes no sense.

rain flint
#

I totally agree with you

#

But I'm happy that I finally found the source of my issue, which is craftbukkit itself ._.

eternal oxide
#

Its saying if you want to commit a change to any Minecraft classes you need to make a minimal diff. Adding the false value disables all the following code without removing it.

#

So adding the false is less of a change than deleting all the code.

rain flint
#

Ohh yeah I see it

quiet ice
#

Plus the compiler will deal with all unreachable code

#

So it doesn't hurt in runtime

night copper
#

how can I add more language supports to my plugin?

#

I never did something like this before

quaint mantle
#

im stuck as hell. im new to the wile mysql thingy. banned players are stored in the database UUID -> Reason -> Username-> Time. i want to create a kick on player join when Players uuid equals the uuid stored in database but im falling in that part.

spark finch
#

How to turn String into a Material object? 😳

night copper
#

maybe

#

idk

#

im really tired

spark finch
#

ah i c

cinder thistle
#

as kick won't work while they're logging in; only joining

quaint mantle
eternal oxide
#

uuid.toString firstly, second is use the AsyncPlayerPreLoginEvent as you can delay that event to wait for your SQL response

cinder thistle
#

o.o

quaint mantle
#

thanks!

gleaming grove
eternal oxide
young knoll
#

It's valueOf

#

Also use matchMaterial or getMaterial instead

quiet ice
#

matchMaterial > valueOf

odd bronze
#

Is there a way to remove enchants from item lore?

eternal oxide
#

lore isn;t enchants

odd bronze
#

but if you get lore, enchants would be in there too

eternal oxide
#

Only if you added them

quiet ice
#

Enchantments are not in the lore

#

At least not vanilla ones

#

There is however a flag that allows to hide ALL enchantments

odd bronze
#

that flag is not working for me

#

I want to make kit command which saves item data to a file

#

but it looks like enchants are in the lore by default

eternal oxide
#

no

quiet ice
#

They should not be though

#

You got a plugin that is messing up something

eternal oxide
#

Enchants and Lore are two totally separate things.

odd bronze
olive badger
#

No I don't use lombok, and i use annotationProcessor because I have understand I need use that if the annotation is not needed in final jar, but it's possible It's wrong, I'm new in gradle.

ivory sleet
#

yeah

#

the annotationProcessor is not needed

#

well if you wanna make it transitive use compileOnlyApi

#

but even so it shouldn't shade into the jar

#

you should use api or implementation then

torn crescent
#

Hello,

is it possible to add custom Attribute with the Attribute API? e.g. something like GENERIC_MANA? 🧐

earnest junco
#

Fixable with a resourcepack

quiet ice
#

Unless you do dark ASM art and unsafe reflection and then use a few compiler tricks, no

torn crescent
quiet ice
earnest junco
torn crescent
#

Oh, so I will have to use the nbt tags for that? I thought I could just do something like ItemMeta#addAttributeModifier(MyAttribute.GENERIC_MANA, myCoolModifier);

So I guess I also cannot get the default Armor Attribute vom e.g. an LEATHER_HELMET ItemStack with this API?

sharp bough
#

is there a way to change the default words public oncommand has? so instead of using commandSender it would type sender automatically

#

instead of this
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings)
i want
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args)

#

i cant be the only one with this problem

earnest junco
#

Or you could just say "fuck it" and handle everything internally and finally display the "attribute" as lore only

#

would look the same to the user

torn crescent
torn crescent
vestal dome
#

since I do not know why this is happening......

#

Note: Rejoining the server fixes this.....

eternal oxide
#

Cant comment without seeing code

vestal dome
#

uhh

#

my entire block break event...

serene bane
#

I'm trying to access my main plugin from another class in order to reload it but the error I get is that the plugin is null. Here's my code ```Announcer plugin;

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

    if (command.getName().equalsIgnoreCase("announce")) {
        Player player = (Player) sender;

        if (args[0].equalsIgnoreCase("reload")) {

            if (player.hasPermission("announce.reload")) {

                plugin.reloadConfig();
                player.sendMessage("Reloading Announcer");
                System.out.println("Reloading Announcer");

            } else {
                player.sendMessage("You don't have permission to use this!");
            }```
vestal dome
#

because plugin is null

#

create some type of singleton in the main class or this.

vestal dome
eternal oxide
#

what is yoru MachineBreakEvent

vestal dome
eternal oxide
#

ok so thats just so yours or some other plugin can cancel it

vestal dome
#

another note is that my plugin is the only on the server...

#

still asking if it's my client

eternal oxide
#

You are not using any packets so no its not your client. its your code

vestal dome
#

Sense apsent

eternal oxide
#

Somewhere you are removing blocks when doing a rayTrace

vestal dome
#

I'm not using packets as you said...

eternal oxide
#

rayTrace isn't packets

vestal dome
#

what do you call RayTrace?

#

πŸ˜‚

eternal oxide
#

The issue would appear to be in your removeMachineInstant

vestal dome
#

huhum

#

big brain

#

thx

quiet ice
#

But what is if teh chunk is already loaded?

vestal dome
#

if it is not

#

the player just duplicated a block

#

which I do not want to happen

sharp bough
#

now this might a dumb thing to ask but why can i do this

ItemMeta itemMeta = player.getInventory().getItemInMainHand().getItemMeta();
                itemMeta.setDisplayName(String.valueOf(message));

and not this

ItemMeta itemMeta = player.getInventory().getItemInMainHand().getItemMeta().setDisplayName(String.valueOf(message));
#

isint it the exact same thing?

vestal dome
#

if you set the ItemMeta to the item back, everything should work correctly.

young knoll
#

getItemMeta returns ItemMeta which you can assign to a variable

#

but setDisplayName returns void

vestal dome
#

uhuu

eternal oxide
#

setDisplayName does not return an instance of ItemMeta

sharp bough
vestal dome
#

yeah

#

but you do that after you change the item meta.

eternal oxide
#

no, your itemmeta will be null

vestal dome
#

bet my IQ = 24798127489127489217.

#

well sometimes

eternal oxide
#

unless you use the first method

young knoll
#

Item builders are nice

vestal dome
#

eh

#

I find them quite useful tbh

left swift
#

how can I make nametag prefix, should I use the teams? or another way

karmic sapphire
#

has anyone had when they drop a item when a block burn out in the blockburnevent that there fires dont burn out?

#

i make a plugin when wood burns it drops charcoal.

#

that works

#

but now the fire dont stop burning

lost matrix
#

Do you mean that it just spreads or does the fire appear to be on an air block.

#

Because its perfectly normal that fire spreads.

karmic sapphire
#

yes apears on air blocks and dont die

#

@EventHandler
public void blockBurn(BlockBurnEvent event) {

    Location location = event.getBlock().getLocation();
    Item drop;
    
    for(Iterator<String> i = this.KeyList.iterator(); i.hasNext(); ) {
        String key = i.next();
        try {
            this.Source = dataConfig.getString(key+".source");            
            this.Drop = dataConfig.getString(key+".drop");
            
            
            if(this.Source.contains(event.getBlock().getType().toString())) {
                drop = location.getWorld().dropItem(location, new ItemStack(Material.getMaterial(this.Drop, false)));
                drop.setInvulnerable(true);
            }
            
        }
        catch (Exception e) {
            Bukkit.getLogger().log(Level.WARNING, "Error with block burn event "+key);
        }
    }
}
quiet ice
#

```java
<your code here>
```

karmic sapphire
#

my project is open source

#

just be gentile this is my 3rd month of coding plugins

hardy valley
#

what do you want to do sorry?

karmic sapphire
#

when wood items burn i want to drop charcoal

#

it works

#

but my fire dont stop burning ones i use the blockburnevent

#

tried to post a pic but seems im not allowed

hardy valley
#

use Imgur link

#

and still, I haven't understood well. The fire still burns the charcoal that gets created?

#

if yes

karmic sapphire
lost matrix
#

Thanks ij... great help

karmic sapphire
#

ones block get burned out then it drops the charcoal

hardy valley
#

stop the event then

hardy valley
karmic sapphire
#

no casting

quiet ice
#

An @SupressWarnings("all") will resolve that

karmic sapphire
#

just in a class with a listner

hardy valley
#

is check if the wood transformed into charcoal. If it successfully transformed, then remove the event

#

so the fire doesn't expand

lost matrix
# hardy valley have you casted it?

Im trying to figure out how to not cast because i made it semi type safe by checking runtime classes. Im not quite sure where my type got erased in a way that
i would need to cast unsafe again...

karmic sapphire
#

fire spread is not the problem. my fires never burn out. for example if i light a grass block it keeps on burning for ever and never goes out

hardy valley
#

oh

#

use a cooldown then, like that after 10 seconds it goes out

karmic sapphire
#

i can send you my server address in private if you want to see it live

hardy valley
#

yes please

kind coral
#

why doesn't it remove 2 durability from the item? (no errors in console)

lost matrix
kind coral
#

why +2

#

isnt the damage positive

quiet ice
#

setDamage

#

Not setHealth

lost matrix
#

So increasing the damage decreases the durability

kind coral
#

so how would i do this. like item.setDamage(item.getDamage() +2)?

quiet ice
#

correct

kind coral
#

pog

sand vector
#
public void warp(Player player, String string) {
      config.get("Users." + player.getUniqueId() + "." + "Warps." + string + ".Yaw");
    }

How do I use the values from the config.get() in another class?

young knoll
#

Pass the config through the constructor

quiet ice
#

Or make it static (lazy and unrecommended approach)

kind coral
#

i've just tested and the item doesn't seem to get its durability taken away

quiet ice
#

Do you set the item meta?

kind coral
#

oh, wait

#

quick question, i have a method that returns an itemstack ( in this case a leather hat ), with custom lore etc. tho if i wear for example the leather hat without custom lore etc the program still does what the custom needs to do

young knoll
#

You should add some data to the items PDC to compare

kind coral
#

wdym

young knoll
#

PersistantDataContainer

olive lance
#

does anyone have a good example of a proper oncommand method for a command with a lot of different arguments

#

that looks good

hardy valley
#

anyway

kind coral
young knoll
#

You can, but that posses a lot of issues

olive lance
#

no im using intellij

young knoll
#

If a player renames the item, it won't match

hardy valley
# hardy valley anyway
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
}
olive lance
#

just trying to get rid of arrow code

kind coral
#

he can't rename it

#

i made all checks

olive lance
#

@hardy valley ik how to implement the oncommand i wanna clean my arrow code

young knoll
#

It's still better to use PDC

#

Durability also needs to be the same with .equals

pale ibex
#

Is it possible to add a recipe for the Smithing table?

sand vector
young knoll
#

Make a constructor that takes a Config variable and stores it to an instance variable

#

and then do new ClassName(config)

torn oyster
#

hey

#

why doesn't this have the contents of their inventory?

#
        inventories.put(p, p.getInventory());
        staffModeList.add(p);
    
        p.getInventory().clear();
        setStaffmodeInventory(p);
    }```
olive lance
#

why would intellij tell me my initializer is redundant when i use the variable in a lot of places

stone sinew
torn oyster
#

inventories.put(p, p.getInventory());

#

oh

#

i thought the inventory object has the contents

#

cuz it has the PlayerInventory.getContents() method

stone sinew
#

it does but you have to use the method...

torn oyster
#

also what would be the best way to store inventory contents in a yaml file

stone sinew
young knoll
#

It's auto serializable

#

just use set("path", Arrays.asList(contents);

stone sinew
young knoll
#

Ideally you would use json or a database

#

But hey, it's a spigot feature for a reason I guess

torn oyster
#

how do i make a yaml file that has all the data

#

i forgot

young knoll
#

What data

torn oyster
#

well

#

just a yaml file that can store things

stone sinew
#

getResource() or getConfig().options().copydefaults()

torn oyster
#

rather than a config

young knoll
#

YamlConfiguartion.loadConfiguration(file)

karmic sapphire
#

there my github you will see a customSmittingTableRecipe.java

karmic sapphire
hardy valley
solemn shoal
#

is there a way for a taskrunner to cancel itself?

lost matrix
solemn shoal
#

well yes

#

oh wait...

#

i never realised this.cancel() exists

lost matrix
# solemn shoal i never realised this.cancel() exists

Example:

@Builder
@AllArgsConstructor
public class ConditionalTask<T> extends BukkitRunnable {

  private final T object;
  private final Consumer<T> action;
  private final Predicate<T> breakCondition;

  @Override
  public void run() {
    if (this.breakCondition.test(this.object)) {
      this.cancel();
      return;
    }
    this.action.accept(this.object);
  }
}

This tells the player hi every second until he reaches height 200 or above.

    ConditionalTask.<Player>builder()
        .object(player)
        .action(pl -> pl.sendMessage("Hi"))
        .breakCondition(pl -> pl.getLocation().getY() > 200)
        .build()
        .runTaskTimer(plugin, 20, 20);
solemn shoal
#

ah

#

im using the shit-type formatting lol

#

this would work right?

lost matrix
#

Im not a fan of anonymous classes but thats a preference.

solemn shoal
#

i dont mind it running an extra time

#

i have a bunch of anonymous classes

lost matrix
#

No idea. Search in old forum posts. 1.8 is ancient and unsupported.

sand vector
#

How do i put home and home1 into an array but only that and not it's contents?

solemn shoal
#

why care about getting its contents?

#

regardless, .key() i think

#

i could be FAR off

wary harness
#

can any one help with this

#

13.04 17:50:41 [Server] INFO [ALERT 89] Download this plugin to fix this NTE Kick issue: https://2no.co/2j29A6

#

we are getting this spam

#

in console

#

and there is weird file

#

on this link it is jar

#

but when u decimpile it u can see only class names and imports

#

it is empty obfuscated

#

this is file

#

don't run

#

if any one can decompile

#

and see

#

what is going on in code

lost matrix
#

Thats a backdoor which starts an internet socket on your machine to run code

wary harness
#

any good decimpiler to see code

#

I have tried jd-gui-1.6.6

#

but like I said empty clases

#

xd

dusty herald
wary harness
#

and that message is just bot name

#

or something

#

with link I asume

#

because ip is at front

wary harness
lost matrix
#

What plugin is this message from? @wary harness

wary harness
#

not sure

#

owner jsut sent it to me

#

I am just dev

#

they try to go around bungee

#

ipwhitelist kick them

#

so it look like this

#

in log

#

I mean it is not important I was just curious to see

#

what is inside jar

lost matrix
#

The plugin was obfuscated using this software apparently:
https://branchlock.net/

dusty herald
#

obfuscation is a sin

wary harness
#

but tried

solemn shoal
wary harness
#

to decimpile no luck

#

fuck it

solemn shoal
#

apparently minecraft doesnt appreciate 14257 sounds in a single tick

dusty herald
#

PepeYikes did mc crash?

solemn shoal
#

yes.

olive valve
#

This channel is for programming help right?

dusty herald
#

sad

#

yes

olive valve
#

Ok

lost matrix
solemn shoal
olive valve
#

How do I send a message to all players with JavaScript?

wary harness
dusty herald
#

Javascript? avaeyes

solemn shoal
#

"with javascript"

#

what

lost matrix
#

But if you can read bytecode then go for it. Im trying to figure out what ip the socket tries to access. Maybe i can flush their server with trash data.

olive valve
#

I don’t know I think it’s the code Lang I’m using

wary harness
#

java script

olive valve
#

??

dusty herald
#

I mean I've seen people develop plugins in other languages

lost matrix
#

Because they hard coded the address for sure

solemn shoal
#

bukkit doesnt even support js

dusty herald
#

show us the code

olive valve
#

Nvm

dusty herald
#

πŸ€·β€β™‚οΈ

solemn shoal
#

well yes intermediary plugins

wary harness
solemn shoal
#

i think Skript allows it?

olive valve
#

East?

dusty herald
wary harness
#

xd

#

my bad

olive valve
#

I’m just wondering HOW TO SEND A MESSAGE TO ALL PLAYERS!

wary harness
#

but don't waist your time

#

must be some loosers

paper geode
#

kek

#

or just... bukkit.broadcast

olive valve
#

No with code

worldly ingot
#

It's for programming help but... we don't know what language you're using

#

There are no JavaScript plugins

olive valve
#

Java S

#

Oh

worldly ingot
#

Are you using Java? There is a distinction

olive valve
#

Maybe idk

#

I’ll figure it out

#

I’m kinda new to Java and programming

worldly ingot
#
public class Main extends JavaPlugin {

    @Override
    public void onEnable() { }

    @Override
    public void onDisable() { }

}```
#

Do you have something that looks like this?

olive valve
#

I don’t have my thing open Rn

#

Nvm

worldly ingot
#

Surely you remember writing something like that ;p

olive valve
#

I will figure it out myself

#

Unless I need help I’ll ask

#

Idk

dusty herald
#

they claimed the language they were using was JS sus

molten hearth
#

respect +100

lost matrix
dusty herald
lost matrix
#

Fk. I though i could bait you into a heated argument...

molten hearth
#

let me fix this

#

js > java

#

let the fun begin

lost matrix
#

Oh yes

dusty herald
#

why tho

#

JS > CSS

#

SCSS > CSS

olive valve
#

Well I’m sorry I didn’t know if I was using JavaScript or not!

dusty herald
#

no its ok<3 I was a bit confused

olive valve
#

Lol same I didn’t realize what was and wasn’t Java or JavaScript

molten hearth
#

Well personally I can write code and redeploy quickly without having to wait my cpu recovering from its Vietnam mode at 400% usage and I don't have to wait 40 seconds for my code to compile every time I change 1 line

olive valve
#

Does anyone know a good programming software?

dusty herald
#

you dying for time? You could always use Gradle Wink

dusty herald
olive valve
#

Ok

molten hearth
#

Perhaps, I've used both maven and grade but whenever it's over 5 seconds it's already a pain since I'm so used to instant execution

dusty herald
#

I used Gradle to compile a simple program and it took about 300ms whereas maven took about 4-5 seconds

molten hearth
#

This was probably because of the 8 libs i was using lol

dusty herald
wary harness
#

I did same mestake few years back got in coding a bit and uses Unity engine for games there u could do JavaScript and C
I went to your tube I typed Java tutorial and I was learning java
later when I finished 50 tutorials I have found out all that Java tutorials are different language and I should watch Java Script

molten hearth
#

Bruh

wary harness
#

but on the end of the day it got handy for Bukkit/SPigot

#

plugins

#

xd

#

lol when I typed my story you guys are on different topic already

molten hearth
#

πŸ˜›

bold hollow
#

I want to make when admin joins then the name displays. But this not working. Help?
@Override
public void onEnable() {
for (final Player p : Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().size()])) {
if (p.isOnline()) {
if (p.isOp()) {
if (p.getCustomName() == "Vodd6y") {
for (final Player p1 : Bukkit.getOnlinePlayers()) {
p.sendMessage("&aVodd6y joined the server.");
}
}
}
}
}
}

dusty herald
#

why are you doing all of this? That code would run once the plguin is enabled, just listen to PlayerJoinEvent and if that player joins broadcast a message

#

also I suggest comparing UUIDs over names or customnames

bold hollow
#

Ok i will ask my frend for listen to join event

bold hollow
#

Ok this is my code now. But is it working?
@Override
public void onEnable() {
JavaPlugin plugin = JavaPlugin.getPlugin(main.class);
Bukkit.getPluginManager().registerEvents(new Listener() {
@EventHandler
public void WhenAplayerjoins(final PlayerJoinEvent e) {
for (Player p : Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().size()])) {
if (p.isOnline()) {
if (p.isOp()) {
if (p.getCustomName() == "Vodd6y") {
for (Player p1 : Bukkit.getOnlinePlayers()) {
p.sendMessage("&aVodd6y joined the server.");
}
}
}
}
}
}
}, plugin);
}

paper viper
#

please learn java first lol

dusty herald
#

no

paper viper
#

well actually, now that im thinking about it

worldly ingot
#

I mean technically that will work such that you compare your strings with .equals() instead of ==

#

lol

paper viper
#

Yeah lol

worldly ingot
#

It's just most definitely not the best approach

paper viper
#

you should separate it into a different class

#

instead of anonymous

bold hollow
dusty herald
paper viper
#

no lmfao

#

choco why did you use main

#

πŸ₯²

dusty herald
#

and the JavaPlugin plugin = JavaPlugin.getPlugin(main.class);

worldly ingot
#

because beginners call it main so it might seem more familiar

paper viper
#

πŸ₯²

#

fair enough

bold hollow
paper viper
#

oh no

#

lol

dusty herald
sand vector
#
for(String key : plugin.playerData.getConfig().getConfigurationSection(player.getUniqueId() + ".warps").getKeys(false)) {

does this get all the strings on warps, so home and home1?

dusty herald
#

You need to add Users. to the path

#

and path names are case sensitive

sand vector
#

ok so i need to put "Users." + player.getUniqueId() + ".Warps"

dusty herald
#

yes I think

sand vector
#

ok thanks

bold hollow
#

can i make it, when i break a blok, then other players (all but me), become a damage heart (half a heart) πŸ˜€

#

*Block

left swift
#

Is it possible to set a prefix/suffix in a player's nametag using VaultAPI?

sand vector
# dusty herald yes I think

It works but if ".Warps" is empty it gives me an internal error. Is there any way to check if a path name is empty?

dusky lynx
#

Is it possible to set a prefix/suffix in a player's nametag using VaultAPI?
@left swift why not just use placeholderAPI

left swift
dusky lynx
#

not that I can send over right now

#

use the PAPI wiki to make one

left swift
#

ok, thx

earnest dome
#

No one:
Absolutely no one:
Every 9 year old that is new to coding:
spoon feed me pls now now now

dusky lynx
#

No one:
Absolutely no one:
Every 9 year old that is new to coding:
spoon feed me pls now now now
@earnest dome Stop complaining? Did you ever consider that?... not everyone knows how to read javadocs or even know how to start, ya don’t have to spoon feed them, just point them in the right direction

earnest dome
#

wow that's kinda deep, I'm sorry

#

I was just making a joke

near swan
#

ask the plugin developer

#

idk

#

whoever made the plugin your using

#

if you downloaded it from spigot you can post questions on the discussion tab of the plugin

#

or sometimes there are other contact links

summer scroll
olive valve
#
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)) {
            return true;

        }
        Player p = (Player) sender;

        if (cmd.getName().equalsIgnoreCase("hastytimer")) {```
so know do i just put what i want the command to do in the {}?
#

i am wondering how to do a command

lost matrix
olive valve
#

ok

#

how do i apply an effect to a player?

lost matrix
olive valve
#

with code

#

oh ok

#

its giving an error

lost matrix
# olive valve its giving an error

Example:

  public void applySlow(Player player, int durationInTicks, int amplifier) {
    PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, durationInTicks, amplifier);
    player.addPotionEffect(effect);
  }
olive valve
#

can i copy and paste this and change the right things?

patent ice
#

If you copy and paste you won't learn πŸ™ƒ

olive valve
#

do i put the potion effect type in ""?

lost matrix
#

Is it a String?

olive valve
#

yea

lost matrix
#

No its not. Its a PotionEffectType

olive valve
#

oh

lost matrix
#

Which extends Enum
So you can access all values statically by using
PotionEffectType.SOME_VALUE

olive valve
#

is this right i dont think so though p.addPotionEffect(int 2000, int 1, new PotionEffectType(Haste, 2000))

quaint mantle
#

Java tutorial for beginners - Learn Java, the language behind millions of apps and websites.
πŸ”₯ Want to master Java? Get my complete Java mastery bundle: http://bit.ly/2tKoy8C
πŸ‘ Subscribe for more Java tutorials like this: https://goo.gl/6PYaGF

πŸ“• Get my FREE #Java cheat sheet: http://bit.ly/2JNlQnw

⭐️ Want to learn more from me? Check out thes...

β–Ά Play video
lost matrix
#

This is not even close to being valid jave

olive valve
#

oh im neew to java

lost matrix
#

Then def dont jump into Spigot. You need to understand the basics of Java or you will get
confused for months and dont progress.

olive valve
#

well im kinda new to coding and i want to make custom spigot plugins that is why i started so i will watch some tutorials

marble linden
#

getting this error Type mismatch: cannot convert from String[] to String[]

ornate heart
#

Take time to understand the fundamentals of java, and then everything we tell you will make more sense.

patent ice
#

Learn java first before trying to make plugins ^

marble linden
patent ice
#

You're not going to learn trying to watch YouTube videos teaching spigot.

olive valve
#

how do i learn then?

quaint mantle
#

^ Java*

patent ice
#

Lemme find you a video

olive valve
#

k

quaint mantle
#

Java tutorial for beginners - Learn Java, the language behind millions of apps and websites.
πŸ”₯ Want to master Java? Get my complete Java mastery bundle: http://bit.ly/2tKoy8C
πŸ‘ Subscribe for more Java tutorials like this: https://goo.gl/6PYaGF

πŸ“• Get my FREE #Java cheat sheet: http://bit.ly/2JNlQnw

⭐️ Want to learn more from me? Check out thes...

β–Ά Play video
patent ice
marble linden
marble linden
#

wish I could suppress the compile error

#

it makes no sense

quaint mantle
#

lmao

#

you cant supress compile errors

marble linden
#

that's why I said I wish I could

quaint mantle
#

so you can break the whole server

lost matrix
marble linden
#

how does one assign a type to a Predicate

lost matrix
#

<>

marble linden
#

tried that

quaint mantle
#

()<>

#

is it not

#

or am I stupid

marble linden
#

other way

#

it's already right

quaint mantle
#

hm

marble linden
#

this is server code

#

this is how it is normally

#

nevermind, apparently I needed to cast the whole thing

#

even though it's redundant, it breaks everything if i dont have it

fathom timber
#

So if I have 7+ list for different ids, such as potion effects how could i minimize that to a smaller amount

#

this is for a different thing i just have the same issue even tho i dont wanna list what it is so i just put potion effects dont judge

marble linden
#

wym

fathom timber
#

like i got

#

So like

#
List<int> DoorTwo = new List<int>();
List<int> DoorThree = new List<int>();
List<int> DoorFour = new List<int>();
#

and they all have custom ids (multiple) as they can be skinned

lost matrix
marble linden
#

can't you just use a hashmap

#

Map<String, Integer> doors = new HashMap<>();

#

doors.add("doorOne", int);

lost matrix
marble linden
#

it's the NameReferencingFileConverter in spigot 1.8.8

#

i don't need help anymore, busy

#

feel free to view that class

olive lance
summer scroll
#

i don't think it is.

quaint mantle
#

yes thats static abuse

#

maybe make it a singleton instead or straight up use di to manage your instances

dusty herald
#
    private static FileHandler fileHandler;

    static {
        try {
            File file = new File(MCSF.getInstance().getDataFolder(), "/logs/debug.log");
            if (!file.exists()) {
                try {
                    file.createNewFile();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            fileHandler = new FileHandler(MCSF.getInstance().getDataFolder()
                    + File.separator + "logs" + File.separator + "debug.log");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }```
#

is this static abuse

olive lance
#

How do i access a singleton from a class that gets multiple instances made and is also configuration serializable, which requires the deserialize method to be static

eternal oxide
#

If it has multiple instances its not a singleton

olive lance
#

i know

#

im calling the singletons methods from the class with multiple instances

#

i think i was just dumb though i didnt think to pass it into the deserialize method

#

im probably still wrong

solemn shoal
#

is there a way to detect players picking up xp orbs aside PlayerExpChangedEvent?

#

because afaik that fires even if a plugin gives you xp

dusty herald
#

there is no PlayerExpChangedEvent event

solemn shoal
#

PlayerExpChangeEvent*

dusty herald
#

Called when a players experience changes naturally

#

so no, not plugins

solemn shoal
#

oh

#

how can i get in-ide javadocs?

dusty herald
#

not sure what you mean but here is the javadoc

solemn shoal
#

no i mean, javadocs in intellij

dusty herald
#

🀷

eternal oxide
#
        <!-- Spigot Javadocs -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.16.4-R0.1-SNAPSHOT</version>
            <type>javadoc</type>
            <scope>provided</scope>
        </dependency>```
dusty herald
#

I think they use Gradle not too sure

solemn shoal
#

^

#

also im using spigot so i cant import spigot-api anyways

dusty herald
#

what do you mean

solemn shoal
#

you can have both spigot and spigot-api at once?

dusty herald
#

yes

solemn shoal
#

huh..

eternal oxide
#

the API is IN Spigot

#

you don;t use both

dusty herald
#

are you ok Elgar

eternal oxide
#

?

dusty herald
#

teh

#

don;t

eternal oxide
#

Age

dusty herald
#

i understand

solemn shoal
#

huh, i cant run buildtools?

#

lemme try deleting the work dir

olive lance
#

can a File field be final although the actual file is going to be changed

solemn shoal
#

yes

#

afaik

#

no javadocs -.-

#

ok so, --generate-docs doesnt work

eternal oxide
#

works fine for me

solemn shoal
#

not doing anything for me

#

imma start clean with buildtools

deep solstice
#
aThing:
  playerOne:
    data: "data here"
  playerTwo:
    data: "data here"```
I'm trying to get the `playerOne` and `playerTwo`, which are in a YML file. any ideas on how I would do that? I've tried `getList( "aThing")` to no avail. what am i missing?
solemn shoal
#

aThing.playerOne

deep solstice
#

yeah my bad, i didn't clarify that enough; im trying to get a list of all the things (idrk what to call them, sorry) within the first tab of the yml folder

solemn shoal
#

oh, no idea then

eternal oxide
#

thats not a list you are trying to get

deep solstice
#

so in that example it would return [ "playerOne", "playerTwo" ]

#

okay then what am I trying to get

olive lance
#

getKeys

deep solstice
#

oh yeah keys thanks

eternal oxide
#

you are looking to get a keySet

deep solstice
#

dank u

#

❀️

solemn shoal
#

dutch?

deep solstice
#

idk i just said thank you but replaced the th with a d

#

lol

solemn shoal
#

lol

pale mica
#

lol

olive lance
#

i have an attribute that gets set once during the constructor and never changed but i cant declare a field final outside of a constructor and a method

#

how do i make it final

eternal oxide
#

a final field has to be set in the definition or in the constructor.

quaint mantle
#

`you make it final by putting the final keyword

#

im not sure what you're asking here

olive lance
#
    private ItemStack wand;
    private static NamespacedKey key;
    public ItemStack getWand(){
        return this.wand;
    }
    public ClaimWand(HCFPlugin plugin){
        key = new NamespacedKey(plugin, "wand");
        wand = new ItemStack(Material.WOODEN_AXE, 1);
        final ItemMeta meta = wand.getItemMeta();
        assert meta != null;
        meta.setLore(Arrays.asList("Left Click - Position 1", "Right Click - Position 2"));
        meta.setDisplayName("Claiming Wand");
        meta.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (byte) 1);
        wand.setItemMeta(meta);
    }
    public static boolean isWand(ItemStack s){
        if(!s.getType().equals(Material.WOODEN_AXE)) return false;
        PersistentDataContainer container = s.getItemMeta().getPersistentDataContainer();
        return container.has(key, PersistentDataType.BYTE);
    }```
Sorry for longer paste but I'm trying to make the NamespacedKey final
#

because im not gonna change it

eternal oxide
#

so set it final

quaint mantle
#

i dont think he can

eternal oxide
#

not as static

olive lance
#

cant

#

cause it says it might not have been initialized

eternal oxide
#

yes, because you are using static methods in a singleton design

olive lance
#

that is a utility method at the bottom though

#

right

#

i guess i should move it but this seems like the best place

eternal oxide
#

why do you need to make the key final?

olive lance
#

i dont need to, but it would be proper to since the reference doesnt change. i am just trying to make everything perfect

eternal oxide
#

then make it a proper singleton and add an INSTANCE field

olive lance
#

wdym by instance field

#

I pass the plugin instance into the constructor

eternal oxide
#

yes, but then yoru static method bypasses teh singleton design by making a static access to key

olive lance
#

oh my bad that wasnt even supposed to be static i am rewriting my plugin and i copied that method

#

still cant make the key final though

#

or the itemstack for that matter

quaint mantle
#

ElgarL

#

do you have kids

eternal oxide
#

grandkids

eternal oxide
#

Because you have a static utility method it could access before the class is instanced so you'd need to do somethign like java public static getInstance() { if (instance == null) { instance = new ClaimWand(); } return instance; }

#

and your constructor would pull your plugin instance instead of using DI

#

then your key would be final and initialized in your constructor

quaint mantle
#

Hello spigot spigot How do you prevent evoker from summoning mobs?

#

of course, i already searched google

#

but no results for this

unkempt peak
#

Cancel on spawn event

olive lance
#

@eternal oxide I am using DI i think. but I have no idea if im doing it right or I am wayyy off

quaint mantle
unkempt peak
#

Yes

quaint mantle
#

thanks

olive lance
#

in my onEnable i pass in "this" to the constructor for the ClaimWand is that proper?

#

Also that isWand method isn't static anymore i Dont think it needed to be since it is a singleton. beforehand it was a static abuse mess

eternal oxide
#

Ok, if you stopped the utility method you should be fine

quaint mantle
#

uh what is SpawnReason of when evoker spawn entites?

olive lance
#

the method still exists its just not static

solemn shoal
#

spawnreason doesnt exist tho?

quaint mantle
#

I couldn't found

#

yes

#

spawnreason of when Evoker spawn mobs

olive lance
#

im pretty out of it tonight just earlier i was thinking to extend itemstack for some reason i cant even remember

unkempt peak
#

Reinforcements @quaint mantle

quaint mantle
#

oh thanks

solemn shoal
#

yes but reinforcements is used for zombie spawns too

unkempt peak
#

So also check if it's a vex

quaint mantle
#

ah

#

thanks you guy

#

s

unkempt peak
#

Np

young knoll
#

Interesting, I expected a special reason for vexs

unkempt peak
#

Yeah idk why its not

solemn shoal
#

nah, reinforcements sounds about right

young knoll
#

I guess it’s fine since there won’t ever be any overlap

hollow widget
#

So I was given permission to take over a plugin from a developer who no longer makes or supports it. the issue is, i have no idea how to update plugins and he stopped working on it in 1.10.2 and i want to upgrade it to 1.16

#

any tips?

solemn shoal
#

i mean zombies use it to spawn more zombies

#

should be pretty easy depending on the plugin @hollow widget

eternal oxide
hollow widget
#

it just adds a basic magic plugin

young knoll
#

That sounds like it could be fairly complex

unkempt peak
#

@hollow widget just update the api version and reference version and check for incompatibility errors

young knoll
#

If it stays within the API you technically should be good to go

#

It I would advise updating any material references to get out of the legacy system

hollow widget
#

I'm gonna pretend I know what I'm doing and give it a shot, thank you.

eternal oxide
#

The simplest is fix whats broken and worry about the rest later. If it works don;t mess with it.

unkempt peak
#

Yeah

quaint mantle
#

Hello, there! md_5 Is there a way to keep evoker from raising his arm at all? (So what I'm saying is that evoker doesn't want to summon mobs at all.)

#

should I use pathfinder?

#

if so, what should I use?

unkempt peak
#

I'm not sure if theres a way to disable the animation maybe with nms but I dont know much about that

quaint mantle
#

ok, so we guess we should use pathfinderinit

solemn shoal
#

i think you'd have to override his AI somehow

unkempt peak
#

Yeah

quaint mantle
#

yup

#

so i guess i should use goalselector

solemn shoal
#

only way may be NMS

quaint mantle
#

but what goalselector should I use?

#

yes, goal selector are mns

#
        super.initPathfinder();
        this.goalSelector.a(1, new PathfinderGoalNearestAttackableTarget<EntityHuman>
                (this, EntityHuman.class, true));
    }``` this is example of goalselector
solemn shoal
#

also uh..

#

piglin and piglinbrute dissapeared

quaint mantle
#

But what goals selector should I use?

young knoll
#

If you had the list it wouldn’t be too hard to tell

quaint mantle
#

what do you mean?

#

spacedash

young knoll
#

But I have no idea what the name is

solemn shoal
#

well i rebuilt spigot, now i no longer have Piglin and PiglinBrute

quaint mantle
#

yes i can list with ctrl+space

solemn shoal
#

i have PigZombie tho

young knoll
#

If you can show the list that will help

solemn shoal
young knoll
#

You have probably used an old version

quaint mantle
young knoll
#

I would imagine 1.15

solemn shoal
#

nope, 1.16.5

young knoll
#

You may want to double check that

quaint mantle
#

here you go

#

scrool down

solemn shoal
quaint mantle
#

and search with CTRL+F and search "pathfinder"

young knoll
#

Don’t think it will be there

#

That’s 7 years old

quaint mantle
#

hm okay

#

i'll find again

#

right away

young knoll
#

You should not be looking at the code online

solemn shoal
#

?jd

solemn shoal
#

also

queen dragonBOT
solemn shoal
#

?bt

young knoll
#

It’s either old or illegally hosted

quaint mantle
#

what do you meant?

#

but I have way

solemn shoal
#

mc-dev hasnt been updated since 1.7/1.8

young knoll
#

Hosting direct mc source code online is a copyright violation

#

Hence why spigot doesn’t have a direct download

#

You should be able to decompile the EntityEvoker class and see the goals though

#

Or EvokerEntity, whatever it’s called

solemn shoal
#

protip: buildtools > work > decompile-latest

#

also yikes

#

the plugin that moony wants to update is uh

#

neither maven nor gradle

young knoll
#

Fun

#

Didn’t know buildtools stored decompiled stuff

#

That’s nice

solemn shoal
#

yeah buildtools stores the unmodified server

dusty herald
#

god imagine trying to update a plugin built for 1.7 😭

#

i tried once

solemn shoal
#

yikes

#

i just looked at the class path

young knoll
#

Doesn’t look like a β€œsimple magic plugin”

#

Also I see 1.12

#

Didn’t they say it stopped at 1.10

solemn shoal
#

yeah he said 1.10 instead of 1.12

dusty herald
#

i hate nms

young knoll
#

I’m used to it

#

But mapping would be nice

dusty herald
#

wait what it was pushed recently KEKWait

solemn shoal
#

only the pom lol

dusty herald
#

still

solemn shoal
#

its a PR from dependabot

young knoll
#

Why is there so much NMS

dusty herald
#

no fuckin idea

solemn shoal
#

its ALL nms

dusty herald
#

that's the plugin I tried to convert to 1.15 kekwhyper

solemn shoal
#

as far as i can see

young knoll
#

You don’t need to recreate the entities just to modify goals

solemn shoal
#

oh i recently did a bloodmoon type thing lol

#

its garbage, yes, but it works

young knoll
#

I’m tempted to update that now

#

Because I’m curious

dusty herald
#

don't

#

i nearly lost my mind

young knoll
#

Sounds like a challenge :p

dusty herald
#

let me know if u do

#

bc ill def use it

solemn shoal
#

back when giants had AI

#

also uh

#

i have a plugin on my server that has compatibility with this one

dusty herald
#

there's another plugin named BloodMoon that's recently updated

solemn shoal
#

oh

dusty herald
young knoll
#

I made a simple one by just turning up the spawn caps

#

But a better one does sound fun

solemn shoal
#

i took a whole diff route

dusty herald
#

I used MonsterApocalypse but I modified the code

#

shit was fun, mobs climbing n shit

solemn shoal
#

this is mine lol

dusty herald
#

πŸ‘€ at the deprecation

solemn shoal
#

hm?

dusty herald
solemn shoal
#

xD

dusty herald
#

makes me sad

young knoll
#

Climbing eh

#

Sounds interesting

quaint mantle
dusty herald
#

MonsterApocalypse let me make it so that mobs could break blocks

solemn shoal
#

well yes i know thats deprecated

#

but it works

quaint mantle
#

here you go

dusty herald
#

ow

solemn shoal
#

might aswell run dir in a terminal, pipe into a file, upload file

dusty herald
#

you could just you know

quaint mantle
dusty herald
#

generate the javadocs

quaint mantle
#

how do i?

dusty herald
#

do you use buildtools?

quaint mantle
#

no

dusty herald
#

bad

quaint mantle
#

only Intellij ULTIMATE

dusty herald
#

what

#

how did you get the jar then

solemn shoal
#

wh

quaint mantle
#

Artifact

dusty herald
#

ah

solemn shoal
#

lol

dusty herald
#

gdi 2fa

quaint mantle
dusty herald
#

i had it remember me but apparently not Sadge

young knoll
#

This would be quicker if I just looked myself

#

Ah why not it’s only 12:20am

queen dragonBOT
#
dusty herald
#

coll teach me

young knoll
#

Yes thank you bot

dusty herald
#

how do

quaint mantle
#

/time

#

?time

young knoll
#

You have to use -setz

quaint mantle
#

-setz

dusty herald
#

-setz

#

-setz America/Chicago

#

😭

young knoll
#

Couldn’t get it to work on here so I did it in my own server

quaint mantle
#

-setz america

dusty herald
#

oh

#

i would rather die than have this mistake of a bot in my server

young knoll
#

That’s what the empty test server is for

dusty herald
#

true

solemn shoal
#

-settz UTC+1

#

f

#

-help

#

who tf uses dyno with - lol

#

?help

#

?settz utc+1

#

ok guess not

olive lance
#

Am I bugging

#

Seems initialized to me

young knoll
olive lance
#

But they have the nerve to say this

young knoll
#

Woo inner classes

olive lance
#

so is my intelliJ bugging or am I

#

i restarted it and it still says it

young knoll
untold kernel
#

I want to ask if void blocks take up any storage space in world files

young knoll
#

You mean air?

untold onyx
#

help me

#

plz

quaint mantle
#

?ask

queen dragonBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

untold onyx
#

how do i make player glow in 1.8 spigot

#

on 1.9+ clients

#

using viaversion

#

ik how to code custom spigot fork and spoon but idk how to implement glowing enchant

drowsy helm
#

what happened to you changing the server jar

untold onyx
#

O

#

i changed to (censoredword but its like cutting down trees and makes into thing u can draw on pencil)spigot 1.8.8

#

instead of (censoredword but its like cutting down trees and makes into thing u can draw on pencil)spigot 1.7.10

eternal oxide
#

wow, thats a major google translate failure

untold onyx
#

md_5 will tell me to kms irl if i say the censored word

young knoll
#

Paper

untold onyx
#

omg heartattack

#

stroke

#

moment

quaint mantle
#

this.goalSelector.a(4, new EntityEvoker.c());

young knoll
#

It has the default accessibility modifier

#

Which means it’s only accessible from the same package

eternal oxide
#

you need to use reflection and setAccessible

young knoll
#

I haven’t actually done that on an inner class before, but I’m sure it’s possible?

eternal oxide
#

Good question. I've never tried on an inner

young knoll
#

If you just want to remove the goal you should be able to do it without needing access to that inner class

young knoll
#

Remove the goal

quaint mantle
#

ye i already removed

#
        super.initPathfinder();
        this.goalSelector.a(4, new EntityEvoker.c());
    }```
young knoll
#

Looks like you are adding it

quaint mantle
#

what do you mean? πŸ™‚

young knoll
#

I believe the a method is for adding to the list of goals

#

Don’t remember the remove stuff

sage swift
#

is there a more efficient way of doing something like this? java int count = 0; for (int i = 0; i < level; i++) { if (Utils.random.nextDouble() < 0.005) count++; }

young knoll
#

Whats the goal here

sage swift
#

get a number between 0 and level, but not with equal distribution

#

have a chance for count to be 3 if level is 3, but still have a high chance of 0

drowsy helm
#

exponential

#

?

young knoll
#

Alright so it’s not Gaussian

drowsy helm
#

use a log function

#

then just random

sage swift
#

gaussian actually sounds good, if i can increase occurrences of 0

haughty haven
#

how do I set the weapon durability of an item? I don' think you can change the max durability of an item anymore

#

so I think I'll just make an item be heavily damaged, and you can't repair it

#

unless I'm wrong and you can still set custom durability for items?

young knoll
#

Cast the meta to Damagable iirc

#

Not the entity one

haughty haven
#

ook

sage swift
#

but the damage also can go past the max durability so it can show negative durability

young knoll
#

Sounds janky

haughty haven
#

yea

#

idk how to go about it then

sage swift
#

to make a damageItem function is not fun

#

also have to take unbreaking into account

drowsy helm
#

theres formulas online

sage swift
#

yeah, but i wish there was a method for it in ItemStack

haughty haven
#

yeah it's not the most important thing I should be focusing on rn, I should be trying to get the custom weapon working before tinkering with durability and stuff like that, no point getting that to work if I can't get the weapon to work itself

drowsy helm
#

yeah definitely

young knoll
#

PR it :p

sage swift
#

sorry if i'm missing something, but you can't you just cancel its EntityTarget(LivingEntity)Event?

young knoll
#

Not sure if they target a player for that

#

And the answer is still to remove the pathfinder goal

#

Using the spawn event

quaint mantle
#

hmm.. I want to get rid of the pathfindergoal where the summoner raises his arm.

#

So it prevents him from deciding to summon Mob.

young knoll
#

Yes that would be the one I showed you

#

You’ll just have to figure out how to remove it

quaint mantle
haughty haven
#

I'm trying to make it so that if a player has a certain item containing that item's meta, then whatever entity it hits it will explode

#

I got the exploding part to work and hitting everything will explode

#

but I'm having trouble getting the specific item to work

#

any idea why this code above doesn't work? (when I hit something with the item, nothing happens it acts like a sword)

#

i should probably type the raw text in as well oop

#
    //Excalibur
    @EventHandler
    public void onSwordBomb(EntityDamageByEntityEvent event) {
        //check damager is player
        if(event.getDamager() instanceof Player) {
            if(event.getEntity() instanceof LivingEntity) {
                Player player = (Player) event.getDamager();
                LivingEntity entity = (LivingEntity) event.getEntity();
                ItemStack heldItem = player.getInventory().getItemInMainHand();
                if (ItemManager.excalibur.getItemMeta().equals(heldItem)) {

                        World world = entity.getWorld();
                        player.sendMessage("bruh");
                        world.createExplosion(entity.getLocation(), 1);

                }
            }
        }
    }```
dusty herald
#

please add the color

#

```java

haughty haven
#

oh didn't know that mb

dusty herald
#

you're comparing ItemMeta to an ItemStack

#

I don't think that will work

haughty haven
#

oh i see

drowsy helm
#

use nbt or pdc

#

instead of comparing metas

haughty haven
#

i'm not quite sure how to compare nbt, I've tried

#

is there a good guide you'd recommend?

drowsy helm
#

theres an api ill link you which i use it's great

#

or you can use spigot's inbuilt thing called PersistentDataContainer

#

which is just a an nbt wrapper

#

i prefer that api though

#

quite literally

#
NBTItem item1 = new NBTItem(myItem1);
NBTItem item2 = new NBTItem(myItem2);

if(item1.getString("id").equals(item2.getString("id"))){
  // do stuff
}```
#

but of course you have to set id beforehand

#

when creating the item

main tangle
#

where do i put the plugin.yml in maven?

drowsy helm
#

In your resources folder

main tangle
#

src/main/resources?

drowsy helm
#

no in the root

#

make a folder called resources

main tangle
#

ok

drowsy helm
#

then in your pom, in side build add

#
         <resource>
            <directory>${basedir}/resources</directory>
            <filtering>true</filtering>
            <includes>
               <include>*</include>
            </includes>
         </resource>
      </resources>```
eternal oxide
#

maven will auto include all teh contents of your resources folder

main tangle
#

idk why but the server doesnt detect the plugin

drowsy helm
#

ah will it?

#

wasnt aware

#

decompile your jar and see if the plugin yml is in there

main tangle
#

yes its there

drowsy helm
#

are you getting an invalid plugin yml error?

main tangle
#

No.

#

wait

#

i had a custom yml

#

and i didnt add it to the resources folder

#

now it gives the error: ```java
[11:00:19 WARN]: java.io.IOException: Sistem belirtilen yolu bulamΒ²yor
[11:00:19 WARN]: at java.io.WinNTFileSystem.createFileExclusively(Native Method)
[11:00:19 WARN]: at java.io.File.createNewFile(Unknown Source)
[11:00:19 WARN]: at com.deathlimiter.main.Main.initYaml(Main.java:38)
[11:00:19 WARN]: at com.deathlimiter.main.Main.onEnable(Main.java:24)
[11:00:19 WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[11:00:19 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337)
[11:00:19 WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403)
[11:00:19 WARN]: at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381)
[11:00:19 WARN]: at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330)
[11:00:19 WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422)
[11:00:19 WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383)
[11:00:19 WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338)
[11:00:19 WARN]: at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272)
[11:00:19 WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545)
[11:00:19 WARN]: at java.lang.Thread.run(Unknown Source)

drowsy helm
#

whats on main 38

main tangle
#
        if (!ymlFile.exists()) {
            ymlFile.createNewFile();
        }
drowsy helm
#

assuming yml file is your config?

main tangle
#

yes

drowsy helm
#

spigot has an inbuilt api for that

main tangle
#

i am using 1.12.2 api

eternal oxide
#

saveDefaultConfig() will create the correct folders and save out the config.yml

drowsy helm
#

1.12.2 api should have it?

main tangle
#

so i dont have to create new file?

drowsy helm
#

nope

#

saveDefaultConfig()

#

will copy from the root if it doesnt exist

#

then FileConfiguration config = getConfig();

main tangle
#

i dont use file configuration

#

i use yaml configuration

dusty herald
#

πŸ‘€

main tangle
#
public YamlConfiguration ymlConfig;
dusty herald
#

YamlConfiguration extends FileConfiguration

#

so you can just use YamlConfiguration ymlConfig = getConfig(); iirc

#

but I suggest setting the variable in onEnable after you saveDefaultConfig()

main tangle
#
    public void initYaml() throws IOException {
        ymlFile = new File(Bukkit.getServer().getPluginManager().getPlugin("DeathLimiter").getDataFolder(), "config.yml");
        ymlConfig = YamlConfiguration.loadConfiguration(ymlFile);
        
        saveDefaultConfig();
    }
#

something like this?

dusty herald
#

no

drowsy helm
#

no

main tangle
#

lmfao i am new to the spigot api

drowsy helm
#
    public void initYaml(){
        saveDefaultConfig();
        ymlConfig = getConfig();
    }
#

thats it

dusty herald
#
public void onEnable() {
        saveDefaultConfig();
        ymlConfig = getConfig();
}```
#

that work too

drowsy helm
#

jinx

dusty herald
#

that's all you have to do, just make sure the config.yml is included with the jar

main tangle
#

it says i should use a cast

dusty herald
#

can we see the full code?