#help-development

1 messages · Page 227 of 1

trim lake
#

Ok gona try

dusk flicker
#

this

#

?google

undone axleBOT
dusk flicker
#

lol

undone axleBOT
dusk flicker
#

?yahoo

undone axleBOT
undone kernel
#

so I have this code

    public static ItemStack sword;

    public static void init() {
        ultimateSword();
    }

    public static void ultimateSword() {
        ItemStack ultimateSword = new ItemStack(Material.DIAMOND_SWORD, 1);
        ItemMeta meta = ultimateSword.getItemMeta();
        meta.setDisplayName("§4§kscary§1Ultimate Sword§4§kscary");
        meta.addEnchant(Enchantment.DAMAGE_ALL, 10, false);
        meta.addEnchant(Enchantment.KNOCKBACK, 10, false);
        meta.addEnchant(Enchantment.FIRE_ASPECT, 10, false);
        meta.addEnchant(Enchantment.DURABILITY, 10, false);
        ultimateSword.setItemMeta(meta);
        sword = ultimateSword;
    }```
but when I get the item there are no enchants
dusk flicker
#

that code scares me

undone kernel
#

are you talking to me

dusk flicker
#

i think this might be a learnjava moment

#

?learnjava

undone axleBOT
undone kernel
#

i've done it with true but it still dosen't work

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

undone kernel
#

no console errors

#

it just don't work

dire salmon
#

"does not working" duke

undone kernel
#

uh how

dusk flicker
#

?learnspigot

#

sad

dire salmon
#

lol

undone kernel
#

hmm

#

I get a error

undone axleBOT
undone kernel
#

Cannot resolve method "addenchant" in "itemstack"

#

nvm i'm dumb

#

alr alr it's addEnchantment

#

ok great now it won't give me the item and they're no errors

round finch
#

?sql

undone kernel
#

which static

#

i got like 5

#
    public static void ultimateSword() {
``` imma remove this one
#

nvm that broke my whole code

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

        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&4You can't do this!"));
        } else {
            Player p = (Player) sender;
            p.getInventory().addItem(ItemManager.sword);
        }

        return true;
    }```
round finch
dire salmon
#

dont cast sender to player

#

someone told me its not good

undone kernel
dire salmon
#

actualy nvm

undone kernel
#

yeah bs

dire salmon
#

yea i read it wrong lol

round finch
#

that sounds dumb

undone axleBOT
round finch
#

cus player can be a sender

undone kernel
#

tf does that have to do with anything

dire salmon
#

guess

undone kernel
#
    @Override
    public void onEnable() {
        // Plugin startup logic
        ItemManager.init();
        this.getServer().getPluginManager().registerEvents(new ItemEvents(), this);
        this.getCommand("ms").setExecutor(new MS());
        this.getCommand("ue").setExecutor(new UnEnchant());
        this.getCommand("sword").setExecutor(new GetItem());
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }```
#

to late

dire salmon
#

entire

undone axleBOT
undone kernel
#
public class ItemManager {

    public static ItemStack sword;

    public static void init() {
        ultimateSword();
    }

    public static void ultimateSword() {
        ItemStack ultimateSword = new ItemStack(Material.DIAMOND_SWORD, 1);
        ItemMeta meta = ultimateSword.getItemMeta();
        meta.setDisplayName("§4§kscary§1Ultimate Sword§4§kscary");
        ultimateSword.addEnchantment(Enchantment.DAMAGE_ALL, 10);
        ultimateSword.addEnchantment(Enchantment.KNOCKBACK, 10);
        ultimateSword.addEnchantment(Enchantment.FIRE_ASPECT, 10);
        ultimateSword.addEnchantment(Enchantment.DURABILITY, 10);
        ultimateSword.setItemMeta(meta);
        sword = ultimateSword;
    }
}```
#

that's it other than imports

undone axleBOT
undone kernel
#

no

#

nope

round finch
#

ye

undone kernel
#

i can ask for help

dire salmon
#

^^

undone kernel
#

bc it's just this one small thing

dire salmon
#

yea

undone kernel
#

the literal only thing that didn't work was enchants

#

it works completely fine other than that

round finch
#

copy and pasting so many times

#

is bad programming practice

undone kernel
#

i gotta change it if I want enchants tho

#

but that's the only part that don't work

round finch
#

it will be a problem later, if the person is not acknowledging the issue

dire salmon
#

^

undone kernel
# dire salmon ^
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player p = (Player) sender;
            if (sender.hasPermission("eagle.multisummon")) {
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0].toUpperCase());
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            p.getWorld().spawnEntity(p.getLocation(), entity);
                        }
                        p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
                    } catch (IllegalArgumentException e) {
                        p.sendMessage(colorize("&4This is not an entity."));
                    }
                } else {
                    p.sendMessage(colorize("&4/multisummon [mob] [amount]."));
                }
            } else {
                p.sendMessage(colorize("&4You don't have permission to do this!"));
            }
        } else {
            sender.sendMessage(colorize("&4You cannot do this. "));
        }
        return true;
    }``` 
here I made this just for you
undone axleBOT
round finch
#

💀 ignorance lol

undone kernel
#

@last temple so changing the meta.addEnchant to this

        ultimateSword.setItemMeta(meta);
        ultimateSword.addEnchantment(Enchantment.DAMAGE_ALL, 10);
        ultimateSword.addEnchantment(Enchantment.KNOCKBACK, 10);
        ultimateSword.addEnchantment(Enchantment.FIRE_ASPECT, 10);
        ultimateSword.addEnchantment(Enchantment.DURABILITY, 10);

broke it and now it won't give me the sword

#

i f I r e m o v e s t a t i c m y c o d e b r e a k s

round finch
#

please use

#

?paste

undone axleBOT
round finch
#

it is pain to read

#

and help

dire salmon
#

LMAOOO

dire salmon
round finch
#

is that the person's link?

undone kernel
#

damn u guys are just rude i just needed help with one things

dire salmon
#

^

round finch
echo basalt
round finch
#

Thanks i hate that code

dire salmon
#

"if it works dont touch it"

echo basalt
round finch
#

then you break one thing

undone axleBOT
quaint mantle
round finch
#

hell...

quaint mantle
#

can i get help :/

round finch
#

asking people for help

#

not listening to help

dire salmon
undone axleBOT
#

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

a try to get a GUI

echo basalt
#

I just died a little

quaint mantle
#

But i can move items :/

rough drift
#
public MyPlugin() {
    super();
    // Initialize final variables
}
```can you do this?
round finch
#

autocorrect sorry

echo basalt
#

But like

cyan trout
#

How can i bypass this ?

rough drift
#

All of this time I could use final?

#

BRUH

dire salmon
#

probs that

round finch
#

yes please

tardy delta
#

ItemMeta#setLore goes brr

solid skiff
#
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            player.sendMessage("§6§lCraftyStudios §7§l» §f§lRunning on version 1.0");
            return false;
        }
        return false;```

my code, but it is returning /craftycore when I run it...
tardy delta
#

whats a craftycore

solid skiff
#

when I run /craftycore ingame it is supposed to say waatever is above, but it says /craftycore instead of whatever its supposed to say

round finch
#

plugin version?

solid skiff
#

no when I run the command it says craftycore, also literatly none of my commands are working, they are not red in the tab complete and I registered them but it says unknown command

round finch
#

register your commands

solid skiff
round finch
#

gud!

#

implements CommandExecutor?

solid skiff
#

yes

#

/craftycore:reload is not working either

#
getCommand("CraftyCoreCommand").setExecutor(new CraftyCoreCommand(this));``` the `(this));` is broken saying expected 0 args but found 1
#

remove what

#

ok fixed

round finch
#
(Plugin Instance) <--
.getCommand("YourCommand
").setExecutor(new YourCommandClass())
flint pine
#

Guys, Why when I cancel player movement when player is on a horse, it just push him out of the horse?

solid skiff
#
getCommand("Spawn").setExecutor(new Spawn(this));```
ok this one wants me to have a `this`, whats the deal with that
#

yea but im registering the command like any other ones, its probally fine but i am confused

nova prism
#

That object will have different constructor parameters

solid skiff
#

ok

echo basalt
#

Oh god it's des

round finch
sterile token
solid skiff
#

ok

round finch
#

is it possible to completely avoid static?

nova prism
humble tulip
reef acorn
#

I'm trying to code a scoreboard system with config, but the scoreboard won't update because I don't know how to do it. I've already looked at many forums that have worked with teams, but as soon as I tried, there were only errors. Could you please help me out? Pls ping me, if you answer me.```java
public void setScoreboard(Player p){
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective obj = board.registerNewObjective("karakigames","dummy");

    obj.setDisplaySlot(DisplaySlot.SIDEBAR);
    obj.setDisplayName(main.getInstance().getScoreConfig().getDisplayName());



    for (int i=0; i<main.getInstance().getScoreConfig().getScore(p).size(); i++){
        obj.getScore(main.getInstance().getScoreConfig().getScore(p).get(i)).setScore(i);
    }


    p.setScoreboard(board);
}
round finch
real palm
#

I guess I can gift that question to the trash can, but I only see examples for Plugin Messaging Channels BungeeCord -> Spigot but none in vice-versa.
Is it possible to send a plugin message to BungeeCord so my Discord Bot running on it can execute its job?

In my example -> Player has done an advancement -> send plugin message to bungeecord which process it and send a message to the channel "Player achieved advancement xyz".

round finch
#

i were thinking of arraylist

#

i know static methods

#

lol

#

pass Main class to Math Class
you mean like that?

#

hmm nice

#

but what about static lists and memory?

real palm
sullen marlin
#

theyre just regular channels

#

register ingoing/outgoing using the messenger service and then send

#

its exactly the same either way

solid skiff
#

im trying to make a sethome system, is there a way to create a file in /homes directory with their uuid storing their info and tping to it when they run /home (home)

round finch
#

sql SobbWhy

solid skiff
round finch
#

no my reaction to what i'm doing

solid skiff
#

i need folder, wouldnt that be easiest to get values

solid skiff
round finch
#

sql

#

trying to figure it out thb

solid skiff
#

oh thats why i hate sql

round finch
#

all that string work

#

maybe i should have used api

solid skiff
#

that or I can make a chonky config

#

do yk how to generate a file and get values from it

#

beacuse all ik is getConfig

#

idk how to specify data.yml or smth

sullen marlin
#

?config

#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

solid skiff
#

ty

solid skiff
sullen marlin
#

yes

solid skiff
round finch
#

short!

sullen marlin
#

yes

solid skiff
#

ok

quaint mantle
#

if(cur == Material.DIRT) return;
if(cur == Material.GOLD_BLOCK) return;

No alternative :/

#

?

sullen marlin
#

or? switch?

round finch
#

yo md_5 any sql tutorials?

sullen marlin
#

?sql

#

?mysql

#

idk

worldly ingot
#

Nooo switches on Material PandaSpooky Remember a couple months ago!?

solid skiff
# sullen marlin yes
int x = getConfig().getDouble("<uuid>.x");
int y = getConfig().getDouble("<uuid>.y");
int z = getConfig().getDouble("<uuid>.z");
World w = plugin.getServer().getWorld(getConfig().getString("<uuid>.world"));
Location home= new home(w,x,y,z);

if I were to do something like this, would there be a way to set a string before <uuid> to the home name (/home <name>) so the string will save as <home><uuid><x>

sullen marlin
#

uuid + ".x"

#

also you can use getLocation to save/get location directly

#

part of config class

solid skiff
# sullen marlin part of config class

right, but i need this to save for one to data.yml and before the <uuid> to be the home value, because I want them to be able to set more than 1 home

quaint mantle
#

if(cur.getType() == Material.GOLD_BLOCK) return;

nice

round finch
quaint mantle
#

It won't happen

round finch
#

better then writing

if(cur == Material.DIRT) x 100 times with different Materials

glossy venture
#

can i create a world asynchronously using WorldCreator?

#

because when i try to do it sync it almost crashes the server

river oracle
#

no

#

You could always write an entirely new world creation system though

glossy venture
#

is getResource() broken or something

opal juniper
opal juniper
#

why?

glossy venture
#

ive tried with plugin.getClass().getResourceAsStream(...) too

#

but thats probably due to class loading with bukkit

opal juniper
#

does it need to be relative

#

i forget

glossy venture
#

relative?

opal juniper
#

./

glossy venture
#

you mean no / at the start

#

no thats for file system right

#

this is in the jar

opal juniper
glossy venture
#

im used to it needing a / at the start

#

thats required with getResourceAsStream i think

#

officially day 2 of coding this shit

#

oh removing the / worked lol

flint pine
#

Hey guys, Is there a packet sent when player leave house client side? Cause there is bug when PlayerMoveEvent is cancelled when player is on a horse or so, and it kick the player when you cancel the event only on client side

atomic swift
#

is there something like Material.ARMOR or something that can check if an item is armor

quaint mantle
#

how i place a head in my Gui :/ Material.Player_Head don't existe ..

remote swallow
#

there should be

quaint oriole
#

Hello, anytime I open an GUI where player heads are inside, the player heads just load really slow. It takes approx. 2 secs till the heads are loaded. Anyone know how to reduce the loading time?

quaint mantle
#

PLAYER_HEAD don't exist in java 8

echo copper
#

I'm getting an error trying to use maven to shade external libraries into my plugin. For some reason, the spigot server doesnt load resources from the plugin jar (the third party libraries load data from resources in the plugins jar, but spigot looks for it in the server.jar so returns a "not found exception")

I can remedy it by renaming my plugin file to plugin.zip, extracting the resources and all the library files that is packaged into it from the maven shade and putting them into server.jar but that seems more like a hack than a solution

quaint oriole
quaint mantle
#

oh SKULL work but how i set the owner :/

#

k

#

sry but how xD

atomic swift
#

how can i change a blocks strength/hardness depending on the nbt

#

so you can only do that with blocks themselves

solid skiff
quaint mantle
#

idk but after its broke "Player p = (Player) sender;" and "if(sender instanceof Player) {"

remote swallow
#

remove the Player p = .. and add change the instanceof Player to instanceof Player player now you can use the player var if its a player

#

might fix one

remote swallow
#

ah java 8

solid skiff
#

newer api best

quaint mantle
solid skiff
#

how would I store values from an argument to a new file. I also need to check if they exist once they run the command to tp back to their home

#

[19:06:08] [Server thread/ERROR]: Error occurred while enabling CraftyCore v${version} (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.craftystudios.craftycore.getCommand(String)" is null
at org.craftystudios.craftycore.onEnable(craftycore.java:44) ~[CraftyCore-1.1-PRE.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
even better

#

oh im stupid

#

is there a way to add all commands into plugin.yml? like isnt it /<command>

remote swallow
#
commands:
  cmd1:
  cmd2:
remote swallow
solid skiff
remote swallow
#

you have to do them all manually

solid skiff
#

isnt there something like /<command>

river oracle
#

why do people even use the plugin.yml for commands its so annoying

remote swallow
#

like i say about 5 messages ago, you can put that in the usage but you cannot put the commands in plugin.yml automatically

river oracle
#

don't bother with the plugin.yml

remote swallow
#

do you just add the commands to the command map

river oracle
#

yea

#

its easy as fuck and so much less of a hastle

#

?paste

undone axleBOT
river oracle
#

but this is a gist and its much easier you just need to extend the BukkitCommand class

#

usually I just make some simple functions on top of it to make it nice and easy

river oracle
river oracle
#

just put it in a Utility class if you have one otherwise main class works fine

#

than you use that to register your command make sure you don't do anything with commands in the plugin.yml

quaint mantle
solid skiff
#

or should I make a util class

river oracle
solid skiff
river oracle
#

yea, you still would need to extend the BukkitCommand class and make something yourself for that though

#

atleast iirc its been a while since I've used anything, but my own

river oracle
#

this is my old one

solid skiff
#

anyway one question, I have people type in a home name for /sethome, but I need to store their 1) home name in a seperate homes.yml file and then I need to 2) check if it exists to tp the player to the home

quaint mantle
river oracle
#

no

#

I'm not going to help you

#

first off explain your problem then someone might want to help you

#

your just posting code who tf knows whats wrong

tall dragon
river oracle
#

just do getStringList or whatever than teleport them

solid skiff
river oracle
solid skiff
#

also idk if your thing is going to work with my plugin because it has 30 errors lol

solid skiff
river oracle
#

I just gave you an outline of what needs to be done

#

the rest is up to you

orchid gazelle
#

I would recommend learning java before writing minecraft plugins.

river oracle
#

I think its fine if your able to figure shit out on your own if you need pushes in the right direction, incbom is clearly not completely lost

solid skiff
#

^ ik a bit

orchid gazelle
#

Yeah but it is kind of essential to have some knowledge about speficic things like saving data

river oracle
#

I've never had a large java project outside of Spigot and never independently learned java than spi got

#

I learned java alongside spigot, while I don't necessarily reccomend this its something to keep yourself interested

orchid gazelle
#

It will take a lot more time

solid skiff
river oracle
river oracle
#

FileConfiguration#set

#

than you need to save

orchid gazelle
solid skiff
river oracle
#

if you don't save the data stays only in memory

tall dragon
#

yaml for data storage PepeLaugh

river oracle
#

I learned google

orchid gazelle
#

That does not work for most people

solid skiff
orchid gazelle
#

If you know how to google you are gucci with simple plugin dev

orchid gazelle
tall dragon
solid skiff
quaint mantle
solid skiff
orchid gazelle
solid skiff
#

other than formating and some other junk idc about

tall dragon
orchid gazelle
#

That is not a good mind

remote swallow
river oracle
orchid gazelle
#

Sticking to things and not caring is very bad

river oracle
#

whats happening versus whats intended

orchid gazelle
#

Sooner or later, you will see why

river oracle
buoyant violet
#

guys can i use == as an equal?

quaint mantle
tall dragon
buoyant violet
#

or i need to put equal()

river oracle
#

?basics

undone axleBOT
river oracle
#

?google

undone axleBOT
buoyant violet
#

ye i am just learning

#

i am doing if statements

river oracle
#

there are a trillion stack overflow threads explaining that

buoyant violet
#

so

orchid gazelle
tall dragon
#

like it is exactly the same instance of the class

solid skiff
river oracle
solid skiff
#

^^

buoyant violet
#

if (q1 == "animal" && q2 == "no")

#

can i do that?

orchid gazelle
tall dragon
#

use #equals on Strings

buoyant violet
#

ty

orchid gazelle
buoyant violet
#

then how can i modify it

tall dragon
#

== is usefull to compare enums mostly

#

and numbers

river oracle
#

its a hobby

#

its about having fun and staying interested

buoyant violet
#

i need to do this?
if (q1 #equals "animal" && q2 #equals "no")

river oracle
#

as long as you don't go out selling your shitty code

buoyant violet
tall dragon
#

if(q1.equals("animal"))

buoyant violet
#

ty

#

ty

orchid gazelle
#

If it should be case independent, use equalsIgnoreCase

buoyant violet
#

if (q1.equals("animal") && q2.equals("no"))

#

its right?

tall dragon
#

should work

orchid gazelle
buoyant violet
#

ok ok ty epic

solid skiff
#

above that:

public File folder = plugin.getDataFolder();
    public File file = new File("homes.yml");
    public static YamlConfiguration homes = new YamlConfiguration();


onEnable():```java
if(!folder.exists()) {
folder.mkdir();
}

    if(!file.exists()) {
        file.mkdir
    }
    homes.load(file);

}```

is this a way to create a new file?

river oracle
#

yea thats prey much it

#

accept

tall dragon
#

that file wont be in the plugin folder 😄

river oracle
#

you'd create your homes file like
File file = new File(folder, "homes.yml");
^ this ensures its in the plugins folder

#

first argument is the folder

solid skiff
#

also accept lots of errors

river oracle
#

no

#

its folder,

#

its an argument in File's Constructor

orchid gazelle
#

Both works but it looks ugly imo lol

solid skiff
#

public File folder = plugin.getDataFolder(); "could not resolve symbol plugin"

orchid gazelle
#

Now this hurts

solid skiff
river oracle
#

should read this, but your main class is plugin

vital yacht
#

You can do Plugin#getDataFolder.toPath().resolve(fileName);

tall dragon
#

yea path api is very nice

river oracle
#

facts

tall dragon
#

personally do it like this ussually

    public static void createFileIfNotExists(Path path) throws IOException {
        if (!Files.exists(path)) {
            if (!Files.exists(path.getParent())) {
                Files.createDirectory(path.getParent());
            }
            Files.createFile(path);
        }
    }
river oracle
#

even though I barely use it lmao

solid skiff
orchid gazelle
#

Ofc it does

solid skiff
#

or anything of the sort with that

river oracle
#

plugin isn't a variable defined

solid skiff
#

but im in main class

buoyant violet
#

@tall dragon my code works ty again

orchid gazelle
#

Yes but you have not defined the plugin as a variable

orchid gazelle
#

So you cannot use a variable called plugin if you have not defined it

vital yacht
river oracle
#

the object required is JavaPlugin your main class extends JavaPlugin the article sent explains what that means in particular

#

not with spigot, but in general java terms which can then be applied

solid skiff
river oracle
#

you don't need to define it because this is a JavaPlugin or Plugin

vital yacht
orchid gazelle
#

Should define the var for future uses tho

vital yacht
#

Not really

vital yacht
#

Yes

orchid gazelle
#

It is very common to get used, so that should be done

solid skiff
#

mkdir also cannot be defined

#

if(!file.exists()) {
file.mkdir
}

vital yacht
orchid gazelle
#

file.mkdir()

vital yacht
solid skiff
#

k

orchid gazelle
#

Or is it?

#

ah it is file

solid skiff
#

try {
homes.load(file);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InvalidConfigurationException e) {
throw new RuntimeException(e);
}

}

would this be loading it?

ivory sleet
#

I mean File::mkdir creates the file as a directory

solid skiff
#

because it was an error plainlybut adding that seems to fix it

ivory sleet
#

you probably want to do it on the parent file if its a config file (which is presumably a directory)?

vital yacht
#

Conclure you’re upside down

ivory sleet
#

am I?

#

oh yea

orchid gazelle
vital yacht
#

You in Australia?

ivory sleet
#

no just up late

solid skiff
#

how would i prevent the error message saying i need a class or an interface at the end

ivory sleet
#

Incbom, how does your current code look like?

glad prawn
#

He always ask 💀

solid skiff
#

?paste

undone axleBOT
ivory sleet
glad prawn
#

Not u

solid skiff
#

also this is probally not the discord to ask but my sentry.io intergation is not working, the import is wrong

ivory sleet
#
file.mkdir();

Instead of this, you probably want to call file.createNewFile();

tall dragon
#

probably? 😄

ivory sleet
#

since the former creates a directory/folder and not a file with the given file name

orchid gazelle
#

(mkdir written out means: make directory)

#

Damn I would love to continue coding rn but im sick as shit lol

quaint mantle
solid skiff
ivory sleet
#

To begin with, yes (:

vital yacht
ivory sleet
#

^ there’s no notion of a skull owner regarding glass pane items

solid skiff
quaint mantle
#

i don't changed STAINED_GLASS_PANE to SKULL ........

#

3h for this

vital yacht
ivory sleet
#

🥲

solid skiff
#

or not

#

i love intellij idea's visual stuff

solid skiff
quaint mantle
#

bruh my skull is called "Your head'sCraftPlayer{name=Appolon_}

#

with no texture .

vital yacht
#

Use Player#getName

vital yacht
quaint mantle
#

thx now i have a good name but not a good texture xD

HeadGMS.setOwner("Appolon_"); just don't work :/

remote swallow
#

skullmeta.setOwner

quaint mantle
#

don't work :/

remote swallow
#

send the code

#

?paste

undone axleBOT
quaint mantle
remote swallow
#

your setting the meta twice

#
        SkullMeta HeadGMS = (SkullMeta) HeadG.getItemMeta();
        HeadGMS.setOwner("Appolon_");
        HeadGMS.setDisplayName("Your head's " + p.getDisplayName() +" ");
        HeadG.setItemMeta(HeadGMS);
wary topaz
#

How can I load a custom YML file and edit it?

remote swallow
wary topaz
#

thanks

#

i was looking for that lol

wet breach
wary topaz
#

I already did it.

wet breach
#

however thing is, you need to maintain a reference to it otherwise you will get the wrong reference to such and encounter NPE's

solid skiff
#

plugin.getCustomConfig().getString("<uuid>.x"); using this string, how would i specify the customconfig is homes.yml

trim creek
#

Execuse me wtf

22: server = new File(Bukkit.getPluginManager().getPlugin("MobArena").getDataFolder() + "/server.yml");
26: server.createNewFile();

Console: java.io.IOException: The system cannot find the path specified (error at line 26)

#

fullcode:

public static void setupFiles() {
        server = new File(Bukkit.getPluginManager().getPlugin("MobArena").getDataFolder() + "/server.yml");
        users = new File(Bukkit.getPluginManager().getPlugin("MobArena").getDataFolder() + "/users.yml");
        if (!server.exists()) {
            try {
                server.createNewFile();
                users.createNewFile();
                serverFile = YamlConfiguration.loadConfiguration(server);
                usersFile = YamlConfiguration.loadConfiguration(users);
                server().set("Game.State", "WAITING");
                server().set("Game.Mode", "Normal");
                server().set("Game.Players", 0);
                server().set("Game.MaxPlayers", 24);
                server().set("Game.MinPlayers", 16);
                server().set("Game.InGame.Players", 0);
                server().set("Game.InGame.Wave", 0);
                server().set("Game.InGame.MaxWaves", 100);
                save();
                reload();
            } catch(IOException e) {
                e.printStackTrace();
            }
        }
        serverFile = YamlConfiguration.loadConfiguration(server);
        usersFile = YamlConfiguration.loadConfiguration(users);
    }
#

'k i fixed it by making new folder lmao

dry forum
#

how would i run a console command on a specific server w/ bungeecord

undone kernel
undone kernel
undone kernel
tulip nimbus
#

10000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId()))

#

Presumably

undone kernel
undone kernel
#
            if (e.getItem().getItemMeta().equals(itemManager.ultimateSword().getItemMeta())) {
                if (!cooldown.containsKey(p.getUniqueId()) || System.currentTimeMillis() - cooldown.get(p.getUniqueId()) > 10000) {
                    cooldown.put(p.getUniqueId(), System.currentTimeMillis());
                    p.sendMessage(colorize("&aYou've used the Ultimate Ability!"));
                    p.getWorld().createExplosion(p.getLocation(), 15f);
                } else {
                    p.sendMessage("You can't use this for another " + (10000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId())) / 1000) + " seconds!");
                }
            }```
undone kernel
#

I can dm you it if you want

tulip nimbus
undone kernel
#

alr thanks

winged anvil
#

is the nms source code good, like how well is minecraft written

undone kernel
winged anvil
#

exactly what i said

river oracle
#

No ones stopping you

#

If you feel mojangs code is so bad you'd be unwilling to use it there are an array of other projects trying to make minecraft servers better performance

winged anvil
#

who said it was bad

#

i asked if it was written well

#

looking for others opinions

river oracle
#

Good enough

winged anvil
#

ok

#

i appreciate you sharing

vocal cloud
#

Define well written? Optimized? I mean it's seasoned java engineers so I imagine it's okay. Plenty of community optimizations make it seem like there are areas to work on.

flint pine
#

Guys, is there a way to cancel PlayerMoveEvent without it kicking the player from a vehicle (Client Side)?

vocal cloud
#

check if they're on a vehicle?

flint pine
#

I do

#

There is a problem with that

#

Because I want to cancel the event but they just get kicked (client side) from the vehicle

vocal cloud
#

Why not just freeze the entity they're riding in place?

quaint mantle
#

Hello! I'm new in java, I'm following a tutorial on youtube about passing the plugin instance to another class. I made a getter to access it from my other classes (https://prnt.sc/SuIayrxwQGla) but It's not working for some reason (https://prnt.sc/jefZbNATv5Sx), I also searched google but didnt found anything I was looking for.

flint pine
vocal cloud
#

Try declaring a variable and assigning it that value.

quaint mantle
vocal cloud
#

I'm pretty sure the error is because you're calling a method in your class file which you cannot do

quaint mantle
vocal cloud
#

A YT tutorial?

quaint mantle
#

yeah, about passing the plugin instance

vocal cloud
#

that's your problem

#

?di

undone axleBOT
quaint mantle
#

Okay, I'll research about it some more

vocal cloud
quaint mantle
vocal cloud
#

you should be able to send it here

quaint mantle
#

No I was asking because theres a certain rules in some server xD thats why

vocal cloud
#

Holy crap a 9m video for a 2m concept

quaint mantle
#

I'm actually a js developer so I get confused when someone says Variables lol

#

and I'm very new to java still learning

vocal cloud
#

Sadly you had to learn from Kody sadge

quaint mantle
#

No other series exists

#

Btw since you saw it, I did the same thing as he did with static getter method

vocal cloud
quaint mantle
#

ah.. yeah thats confusing XD

vocal cloud
#

It'll take some getting used to.

#

Careful with Kody tutorials. I've heard a lot of bad practice exists within them.

chrome beacon
#

Spigot youtube videos always have bad practices

quaint mantle
#

But I have no idea where I can get a headstart so I'm just watching the topics I'm confused about. I just download public plugins and read their decompiled code

vocal cloud
#

Jumping headfirst into plugin development is generally rough because the tutorials don't teach you how to apply your learning they show you a very linear example.

quaint mantle
#

yeah

#

so any suggestion about how can I pass the instance so I can use it in my other classes? Just tell me the way I can do it, You dont need to spoonfeed me XD

#

figuring it out myself would be best because I'll learn it in a way

chrome beacon
#

?di

undone axleBOT
vocal cloud
#

?di is probably the best tutorial atm. I've been working on my own text based tutorials. Still a heavy WiP

undone axleBOT
quaint mantle
#

Offtopic: I cant change my spigotmc username?

vocal cloud
#

Not unless you pay.

quaint mantle
#

where do I pay?

vocal cloud
#

Idk tbh never considered it.

chrome beacon
#

?changename

undone axleBOT
#

Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.

chrome beacon
#

10$ I believe

quaint mantle
#

uh okay, I don't really need it. Its just I changed my ign thats why

vocal cloud
#

The biggest problem I have with Kody is so many of his videos are things you should know how to do without his help. He never teaches how to learn by yourself just looking at the titles. Maybe he does but it doesn't seem like it from his titles

chrome beacon
#

Yeah many videos are just spoon feeding code

quaint mantle
#

I'm not a pro but I'm decent

vocal cloud
#

Yeah, Kody isn't teaching java from what I've watched. It's a lot of follow along stuff but not teaching what you need to survive

quaint mantle
#

yeah thats true

chrome beacon
#

You don't have to pay there are plenty of free guides

quaint mantle
#

In the course we had given assignments every few days

vocal cloud
#

I learned java from scratch by trying to build applications I did in other languages. Same way I've been learning Rust

#

Lots of text tutorials

quaint mantle
#

ah, I was basically a web developer

#

Worked with React

vocal cloud
#

Learn concepts not how to make a fly plugin.

quaint mantle
#

but its really hard to survive in that market

chrome beacon
#

I recently started using Vue. I found it much easier to work with than react

quaint mantle
#

ah

vocal cloud
#

The best place for info on spigot stuff is the docs

#

?jd-s

undone axleBOT
vocal cloud
#

Learn to read this and you'll be less likely to ever need to ask a question

quaint mantle
#

🫡

vocal cloud
#

That's late game usually

#

It is indeed

icy beacon
#

hey, I recently added MockBukkit tests to my plugin, but now I get this error in my kotlin file, what do I do?

#

i am sure that this is due to mockbukkit (removing it fixes the error)

#

and well

remote swallow
#

to me that looks as if your checking if XMaterial is equal to Material

icy beacon
#

nope, I parse the material at the end of the evaluation

#

and this is irrelevant to the error anyway

#

just to clarify, this method works perfectly, but mockbukkit seems to do some dependency conflicts

cyan trout
#

How can I do a players NameTag invisible ?

glossy venture
#

how can i send a message as another player

#

from code

#

nvm i think i found it

#

Player#chat(String)

#

hope that works with formatting and shit

remote swallow
#

iirc it does

glossy venture
#

why is it not excluding the fastutil

#

ive tried with the dependency too

#

instead of the package

remote swallow
#

doesnt the exclude need to be on the real dependency

glossy venture
#

didnt work either

#

oh wait maybe i need to do /**

#

YES

#

it worked

#

now my jar isnt 25 fucking megabytes anymore lmao

remote swallow
#

add minimize() on shadow jar

glossy venture
#

i got it

#

needed to do /**

#

for it to exclude

glossy venture
#

it took like 30 seconds to upload through FTP every time lol

dim palm
glossy venture
#

or like 20

#

idk

dim palm
#

bro wtf

#

i took like 10m to upload 20mb

glossy venture
#

bruh wtf thats like 100 kb/s or smth

#

bro

#

thats 33 kb/s

#

it builds so much faster as well

#

holy shit

#

reobfJar had to go through 25 mbevery time

#

makes sense why it took like 20 secs now

icy beacon
#

hey, I recently added MockBukkit tests to my plugin, but now I get this error in my kotlin file, what do I do?

tardy delta
#

an XMaterial cannot equals a Material?

icy beacon
#

.parseMaterial

#

the function worked perfectly, but I now added MockBukkit and now there's an IDE error

#

I've done research and none of the solution worked for me

torn shuttle
#

the more time goes forward the more I feel like I'm working backwards

#

I'm now adding cuboids to my plugin, it's weird to add such a basic shape after all these years of making this plugin

tardy delta
#

worst tabcomplete i wrote in history

remote swallow
#

what the fuck

#
  • what the fuck
#
  • what the fuck
tardy delta
#

always review your old plugins lmao

white dew
#

Hi, I have a class in my program that only has static methods

#

the class is not meant to be instantiated

#

how can I force this?

#

Like, make so you cannot instantiate It?

#

I heard you could declare the class as private

#

but won't this make all my methods private?

round finch
tardy delta
white dew
#

oooooh, thats right

#

awesome

#

thanks

round finch
#

Inventory
getDestination()
Gets the Inventory that the ItemStack is being put into

quaint mantle
#

Hi how i can clear the chat of my player :/

tardy delta
#

i seem to have fucked some things up

#

oh right when i reset my server it doesnt reset the mongodb cluster

#

wondering if its possible to store my mongodb data locally

solid skiff
#

plugin.getCustomConfig().getString("<uuid>.x"); using this string, how would i specify the customconfig is homes.yml

remote swallow
#

more specially

private void createCustomConfig() {
        customConfigFile = new File(getDataFolder(), "custom.yml");
        if (!customConfigFile.exists()) {
            customConfigFile.getParentFile().mkdirs();
            saveResource("custom.yml", false);
         }

        customConfig = new YamlConfiguration();
        try {
            customConfig.load(customConfigFile);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
        /* User Edit:
            Instead of the above Try/Catch, you can also use
            YamlConfiguration.loadConfiguration(customConfigFile)
        */
    }
solid skiff
remote swallow
#

im gonna say "custom.yml" to "homes.yml"

#

would make it read homes.yml

solid skiff
#

Ok Ty

tardy delta
#

why not YamlConfiguration.loadConfiguration(customConfigFile)

round finch
tardy delta
#

best fix

wet breach
#

not sure on what the difference would be except maybe preference

#

well, in that case they are free to use what they deem fitting and not what you prefer o.O

tardy delta
#

conclure does :: too uwu

#

and ye its just preference

#

need a new fancy color to display instead of this

round finch
#

you could use packet to change title, making it blink different colors

tardy delta
#

just looking for a static hex color ig

remote swallow
#

#733bfb

round finch
#

color picker

remote swallow
#

colour picker is okay

round finch
#

i have a program on my pc where i can pick any color on my screen

tardy delta
#

hmm i forgot but how can i cancel clicks which move an item from the player inv to the top inv?

#

got this rn

#

ig put the event.setCancelled in front of the guiitem

round finch
#

basic

#

literally just a doc search

#

😆

#

you welcome

rough drift
#

:: is a shorter way of world -> world.getUid()

#

It os perfectly fine

hybrid spoke
tardy delta
#

bruh im trying everything to disable those useless mongodb logs but nothing seems to be working

#

Level.OFF doesnt work either

round finch
#

how can i use sql in a simple way?
i only know java

opal juniper
round finch
late sonnet
opal juniper
round finch
#

i have been studying a bit of sql

#

but still confused

opal juniper
#

on which bit

tardy delta
opal juniper
#

inserting? Deleting?

#

Reading?

tardy delta
#

im disabling the logging right before i instantiate anyy mongodb thing

opal juniper
#

read the description LOL

#

hahaha

late sonnet
#

XD

tardy delta
#

lmfao

opal juniper
#

try SEVERE

late sonnet
#

@tardy deltaand with logback? not the best option....

tardy delta
#

severe has the same spam

#

oh no xml files

round finch
#

from what i'm getting

FROM
SELECT
IS NOT NULL
INSERT
WHERE

tardy delta
#

from select is not null

#

👍

opal juniper
#

i mean yeah

#

SELECT * FROM whatever WHERE whatever

round finch
#

all that string confusion

tardy delta
opal juniper
#

INSERT INTO whatever (columns..) VALUES (values..)

tardy delta
#

check w3schools :)

opal juniper
#
opal juniper
#

yeah ahhaha

#

just use sqlite 😎

tardy delta
#

aaaa

#

sqlite doesnt have native uuid support :(

opal juniper
#

so? just do UUID#toString lul

tardy delta
#

nah BLOB

#

and some bytebuffer magic

late sonnet
#

and postgress (?

tardy delta
#

only used postgres for college

#

dunno why we are using it anyways

round finch
#

i gotta figure out that table stuff

late sonnet
tardy delta
#

PGobject

late sonnet
#

in this time.. i dont check again.. but works then..

tardy delta
#

XD

civic wind
#

Anyone have any idea why it's not letting me open other gui on click?

tardy delta
#

dont you have to close the current one first?

#

or delay it by one tick?

civic wind
#

Already tried that

kind hatch
#

No, you can open inventories while in another inventory, Even though the docs say it's not recommend, it will work just fine.

civic wind
#

So why isn't it working?

#

It's blagging my head

kind hatch
#

In your config, does that path have a color coded string?

tardy delta
#

see if the code is ran

#

probably dont compare inventories by name too

kind hatch
tardy delta
#

and itemmeta strings

civic wind
civic wind
kind hatch
#

For testing purposes yes, it will work.

#

However, you should consider a better approach before you publish it.

#

You should put some debug messages in your code to see if your if statements are even being reached.

civic wind
#

I am trying debugs now

#

Ah yeah gets stuck at t3

#

Is there anything wrong with the if statement to get the config?

tardy delta
#

ChatColor.stripColor is a thing too

kind hatch
#

Your path is wrong. You need to have a path of ArmorSets.inventory.items.<ITEM NUMBER>.name

civic wind
#

ahh kk

jovial grotto
#

Hey so I am trying to make https://github.com/Chopkeys/FreezeGUI compatible with 1.16.5 onwards (As I originally made it in 1.16.5), I have looked up a bunch of stuff but nothing is clear and concise and makes sense. Is there any pages anyone knows of or any tutorials that will make more sense?

kind hatch
# civic wind ahh kk

As for improving your code. I'd recommend two things.
1st: Switching your item name checks to PDC checks.
The PDC was introduced in 1.14. It gives you unparalleled flexibility with your GUIs. You don't have to check for slot numbers, you don't have to worry about outdated tags, you don't have to rely on item names, it's all treated as nbt data. You'll be able to put the items anywhere in the GUI and have the click events work the same regardless of slot number. It's a worthwhile upgrade.

2nd: Comparing inventory instances instead of inventory names.
This is to prevent people from renaming items with color codes and getting access to your inventories. Plenty of exploits exist rely on developers to compare names instead of instances.

robust sinew
#

if I put a block on a players head with curse of binding, they'll still be able to take it off right? as in the curse won't do anything?

#

how would I make the player unable to remove the block from their head?

#

just cancel the event when they take it off?

kind hatch
jovial grotto
#

Hmmm ok, so I tried running it on a 1.17 server and the commands didn't come up, any ideas?

late sonnet
river oracle
kind hatch
jovial grotto
kind hatch
#

Well that would def be a problem. lol

river oracle
#

yea that'd be it

#

make sure its in there

jovial grotto
#

lmao

kind hatch
#

What are you using to compile? Maven I presume?

river oracle
#
       <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
#

he has the resources folder, however just make sure your compiling with maven

#

not your IDE as it ignores maven completely

jovial grotto
#

I may have moved around the yml on accident

#

let me check

civic wind
#

How to add enchants to config for items in gui anyone?

jovial grotto
#

Lmaoo

river oracle
#

error?

#

?paste

undone axleBOT
jovial grotto
#

Am I missing something it was just working

river oracle
#

gross intellij. Anyways it looks fine

jovial grotto
quiet ice
jovial grotto
#

It is the exact same from the GH

kind hatch
#

How are you trying to run the maven commands?

jovial grotto
#

Not sure what you mean

quiet ice
#

Yeah, you must use mvn package/mvn install

#

Only using mvn does not suffice

late sonnet
kind hatch
#

You should be using the panel on the right side of the IDE.

quiet ice
#

Unless you specify a default goal, but I do not know how it works

kind hatch
#

default goals are pretty easy

jovial grotto
quiet ice
#

Yeah, but I don't think that the default goals are actually executed by default

kind hatch
#

Slap it at the top of your build, then press the green button.

kind hatch
icy beacon
#

hey there, I decided to convert one of my utils' class to Kotlin for convenience, but I'm getting this error now (look at the attachment)
the method worked fine in the past, but it's an incompatibility with MockBukkit (I verified, removing MockBukkit fixes the error)
if anyone who's experienced in Kotlin could help me I'd greatly appreciate it 🙂

kind hatch
quiet ice
jovial grotto
kind hatch
# jovial grotto Thanks!

You should setup a default goal so that you just have to click the green button at the top and it'll do the steps for you.

<build>
  <defaultGoal>clean package</defaultGoal>
...
</build>

You may not have as many modules as I have, but you just need to select the name of your module then press the green button.

kind hatch
#

Nothing but sometimes.

quiet ice
#

Alternatively, just build the parent project

jovial grotto
hybrid spoke
# jovial grotto In my code I listen on the PlayerJoinEvent, however whenever it actually happens...
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "java.util.HashMap.get(Object)" is null
    at freezegui.freezegui.events.EventsHandler.onRejoinIfFrozen(EventsHandler.java:56) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    ... 15 more

explains it pretty well

tardy delta
#

assign it to a Boolean

jovial grotto
#

I am new to this lmao (and Java)

tardy delta
#

boolean b = map.get(whatever) calls Boolean.booleanValue() internally

hybrid spoke
#

therefor it returns null

jovial grotto
#

ah

tardy delta
#

cuz a boolean cannot be null, a Boolean can

quiet ice
#

So just do if (FreeCommand.hm.get(p) != Boolean.TRUE) return;

tardy delta
#

welp thats a way too

quiet ice
#

Well that is the best way to do it due to implicit casts

#

Unless - lemme check

tardy delta
#

forgot Boolean.TRUE and FALSE existed

jovial grotto
#

That works

civic wind
#

How to add enchants to config?

kind hatch
civic wind
#

Also, it's only displaying boots in my gui now?

#

It was literally working a minute ago before i tried adding enchants...

kind hatch
#

Are you wanting to just add the glow effect? Because if so, you don't need to put them in the config.
Just put the enchantment on the item, then modify your item meta.

civic wind
#

No, i need enchants on them

quiet ice
# quiet ice Unless - lemme check
[geolykt@fedora new]$ rm -f Test.java && echo "class Test {public static void main(String[] args) {Object o = null; Boolean b = (Boolean) o; if (b != true) return; System.out.println(b);}}" >> Test.java && javac Test.java && java Test


Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "<local2>" is null
    at Test.main(Test.java:1)

Yep, still NPEs

jovial grotto
kind hatch
tardy delta
#

it calls null.booleanValue()?

quiet ice
quiet ice
tardy delta
#

mmh

quiet ice
#

That ofc won't apply if none are primitive, hence

rm -f Test.java && echo "class Test {public static void main(String[] args) {Object o = null; Boolean b = (Boolean) o; if (b != Boolean.TRUE) return; System.out.println(b);}}" >> Test.java && javac Test.java && java Test

Will run

tardy delta
#

what about new Boolean(true) == true

#

will probably be equal

kind hatch
# civic wind No, i need enchants on them

Then you're going to need to a resolver of some sorts. You could probably just store the name of the enchantment and use the namespaced key to convert it to a proper Enchantment object

quiet ice
#

That would call new Boolean(true).booleanValue() == true, hence returning true

tardy delta
#

yep does

quiet ice
#

On the other hand new Boolean(true) == Boolean.TRUE should return false

kind hatch
#

Why?

tardy delta
#

yep

kind hatch
#

It looks like it should be true in that case.

tardy delta
#

cuz object references

#

it doesnt call ::booleanValue right

quiet ice
#

Hence new Integer(), new Boolean(), etc are deprecated for removal

#

As they make little sense due to the contract of new

civic wind
#

Can anyone tell me why it's just showing the boots???

tardy delta
#

hmm makes sense now, i always thought Boolean.valueOf called the Boolean constructor

quiet ice
#

Nah, Boolean.valueOf() is more sane there

#

Same with Integer#valueOf - it will default to the internal cache of integers for certain values

kind hatch
tardy delta
#

damn theres even an entire IntegerCache class

civic wind
#

0_o omg yh

#

kmt

quiet ice
tardy delta
#

internal class of Integer

#

looks like it gets the bounds from some properties

quiet ice
#

Yep

tardy delta
#

another class to explore uwu

quiet ice
#

Although most of the magic behind that class are in the JVM itself

opal juniper
tardy delta
#

dunno how you would benefit from that

quiet ice
#

As those are static final you cannot do that easily

untold patio
#

Hey guys c; how can I save an arraylist of objects in a yml file so that when server reloads those objects are still in the array

#

c;

tardy delta
#

is it even possible to access those with reflection?

quiet ice
#

Just push the arraylist in that yaml configuration

tardy delta
#

Unsafe::putInt maybe

quiet ice
tardy delta
#

altho youd still need the field

untold patio
quiet ice
#

sun.misc.Unsafe does work though - I have done something similar when setting the internal bukkit unsafe in my hackloader

tardy delta
#

🥲

#

whats that hackloader about tho?

quiet ice
#

I've shown it once before I think, it's just a little hack to modify slimefun at runtime without tripping any anti-malware plugins

tardy delta
#

:o

quiet ice
opal juniper
#

is it OS

tardy delta
#

hacky stuff

opal juniper
#

at opticfusion patch this ^^

#

:D

tardy delta
#

now i understand why writing a plugin in bytecode would be easy for you ;-;

opal juniper
#

cool thing tho

tardy delta
#

im learning about bytecode instructions in my free time

#

nothing better to do

opal juniper
#

im not, cause i dont hate myself

tardy delta
#

my life is already fucked up

quiet ice
#

there isn't that much to learn. If you know java, you will get behind JVM bytecode pretty fast

quaint mantle
#

Hey guys How can I detect item dropped on inventory? (Like Item Move to the other Inventory)

quiet ice
#

I believe you need to first listen for the item being taken and then list for the item being inserted I fear

solemn meteor
#

Is it possible to stop specific structures from generating? Like if I wanted to stop strongholds from spawning, is that possible?

jovial grotto
#

What is going on here?

#

that is the func but I can't see any issues with it

quiet ice
#

The Item is air, sometimes bukkit returns null instead of an empty itemstack

#

You shouldn't ignore nullabillity - although I guess you shouldn't use nullabillity when using spigot as the nullabillity documentation is rather lackluster under spigot

jovial grotto
#

So how would I fix this? My brain is quite frazzled as I have been at this for a while lmao

kind hatch
#

Did you register the event?

quiet ice
quiet ice
#

Do you know what the event is used for?

#

Because in 90% of cases you misunderstood it, and would need to read the documentation again

echo basalt
#

It's for hoppers n dispensers type deal

quiet ice
#

Smh, spoiled the fun part

echo basalt
icy beacon
#

hey there, I decided to convert one of my utils' class to Kotlin for convenience, but I'm getting this error now (look at the attachment)
the method worked fine in the past, but it's an incompatibility with MockBukkit (I verified, removing MockBukkit fixes the error)
if anyone who's experienced in Kotlin could help me I'd greatly appreciate it 🙂

quaint mantle
#

Hi sry but how can i detect when a player join a world ?

civic spoke
#

Hello! I'm trying to make a plugin but my Spigot server doesn't seem to detect it (showing 0 plugins in-game). The jar is in the plugins folder and the plugin.yml is in the base folder of the jar. Any ideas what's wrong?

hazy parrot
civic spoke
#

i am so dumb i didn't see that it showed an error

icy beacon
#

don't be ashamed, we all began somewhere

#

by the way, do you know java or are you just starting?

civic spoke
#
[12:51:20 ERROR]: Could not load 'plugins\MninPlugin.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `mnin.MninPlugin;'
    at --snip--

and I know java

#

wait

civic spoke
#

oh my god i just put a ; in my yaml

icy beacon
#

lmao F

civic spoke
#

for the main is it supposed to be the file or the class?

hazy parrot
#

wdym

#

its your main class

civic spoke
#

like if my package is pkg and my main plugin class is MainPlugin in a file named plug, is main going to be pkg.plug or pkg.plug.MainPlugin

icy beacon
#

if you are using intellij, install the Minecraft Development plugin and let it handle the creation of your structure

civic spoke
#

i'm using eclipse

icy beacon
civic spoke
icy beacon
#

yeah

#

but why would you have such a structure in the first place

civic spoke
#

that is basically the structure of my project right now (not with those names; plug and MainPlugin map to the same name in mine)

icy beacon
#

so you have your main class inside of a file with another name?

civic spoke
#

and i updated my plugin.yml and it's still complaining that it can't find it

icy beacon
#

w hy

civic spoke
#

the real name is mnin.MninPlugin.MninPlugin

icy beacon
#

noooooo

#

mnin.MninPlugin

civic spoke
#

so for the other example it would be pkg.plug?

icy beacon
#

does plug extend JavaPlugin?

#

here's an example from my plugin
plugin.yml: com.roughlyunderscore.enchs.UnderscoreEnchants

civic spoke
#

i just dmed you the filestructure

#

the main class is in MninPlugin.java

#

i got it working with mnin.MninPlugin in the plugin.yml

icy beacon
#

yeah

#

that's kinda

#

to be expected

untold patio
#

Guys, does anyone has a link or a youtube video where they explain how to save an arraylist of objects so that it's gonna keep its data even if server reloads

#

I've been looking for a way but can't find what I'm looking for

#

thank you

icy beacon
#

you meen persistent data storing?

civic spoke
untold patio
jovial grotto
#

I was going to commit to GH but this popped up, should I worry or is it fine?

hazy parrot
#

?pdc then

icy beacon
#

well, there are multiple ways, but pdc or file

jovial grotto
#

I know it is errors and I know it'll keep going tho

civic spoke
#

also uh ```java
package mnin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.Bukkit;

public class MninPlugin extends JavaPlugin {
// Fired when plugin is first enabled
@Override
public void onEnable() {
Bukkit.broadcastMessage("Hello, world!");
}

// Fired when plugin is disabled
@Override
public void onDisable() {

}

}

untold patio
hazy parrot