#help-development

1 messages · Page 1733 of 1

tender shard
#

yeah there's two ways for doing that

#

you can either set a default value in the getInt method

#

sooo like

#

getConfig().getInt("zombies-amount",50);

#

of you set a global default value

#

getConfig().addDefault("zombies-amount",50);

#

or setDefault? idk right now

latent dove
#

yeah i'll stick with getInt

#

what about multiple files

#

actually no

tender shard
latent dove
#

i'll use that when i actually need it

tender shard
#
YamlConfiguration messageConfig = YamlConfiguration.load(new File("filename"));
#

and then just do messageConfig.getString("message-name");

latent dove
#

o

#

thats so simple

tender shard
#

indeed 😄

#

but don't forget to save your custom config files

#

you can just do

#
saveResource("messages.yml", false);
#

that will save your included messages.yml file inside the plugin folder

latent dove
#

whats the false for

tender shard
#

false means "don't overwrite existing files"

latent dove
#

oh

tender shard
#

buuut

#

it'll print a warning when the file already exists

#

so first check whether the file exists

#

sth like this:

#
File messageFile = new File(getDataFolder(),"messages.yml");
if(!messageFile.exists()) {
  saveResource("messages.yml",false);
}
latent dove
#

getDataFolder() from JavaPlugin?

tender shard
#

yep

#

that returns the folder named after your plugin

#

like, the directory where your config.yml is stored

latent dove
#

cool!

#

about the translation

#

what i did was

#

xD

tender shard
#

bump I really need help with this :/

#

Maybe the bot can help me lmao @undone axle

latent dove
#

the name is kinda cringe but you know, personal likings we can't interfere lmao

crude sleet
#

Are there other ways to get all Online players without "Bukkit.getOnlinePlayers()" ?

I dont know why but i think the normal getOnlinePlayers not working perfectly for me

latent dove
#

You want a list/collection?

eternal oxide
#

that will return ALL online players

latent dove
#
getServer().getOnlinePlayers();
#

will work

#

returns a collection

crude sleet
#

sec

latent dove
#

in JavaPlugin

opal sluice
eternal oxide
#

It will count anyone who is a valid online player

alpine urchin
#

they changed from Array to collection at some point

#

or other way around

crude sleet
alpine urchin
#

what isn’t working

crude sleet
#

@alpine urchin

#

The Problem is the loop i think, so my idea was to try another way

latent dove
#

@tender shard is it good to saveConfig(); in the on disable

tender shard
#

that depends

#

do you have commands etc for users to change the config?

latent dove
#

no but

#

i have a /reload

tender shard
#

NORMALLY you want people to use a proper editor to edit the files. you only want to call saveConfig when people can actually change the config ingame

latent dove
#

oh

#

but is it fine if i call it whatsoever just for safety

tender shard
#

I wouldnt do that

#

because

#

it will simply dump the configuration, meaning you lose all comments etc

latent dove
#

oh

tender shard
#

for example, check out the AngelChest config I sent above

#

when you do saveConfig, it will look like this afterwards:

#

(1 sec pls)

latent dove
#

ok cheers

tender shard
#

only call saveConfig when the config has actually changed

#

you 99% don't want / have to use it

crude sleet
#

Can nobody help me? ^^

tender shard
#

how often / when are you calling this method?

#

ah just checked

#

you call it on every teleport event

#

you should store the player or sth in a map/list etc and only call it once for every player

crude sleet
#

You mean in the loop (Teleport Event) ?

tender shard
#

yes

crude sleet
#

Thx, i try it. Sec

pastel stag
#

anyone like familiar w/ arrays able to help me w/ an array issue? got Strings not showing up and stuff for Array.contains() can't seem to figure it out

pastel stag
#

!paste

tender shard
#

?paste

undone axleBOT
pastel stag
tender shard
#

okayyyy so what's the problem?

pastel stag
#

so the command adds player's uuid to the array

#

event handler looks for that uuid onBreak

#

and the issue is

#

it cant find it

tender shard
#

first of all:

pastel stag
#

so the onBreak method never executes

tender shard
#

you have an arraylist, NOT an array

#

that's a completely different thing

pastel stag
#

erm

tender shard
#

is there any reason why you are converting the UUID to string instead of just storing the UUID directly?

pastel stag
#

i was originally storing it directly

#

did .toString to attempt to debug

#

just havent changed it back

tender shard
#

hmmm

#

nvm that shouldn't be the problem

#

lemme see

pastel stag
#

arraylist would still work how im using it though right? or no

tender shard
#

soooo the problem is that the list never contains your player's uuid string, right?

#

you are only adding players in the command method

#

so that's definitely the place to look for the error

#

when you run the command, does it say "block debugger enabled" etc?

#

(btw you have a typo, you're printing "WATC[h]BLOCK" without the "H"^^)

#

it seems like the player UUID string is never actually added to the list

pastel stag
#

yeah it seems as tho the list never contains the uuid string

#

so heres the interesting thing

pastel stag
#

yes

#

and if i run it a second time

#

it disables and prints disable message

#

thats what i dont get

tender shard
#

okay

pastel stag
#

the info is clearly in the array but @EventHandler methods cant see it for some reason

tender shard
#

in your blockplace / block break event, print out the list to console

pastel stag
#

i did

#

it prints []

tender shard
#

oh wtf

#

hm okay

#

lemme see again

pastel stag
#

what method would you use to print the array to console

#

i was using uhhhh

tender shard
#

oooh

#

wait a sec

pastel stag
#

lemme try to remember

tender shard
#

show you rmain class

#

I think

#

your problem is this:

#

You are creating two instances of this class

pastel stag
tender shard
#

one handles the commands and the other one gets registered as listener

pastel stag
#

my main class is a mess don't judge

#

i havent reorganized it cause lazy

tender shard
#

yes

#

I was right

pastel stag
#

so how do i do it all as one instance

tender shard
#

you are creating your ToggleBlockDebugger three times

#

You can do it like this:

#
ToggleBlockDebugger blabla = new ToggleBlockDebugger();
getServer().getPluginManager().registerEvents(blabla, this);
getCommand("yourCommand").setExecutor(blabla);
latent dove
#

'blabla'

#

yessir

tender shard
#

right now, you are creating the instance of that class more than once, so your listener doesn't "see" the changes you did in the command executor

#

they have two different lists

#

you know what I mean?

pastel stag
#

right that makes sense i suppose

#

yeah i getcha

tender shard
#

oki

#

it should work when you use the same instance for everything

#

you create an object of that class three times

pastel stag
#

so

getServer().getPluginManager().registerEvents(toggleblockdebugger, this);```
#

and then obv register the command as well

tender shard
#

exactly

pastel stag
#

oh shit lmao

#

i didnt even see the third one haha

tender shard
#

😄

#

it can happen 😄

pastel stag
#

that got lost in the debugging i think didnt mean to do that

tender shard
#

sorry for asking this, but

#

you DO know the difference between classes and their instances, right?

pastel stag
#

i do but i also dont have a full understanding of like creating instances and initiating them and all that jazz

#

im 100% self taught and this is legit my third week of working on this plugin in my days off only

#

trying things till they work then building off that

#

basically

#

0 coding experience whatsoever prior to 3 weeks ago

tender shard
#

okay so I'll explain it very very shortly: A class is like the blueprint for an instance. Like, imagine a person class that has one String called "name". Now you can do

Person myself = new Person("n0_grief");
Person mfnalex = new Person("mfnalex");

Both objects are a Person but they are independent from each other. Right now, you create several instances of your BlockToggleDebugger that are indepent from each other. But they have to share the same list of UUIDs so you want them to be the SAME instance

#

The explanation is shitty but I hope you get what I mean

quaint mantle
#

it's a very good explanation

tender shard
#

thx 😄

crude sleet
tender shard
#

everytime you do "new ToggleBlockDebugger" it's a new object and it also has it's own list of UUIDs

latent dove
#

@tender shard i want to thank you for ur help for me in config

tender shard
#

no problem, glad I could help 🙂

latent dove
#

it works like a charm

tender shard
#

Perfect :3

#

AND NOW SEND ME 300$ ON PAYPAL!!!!!1111eleven

latent dove
#

you caused this

pastel stag
#

@tender shard the explanation makes sense for sure

pastel stag
tender shard
#

to make it short:

#

Do some kind of "ToggleBlockDebugger blabla = new ToggleBlockDebugger();" and then replace every line of code where you are using "new ToggleBlockDebugger()" with "blabla"

pastel stag
#

ONLY in main correct?

tender shard
#

buuuut I have to add: you didn't really understand the concepts of classes and instances yet (which is totally normal, almost noone understands it at first) soooo you might want to watch some tutorials explaining the concept of objects, classes and instances 🙂

pastel stag
#

this is like the part that trips me up w/ these instances is like what needs to go where and why

tender shard
pastel stag
#

ok that is definitely only in my main class

#

would i also need to change this in ToggleBlockDebugger.java ? public class ToggleBlockDebugger implements Listener , CommandExecutor { private Main plugin; public ToggleBlockDebugger(Main plugin) { this.plugin = plugin; plugin.getCommand("wblockdebugger").setExecutor(this); }

tender shard
#

I would say it's a bad habit to register the command in the executor's debugger

#

buuuut it should work fine nonetheless

pastel stag
#

ok

tender shard
#

in my opinion, an executor shouldnt register itself

#

that's a job your main class should do

#

but as said, it will work anyway

#

it's just bad OOP

pastel stag
#

and as far as creating an instance of ToggleBlockDebugger in Main ToggleBlockDebugger toggleblockdebugger = new ToggleBlockDebugger(this); ?

tender shard
pastel stag
#

and then getServer().getPluginManager().registerEvents(toggleblockdebugger, this); basically registers events to that instance right

#

if im understanding correctly

tender shard
#

exactly 🙂

#

and now pay me 7 million $$$$ to my paypal

pastel stag
#

ok so one more dumb question

tender shard
#

sure

pastel stag
#

and i feel like the usage of 'this' everywhere is what is confusing me

tender shard
#

okay so

#

imagine you have a class called Person again

#

like

pastel stag
#

i can just straight up get rid of this right new ToggleBlockDebugger(this);

tender shard
#
public class Person {
  String name;
}
latent dove
#

u can't

pastel stag
#

because this creates ANOTHER new instance of toggleblockdebugger and thats all it does

tender shard
#

and now you have a method called "setName(String name)"

#

when you use this.name, it means "use the class instance's "name" variable"

#

when you simply use "name", it means use the parameter

#

99% of the time, you do not have to use "this."

#

you only need "this." when a method has a parameter that has the same name as your class'es variable

#

Example:

#
public class Person {
  String name;

  public Person(String name) {
    this.name = name;
  }
}```
is the same as this;
#
public class Person {
  String name;

  public Person(String newName) {
    name = newName;
  }
}
#

in the first example, you have to use "this" because both variables are called "name"

#

in the second example you don't need it because the variable is called "newName" in the method

pastel stag
#

ngl my brain hurts

#

LOL

tender shard
#

that's normal because you didn't (fully) understand the concept of objects yet 🙂

tribal holly
#

Someone know how to make an item impossible to dispawn ?

tender shard
tribal holly
#

yep

tender shard
#

hmm

#

you can listen to this event and simply cancel it

tribal holly
#

there is not a tag to change inside the item ?

#

like dispawn time ?

tender shard
#

nope there isn't

tribal holly
#

pickupdelay

tender shard
#

pickup delay means "how long does a player have to stand 'inside' the item to pick it up"

tribal holly
#

hmm okay thx

tender shard
#

you only want certain items to "survive" longer than the default 5 minutes. ,right?

#

Ask your questions here: http://joincfe.com/knock
Up vote your favorites.

Suggest a project, tutorial, or topic: http://joincfe.com/suggest/

The long term goal: build a search engine of technical and non-technical questions with concise video responses. The more questions that we get, the more answers we can research and respond with.

http:/...

▶ Play video
tribal holly
#

this a visual shop and i don't wanna the item to dispawn but is ok i handle the event thx

tender shard
#

(I didnt watch the video but it seems like it explains what you're struggling with)

eternal oxide
#

that really needs a video?

tender shard
tender shard
#

I would do it like this:

eternal oxide
#

A Player is an object. For every person who logs in the server creates an instance of Player for each.

tender shard
#

everytime you spawn an item, store in a list or sth, and then listen to the ItemDespawnEvent and cancel it when the item is in your list

tribal holly
tender shard
tribal holly
tender shard
eternal oxide
#

I just found it odd that someone actually made a full video explaining what takes one sentence.

tender shard
pastel stag
#

@tender shard well everything works as intended now, i really appreciate your help, also i watched the video

tender shard
#

you're welcome, glad I could help :3

#

and now send me 3 million $$$

pastel stag
#

i feel like i know what objects vs instances are by even just your explanation, i get really tripped up on the 'this' stuff tho

tender shard
#

"this" always refers to the current instance you have

pastel stag
#

like why does ToggleBlockDebugger toggleblockdebugger = new ToggleBlockDebugger(this); work

#

but ToggleBlockDebugger toggleblockdebugger = new ToggleBlockDebugger(); doesnt?

eternal oxide
#

whole different kettle of fish

#

?di

tender shard
#

that's because you defined a Constructor in your ToggleBlockDebugger that needs to get an instance of your main plugin

undone axleBOT
pastel stag
#

so the this in that line of code passes through the main class

tender shard
#

well

#

it passes a reference to the instance of your main class

#

just imagine the following scenario (I'll try to explain it without any programming stuff)

#

You have a method greet(People someone)

#

sooo for example

#

n0_grief can greet people

#

but it has to know WHO to greet

#

so we pass that person as parameter

#

like n0_grief.greet(mfnalex)

#

you have to give the method "greet" a parameter

#

in your case, you decided that your ToggleBlockDebugger also needs a parameter which is your main class

#

because you probably call some methods of your main class in your ToggleBlockDebugger class

#

soooo

#

it cannot access them when you don't tell it what your main class is

#

ToggleBlockDebugger cannot access anything from your main class when it doesnt know your main class

pastel stag
#

so the only use that i see of the main class in toggleblockdebugger.java was where i set the executor for the command

tender shard
#

no no

#

you're also setting is as listener, don't you?

pastel stag
#

yeah

tender shard
#

exactly. and you want the SAME ToggleBlockDebugger to work as both, a command executor, and a listener

#

you do not want two DIFFERENT ToggleBlockDebuggers

#

you want them to be the same

#

that's why you only create the object once and use it for both

#

otherwise, you have two different objects, which do NOT share the same UUID list

pastel stag
#

right right i just meant; you said that i have to use (this) when i create the instance of ToggleBlockDebugger in main because of the ToggleBlockDebugger(Main plugin) {} constructor in ToggleBlockDebugger.java right

tender shard
#

I will then explain why or why not you need "this" when creating an instance of it

pastel stag
tender shard
#

check out line 21

pastel stag
#

right so this is what i thought, that constructor is why

#

amiright?

tender shard
#

you said that when creating an instance of your class, it needs to be provided with an instance of your main class

#

and, in your main class, "this" obviously refers to its instance

#

sorry I cannot explain it that good

pastel stag
#

so the (this) in the main class when i create the instance of ToggleBlockDebugger just references the instance of the main class

#

just tells it where to find it more or less? idk how else to explain it

tender shard
#

"this" in your main class refers to the INSTANCE of your plugin

#

imagine bukkit's code

#

it basically does sth like this:

#

YourPlugin plugin = new YourPlugin();

eternal oxide
#

public class MainClassExample {
   House house1 = new House();
   House house2 = new House(this);
}```
house1 and house2 are separate instances.  house2 has been passes a reference to MainClassExample, but it will only be available to house2. house1 will not know about MainClassExample.
tender shard
#

and in your plugin, "this" also refers to the newly created "YourPlugin" object

#

"this" basically means exactly what it says: "THIS", i.e. the current object that was created based of this class

tender shard
#

I know it's hard to understand at first lol

pastel stag
#

i actually understand it with the house code bit

#

that makes sense to me

#

i def need to fix my main class its a mess and a half

#

this is the first thing (other than helloworld) that i ever coded and obv main class kinda in itself shows the evolution of me learning lmao spaghetti code forsure

eternal oxide
#

My first dive into coding was all god classes. OOP never existed 🙂

#

Well it was actually punch cards, but thats showing my age.

rigid hazel
#
[15:52:39] [Server thread/WARN]: java.io.IOException: No such file or directory
[15:52:39] [Server thread/WARN]:        at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
[15:52:39] [Server thread/WARN]:        at java.base/java.io.File.createNewFile(File.java:1034)
[15:52:39] [Server thread/WARN]:        at CimeyRolePlay-1.1.0.jar//de.cimeyclust.utils.guilds.GuildInventoryManager.<init>(GuildInventoryManager.java:28)
[15:52:39] [Server thread/WARN]:        at CimeyRolePlay-1.1.0.jar//de.cimeyclust.utils.guilds.Guild.<init>(Guild.java:45)
[15:52:39] [Server thread/WARN]:        at CimeyRolePlay-1.1.0.jar//de.cimeyclust.Plugin.onEnable(Plugin.java:205)
[15:52:39] [Server thread/WARN]:        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263)
[15:52:39] [Server thread/WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[15:52:39] [Server thread/WARN]:        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[15:52:39] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:529)
[15:52:39] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:443)
[15:52:39] [Server thread/WARN]:        at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:639)
[15:52:39] [Server thread/WARN]:        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306)
[15:52:39] [Server thread/WARN]:        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126)
[15:52:39] [Server thread/WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316)
[15:52:39] [Server thread/WARN]:        at java.base/java.lang.Thread.run(Thread.java:831)
#
public GuildInventoryManager(Plugin plugin, Guild guild) throws IOException {
        this.plugin = plugin;
        this.guild = guild;
        this.file = new File(this.plugin.getDataFolder().getAbsolutePath(), this.guild.getGuildName() + ".yml");
        this.file.mkdir();
        if(!this.file.exists()) {
            this.file.createNewFile(); // line 28
        }
        this.c = YamlConfiguration.loadConfiguration(this.file);
    }
#

Please help me. Why do I get this error?

latent dove
#

@tender shard hey what about this type of yml

x:
- y
- z
eternal oxide
#

File(this.plugin.getDataFolder(), this.guild.getGuildName() + ".yml");

latent dove
#

how to make such

tender shard
rigid hazel
#

Should I do it like that?

tender shard
#

I doN't really understand what's the question

latent dove
eternal oxide
#

well your code is just creating an empty file

tender shard
#

it only contains strings, right?

latent dove
#

yes

eternal oxide
#

theres nothing in it

#

That was to verox

tender shard
#
List<String> myList = getConfig().getStringList("x");
rigid hazel
latent dove
#

o

#

ok ty

eternal oxide
#

do you have a yml in your jar you want to use?

rigid hazel
tender shard
#

they are new to using config files, I think they just wanna read an existing config

rigid hazel
#

I always used databases before

eternal oxide
rigid hazel
#

But I don't want a default config. I want a custom. Not the one from the plugin

eternal oxide
#

look at the CUSTOM section

tender shard
#

wait

eternal oxide
#

you either have to provide some default to begin with, or you can generate via code if you must

tender shard
#

let me

#

you want to have something like "mycustomconfig.yml" right?

#

if yes: 1. Save your custom default config using JavaPlugin#saveResource

#

sorry for typos I'm drunk

eternal oxide
#

if you don;t have one then don;t load but create new

tender shard
#

no need to

#

loadConfiguration will return an empty config when the file doesnt exist

eternal oxide
#

ah ok, did not know that

tender shard
#

Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.

#

🙂

#

quite handy, lol

rigid hazel
#

java.lang.IllegalArgumentException: The embedded resource 'Yadel.yml' cannot be found in plugins/CimeyRolePlay-1.1.0.jar
        at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:192) ~[patched_1.17.1.jar:git-Paper-157]
#
public GuildInventoryManager(Plugin plugin, Guild guild) throws IOException {
        this.plugin = plugin;
        this.guild = guild;
        this.file = new File(this.plugin.getDataFolder(), this.guild.getGuildName() + ".yml");
        if(!this.file.exists()) {
            this.file.getParentFile().mkdirs();
            this.plugin.saveResource(this.guild.getGuildName() + ".yml", false); // Error
        }
        this.c = new YamlConfiguration();
        try {
            this.c.load(this.file);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
    }
#

saveResource doesnt work.

#

@eternal oxide What did I wrong?

eternal night
#

is the file in your jar 😂

rigid hazel
#

no

#

wdym

eternal night
#

well save resource expects that file to exist in your jar to save it to the disk doesn't it ?

rigid hazel
#

Ah. thanks

#

Should I create the file in the resources folder in my plugin @eternal night ?

eternal night
#

concerning you seem to be creating files dynamically based on guild name that would not scale too well

rigid hazel
#

So: this.plugin.saveResource("guild.yml", false);

eternal oxide
#

can the guild change name?

rigid hazel
eternal oxide
#

good

rigid hazel
#

xD

#

To lazy

#
public GuildInventoryManager(Plugin plugin, Guild guild) throws IOException {
        this.plugin = plugin;
        this.guild = guild;
        this.file = new File(this.plugin.getDataFolder(), "guild.yml");
        if(!this.file.exists()) {
            this.file.getParentFile().mkdirs();
            this.plugin.saveResource(this.guild.getGuildName() + ".yml", false);
        }
        this.c = new YamlConfiguration();
        try {
            this.c.load(this.file);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
    }
```Can I do this?
#

No.

tender shard
tender shard
latent dove
#
"org.bukkit.entity.LivingEntity.getCustomName()" is null
#
@EventHandler
    public void on(EntityDeathEvent e) {
        if (e.getEntity().getType().equals(EntityType.ZOMBIE)) {
            if (e.getEntity().getCustomName().contains("§c§lHenchman")) {
                if (e.getEntity().getKiller() instanceof Player) {
                    ItemStack reward = new ItemStack(Material.HEART_OF_THE_SEA);
                    reward.addUnsafeEnchantment(Enchantment.MENDING, 1);
                    ItemMeta meta = reward.getItemMeta();
                    meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
                    meta.setDisplayName("§4Henchman's §csoul");
                    reward.setItemMeta(meta);

                    e.getEntity().getWorld().dropItemNaturally(e.getEntity().getLocation(), reward);
                }
            }
        }
    }
#

why is this

#

it only gives error

#

rest of the things work

tawdry scroll
#

e.getEntity().getCustomName() != null

latent dove
#

o ty

wispy bridge
#

Then who knows? I dont see how anybody would know the answer

tawdry scroll
#

It will not remain negative at release

latent dove
#

hey @tawdry scroll whos in your pfp

tawdry scroll
#

A person

latent dove
#

specify the person

tawdry scroll
#

Myself

latent dove
#

how old are u

tawdry scroll
#

How its related to your customname error?

latent dove
#

im jut curious

#

because im young too

#

an eternity

#

hbu

tawdry scroll
#

Its 18
The point is why no one wanne say there age
The point is why people ask lol

trim creek
#

Age is just a number.

latent dove
#

yes

#

int age;

trim creek
#

😄

latent dove
#

im also 13

trim creek
#

It's like we make a useless code into a useless plugin.

#

(but then what makes sense of the plugin?? XD)

latent dove
#

4 weeks of spigot api

#

i knew java

#

i have a spigotmc account and a plugin on it with 20 downloads B))

trim creek
#

VanityMC...? 🤔
The only I know is VanityEmpire... 🤔

#

wtf man

latent dove
#

eyo

trim creek
#

do sending invites man

#

D:

#

(another fun fact: I always reject these. XD)

#

I do not join these unverified servers.

#

dude wtf

#

Do you think I am a server..? 🤣

latent dove
#

ur unverified tho..

trim creek
#

Sadly I am a human, but I would like to be a dead server... XD

trim creek
#

🤣

#

At least I still have spaces in my name. XD

#

Those kids these days.. 🤡
They do not understand so many things.. 🤡

#

If that would be my problem... .-.

#

But I have other problems like depression. .-.

#

"you was"? 👀

#

Don't you mean "were"? 😄

#

But anyway nvm because it is just a typo.

#

You're a human.

#

All humans has the rights to do mistakes.

#

It is a typo. .-.

tender shard
#

I always thought it's sachins dog lol

trim creek
#

😆

#

wtf man

#

This is why it is a typo. .-.

#

The lyrics is messed up.

ivory sleet
#

@weary geyser discord link in dm next time

trim creek
#

Or even the whole song. 😄

trim creek
ivory sleet
#

Then add them as friend

trim creek
#

They cannot add me. 😄

#

As far as I know...

#

.-.

ivory sleet
#

You can add them?

trim creek
#

But I won't.

#

I do not know who he is. .-.

#

He is just like...

#

And unknown host...

#

.-.

#

(at least for me)

ivory sleet
#

Idm, we don’t want discord links posted here, no discussion

#

Solve it if you really need the link, shouldn’t be that hard

trim creek
#

Even with the fact I never liked angry mods.

#

idk

#

I was mentioning other mods.

#

¯_(ツ)_/¯

#

But I am happy and sad at the same time. 😆

#

To solve this problem, please read your #general at null. 🤡

#

I think you should learn English more harder. .-.

#

I feel English is not your first lang.

#

Am I right?

#

DUDE! WTF?!

#

How could I open the fridge by walking 5 centiméter-ek into the walls, to teleport into North Korea to kill myself?!

#

I am already at the top floor....

#

Okay I need a pchyhologist here.

#

This was autism not sarcasm, you know?

#

This was autism, not sarcasm.

#

At least what you have been writing down was.

#

Fúúú baszd meg... -.-

#

$ suicide

crimson terrace
#

are you supposed to add the defaults each time the plugin is enabled?

latent dove
#

u guys still doing that

#

@crimson terrace in config?

crimson terrace
#

yea

#

im making a method and planning to call it in the onEnable

#

is there a better way or would you do the same?

tardy delta
#

uhh are enum values loaded first or is the static {} block executed first?

#

putting them in a map and making sure their constructor is been called before

eternal night
#

enum constants are initialised before the static blocks are executed

tardy delta
#

oki that's enough for me

ivory sleet
#

Enom nom 😮

tardy delta
#

let's try three days of coding out 😳

ivory sleet
#

:0

tardy delta
#

it compiled

#

its something liek Lang.NO_CONSOLE.get()

#

get0() gets the corresponding value from lang file loads it in the map

#

if nothing is found is uses the default

#

?paste

undone axleBOT
tardy delta
#

🤡

crimson terrace
#

Im not good with using the config and inserting values into it via code. Im adding defaults to it but how can I make the defaults be inserted into the config file when the method is run?

tardy delta
#

if i just return the message nothing is from config

#

i also want to check if its not null and log it

#

so

#

it doesnt exist in config then

#

so i give a default

#

i don't get it

undone axleBOT
tardy delta
#

that wouldnt help to prevent me getting values from config

#

these are defaults

#

i do and return a default 🤡

#

well yea i could do that in the constructor tho

lavish hemlock
#

reverse lookup

#

(although you could just have a map that gets edited in the constructor)

tardy delta
#

he was kinda right i could do it in the constructor

opal juniper
#

why the fuck are you so aggressive

quaint mantle
#

try Kotlin™️ today!

opal juniper
#

no it isnt

#

its just people being bitches thinking they know everything

tardy delta
quaint mantle
tardy delta
#

btw is ur name dutch?

quaint mantle
#

yep

tardy delta
#

wouch im also dutch

quaint mantle
#

im not dutch I just liked the spelling haha

#

you have a very cool language tho

tardy delta
#

😎

#

uh instead checking if the inventory i'm clicking on is instance of one of mine, cant i just check if the inv.class.package.name starts with my package name?

hasty prawn
#

Why would you do that

tardy delta
#

idk instead of inv instanceof that or instanceof that or instanceof that or instanceof that

hasty prawn
#

I mean it would probably work, but you should keep using instanceof

tardy delta
#

mwwo yea

hot ledge
#

hey anyone can help me with an hashmap

quaint mantle
#

What's the issue?

hot ledge
#

i want to whitelist the code only on one Bow enchantment (excatly Punch 2)

#

HashMap<Arrow, Integer> arrowPunch = new HashMap<>();

arrowPunch.containsKey(arrow);

arrowPunch.get(arrow);

int punch = 2;
arrowPunch.put(arrow, punch);

arrowPunch.remove(arrow);  this is my code
quaint mantle
#

put that in a code block please

#

What are you trying to do

tender shard
#

noone? 😦

hot ledge
#

I made a code that when you shoot an arrow and it hits you, you always go straight

jovial nymph
#

does any one can tell me if there is a good way of checking for an inventory in the clickEvent without going by the name because if you rename a chest you can get the same effects

hot ledge
#

i want only on enchantment punch 2 to work

quaint mantle
hot ledge
jovial nymph
#

ok ty

hot ledge
#

np

tender shard
#

it also happens to everyone who clones the repo :/

proud fiber
#

how do u make a gui that you cant exit

summer scroll
#

add a delay too

jovial nymph
#

how do i color a glass pane because stained glass pane doesnt exist

tender shard
jovial nymph
#

yeah

#

no stained

tender shard
#

it DOES exist

jovial nymph
#

oh woth color name infront sry

tender shard
#

np 😄

#

I always use Enums.getIfPresent(Material.class, "MAT_NAME").or(Material.FALL_BACK_MATERIAL);

jovial nymph
tender shard
#

obviously I didn't git add them

young knoll
tender shard
#

...

tender shard
#

of course the harcoded "MAT_NAME" was meant to be replaced with some config value etc

young knoll
#

There is also matchMaterial for that

#

But I guess you do have to handle null with that

tender shard
#

yes but that one doesn't allow you to specify a "fall back" mat

young knoll
#

Not in one line, no

tender shard
#

yep that's why I suggested Enums.getIfPresent 🙂

young knoll
#

I would make a method using matchMaterial

#

Since it can handle formats such as minecraft:egg iirc

jovial nymph
#

does any one can tell me if there is a good way of checking for an inventory in the clickEvent without going by the name because if you rename a chest you can get the same effects

jovial nymph
young knoll
#

OpenInventory returns a view

#

You can add it to a set and then check set.contains in the event

tender shard
#

either create a custmo GUIHolder class, or just store your GUIs in a list

jovial nymph
#

ok

alpine urchin
#

instead of material enum

tender shard
#

I don't understand your question

alpine urchin
#

why not use Mateiral.X

tender shard
#

because it might happen that a user enters a "material" that doesn'T exist

#

and I want to avoid that, I wanna provide a "fall back" mat

#

for example my angelchest plugin: i tdoes sth like this:

#

Material mat = Enums.getIfPresent(Material.class, getConfig().getString("material")).or(Material.CHEST);

ivory sleet
#

Feels like material x is the most useless library

quaint mantle
#

LoL

proud fiber
young knoll
#

Reopen it when closed unless they use the button

proud fiber
#

okay let me try

regal moat
#

i... need... project ideas

lavish hemlock
#

minecraft sex mod

quaint mantle
#

wut

lost matrix
eternal oxide
#

Start Skynet

lost matrix
#

Hack google using html only

ivory sleet
#

😏

alpine urchin
#

wasnt talking about a library

#

pol

ivory sleet
#

Oh lol

alpine urchin
#

hard code the material

#

but apparently in his plugin the user inputs it

#

so thats why

ivory sleet
#

Ye

young knoll
#

I just made this

#
public static Material getMaterial(String mat, Material def) {
        Material material = Material.getMaterial(mat.toUpperCase());
        return material == null ? def : material;
    }
#

Probably don't need the toUpperCase but meh

stone sinew
#

Like if you put wool instead of white_wool

young knoll
#

How so

stone sinew
#

Just the way enums work.

eternal night
#

that isn't #valueOf

young knoll
#

^

stone sinew
#

Oh read wrong lol

#

my bad

young knoll
#

getMaterial returns null instead of throwing an exception

stone sinew
#

Carry on xD

merry pulsar
#

Uuuh, i have a simple problem that i cannot solve. when i use : player.teleport((Bukkit.getServer().getWorld("world2").getSpawnLocation())); I get an error.

Error:

#

Console Error:

young knoll
#

Show the full error

merry pulsar
#

1 sec

merry pulsar
young knoll
#

Something is null

#

Probably getWorld

merry pulsar
#

I tried: player.teleport(Bukkit.getWorld("world2").getSpawnLocation()) player.teleport(new Location(Bukkit.getServer().getWorld("world2"), 0, 80, 0)); player.teleport((Bukkit.getServer().getWorld("world2").getSpawnLocation()));

young knoll
#

Store it to a variable and check if it is null

merry pulsar
eternal night
#

also 1.8.8 👀

young knoll
#

World w = getWorld(name)
if (w != null) {
//stuff
}

merry pulsar
#

@young knoll

                        if(w != null) {
                            Msg.send(player, "&cNull");
                        }else{
                            Msg.send(player, "&c FU");
                        }```
#

isn't a null

young knoll
#

You are sending null if it is not null

merry pulsar
#

didn't saw [!]

eternal night
#

probably just means your world isn't loaded

merry pulsar
eternal night
#

yea sorry

merry pulsar
eternal night
#

Eh, depends entirely on how your server is setup ?

#

are you using multiverse

merry pulsar
#

1 sec i'll add multiverse

eternal night
#

you don't have to

#

you can also use the spigot api to load a world

merry pulsar
proud fiber
#

how do i reopen a gui once it's closed?

#

I basivally don't want players to close it

#

how do i do it

#

yes

lost matrix
proud fiber
#

will it work if i have a button to close the inventory tho?

lost matrix
proud fiber
#

okay i will try thanks

fickle helm
#

does anyone know why when you use PlayerDeathEvent#setDeathMessage it will overwrite the client's language?
For example if I have my client language set to german, this is what it looks like when I'm killed by a husk:

#

however if I have this in my code:

    @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
    public void onPlayerDeath(@NotNull final PlayerDeathEvent event) {
        event.setDeathMessage(event.getDeathMessage());
    }```
I get this:
#

sorry wrong screenshot for first one:

young knoll
#

The original message is likely a translation component that is flattened into a string in the default language

lost matrix
#

getDeathMessage does not return a translatable component but a mere String

fickle helm
#

is there anyway to update the death message without losing the translation?

young knoll
#

We really need to expand the component API

merry pulsar
#

does anyone know how to set a priority for my rank system? [ i use scoreboard.main ].

#

; v ;

young knoll
#

I assume it is alphabetical

eternal night
#

scoreboards are ordered by String#compare

young knoll
#

So you could append some color codes to the front for ordering

merry pulsar
#

, _ ,

young knoll
#

Ah

#

That is an issue

merry pulsar
#

; v ;

merry pulsar
lost matrix
lost matrix
merry pulsar
golden turret
#

hello

#

i cant clone itemstacks with custom nbt

#

(middle click)

quaint mantle
#

Do you have any other plugins on a server

quaint mantle
#
event.setCancelled(true);
// Handle item operations
candid plover
#

thx

#

🥲

golden turret
#

?paste

undone axleBOT
golden turret
#

help pls

eternal night
#

don't use a string builder if you want to work with components

#

there is a component builder for a reason

golden turret
#

actually

#

it was because it had no string in the constructor

#

added an empty string and it worked

sullen marlin
#

Use the compinentbuilder

young knoll
#

compinent

quaint mantle
#

CompinentBuilder

idle cove
#

?paste

undone axleBOT
jovial nymph
#

how do i safely handle onInventoryClick events without checkign the title?

golden turret
#

inventoryholder

jovial nymph
#

whats that?

golden turret
#

an inventoryholder

jovial nymph
#

you mean owner?

golden turret
jovial nymph
#

ok ty

golden turret
#

specifically at

#

holder/CustomInventoryHolder

#

and you back some packages to

jovial nymph
#

wtf is this

golden turret
#

listener/EntityListener

#

and you will se how that works

jovial nymph
#

there is nothing explained its just some random classes

golden turret
#

yea, i need to document it

sullen marlin
#

no

#

dont use inventoryholder

young knoll
#

You shouldn’t use holder anymore

jovial nymph
#

ok what then?

sullen marlin
#

thats not what its for

young knoll
#

Use the InventoryView

sullen marlin
#

never has been

#

just use == inventory

young knoll
#

OpenInventory returns a view you can add to a set

golden turret
#

if it works then it is the right 😎

young knoll
#

Or you can do that, yeah

eternal night
#

e.g. throw the inventory instance in a map and remove on InventoryCloseEvent

jovial nymph
#

ok

#

but is there some kind of video out there that explaines how bukkit handles events and commands exactly i just cant get my head around this works

eternal night
#

there are a ton of "Writing a listener" tutorials on youtube

jovial nymph
#

i dont mean that but i think i found something

ivory sleet
#

I mean its basically scanning every method for the passed class in registerEvents

golden turret
ivory sleet
#

then it creates an EventExecutor instance for each which invokes the method reflectively

sullen marlin
#

' Note: While the Bukkit API makes every effort to ensure stability, this is not guaranteed, especially across major versions. In particular the following is a (incomplete) list of things that are not API. '

eternal night
#

"Implementing interfaces. The Bukkit API is designed to only be implemented by server software. Unless a class/interface is obviously designed for extension (eg BukkitRunnable), or explicitly marked as such, it should not be implemented by plugins. Although this can sometimes work, it is not guaranteed to do so and resulting bugs will be disregarded."

sullen marlin
#

'Implementing interfaces. '

#

the problem is people saw 'ooh look interface with only one method, it's free real estate'

golden turret
#

yes

jovial nymph
#

can i save a player in a variable and the == with a player from an event?

eternal night
#

technically yes

young knoll
#

Should be able to

jovial nymph
#

ok i try

young knoll
#

Generally better to use uuid

golden turret
jovial nymph
#

i am going to try both

golden turret
#

is the getCursor, from the InventoryClickEvent, nullable?

sullen marlin
#

what does the annotation say

golden turret
#

that would be really helpful if i was in 1.17

dry forum
stoic kettle
#

I given tpa permission to player but when player does they dont have permission, how to solve this when i give player op they can use tpa permission help me plzzz

#

Plzz help me naaaa plzzz

vague oracle
opal sluice
#

Hey, what would be the best way to save data on disable to a sql db ?

#

Imagine of course, that there are several players and each player has to save his data inside the db

jaunty ruin
#

Is there a plugin that can track a certian item weather its in a players inventory or in a chest?

#

Also one that prevents a certian item from entering a enderchest

latent dove
#

One"

jaunty ruin
latent dove
#

Xd

#

I just woke up so that's 1 good way to wake up

jaunty ruin
#

pogg

latent dove
#

Addme

jaunty ruin
#

aightt

wispy bridge
#

As comparing player objects directly means that when they die or relog they are no longer the same player object

latent dove
#

I mean you can just make a loop if necessary and get the event's player name and do this 'Bukkit.getExactPlayer(String);'

wispy bridge
#

Much better to just save UUIDs instead

latent dove
#

Yeah sure

mild forum
#

im spawning a WitherSkull and i want to set its speed, i have

Vector speed = player.getEyeLocation().getDirection().multiply(5);
ws.setVelocity(speed);

this is the only way its wokred and it dosent really work, its just kinda stops after a second and goes at a normal speed

young knoll
#

player.launchProjectile will automatically set the velocity

#

But you may have to override it each tick with a witherskull

mild forum
#

deam that's cringe

lavish hemlock
#

dream is cringe, you're right

whole flame
#

I noticed a small flaw in the rules posted on the spigot site and wanted to see how some situations would be handled

#

So when writing kotlin plugins not everything directly translates to java and there aren't really kotlin decompilers

#

so how would this rule be applied?

#

Even kotlin decompiled to java is very hard to understand so I wanna see how this edge case is treated.

barren nacelle
#

Can someone help? I made this code for a blank gui when /gui is done but the plugin does not print anything to console OR show up with /pl

#

And if I somehow got my plugin.yml wrong here it is too:
version: 1.0
name: Update Gui
main: gui.that.will.be.updated.Main
commands:
gui:

quaint mantle
barren nacelle
quaint mantle
#

remove if (cmd.getName()...)

young knoll
#

You do not need to setExecutor to your main class

quaint mantle
#

since when

quaint mantle
#

look in your console

barren nacelle
young knoll
#

The main class is the default executor

barren nacelle
barren nacelle
quaint mantle
#

it tells you

#

get rid of the space in the name

#

plugin.yml

barren nacelle
#

Oh ok (I thought it was the name of the .jar file)

slim wing
#

Hi all, I'm new to plugin development and I have been finding it really hard to learn how to create scoreboards for players for 1.17. I've followed 3 tutorials now (The only ones that show up when searching for a tutorial) and they don't show anything when in game. I dont have any errors in my code and its exactly how they have written theirs. Is it just a version thing? I must be missing something right?

#
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.*;

public final class UntitledPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        // Plugin startup logic
        this.getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        createBoard(event.getPlayer());
        if(Bukkit.getOnlinePlayers().isEmpty())
            for(Player online : Bukkit.getOnlinePlayers())
                createBoard(online);
    }

    public void createBoard(Player player) {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        Objective obj = board.registerNewObjective("InfoGUI", "dummy", "Information");
        obj.setDisplaySlot(DisplaySlot.SIDEBAR);

        Score score4 = obj.getScore("=-=-=-=-=-=-=-=-=-=-=-=");
        score4.setScore(4);

        Score score3 = obj.getScore("Information");
        score3.setScore(3);

        String time = String.valueOf(Bukkit.getWorld("world").getGameTime());

        Score score2 = obj.getScore("Time: " + time);
        score2.setScore(2);

        Score score1 = obj.getScore("=-=-=-=-=-=-=-=-=-=-=-=");
        score1.setScore(1);
    }

}
#

There is my most recent attempt. The only difference from my code to the tutorials is the text inside my scores.

waxen plinth
#

But you don't seem to be assigning the player to view that scoreboard

#

You have to call player.setScoreboard(board);

slim wing
#

That worked! Thanks so much. Spent too much time on this I feel like lol

vague oracle
#

Why do you create another scoreboard for everyone when someone joins

young knoll
#

Yes

whole flame
sullen marlin
#

seems like a hypothetical question

#

do you have an example

waxen plinth
#

Kotlin compiles to sane java from what I have seen

#

It's intended to be cross-compatible; you can use kotlin libraries in java, and vice versa

#

A downside of kotlin is that it drastically inflates jar files though, stuffs a bunch of kotlin standard library stuff in there

drowsy helm
#

idk if im missing something but does spigot mess with java.sql stuff? I tried to run simple sql code in a plugin and it keeps telling my ResultSet is closed, however when i try outside of a plugin environment it works fine

plain helm
#

You can write sql code in your spigot project

drowsy helm
#

what

drowsy helm
#

nvm im just dumb, i put my statement in a try with resources, forgot that closes anything after lmao

burnt current
#

Hey! Quick question: I have created the following listener:

@EventHandler
    public void movelistener(PlayerMoveEvent event) {
        Player player = event.getPlayer();
        if(player.getLocation().getZ() >= Main.instance.getConfig().getDouble("destination.z")) {
            Location fireWorkloc = player.getLocation().add(0, 0, 2);
            fireWorkloc.getWorld().spawnEntity(fireWorkloc, EntityType.FIREWORK);

            Bukkit.getScheduler().runTaskLater(Main.getPlugin(), () -> {


                    Location location = (Location) Main.instance.getConfig().get("location");
                    event.setTo(location);

            }, 100);

        }
    }

I have the problem that everything in the runtasklater method is not executed. Does anyone know why?

quaint mantle
#

try Main.instance.getConfig().getLocation(path) as it is default now

opal juniper
#

the event would have already finished long ago

#

5 seconds later means that the event would have already run and finished

#

you will have to tp them or something

quaint mantle
#

^^

quaint mantle
burnt current
quaint mantle
burnt current
#

yes that is a good idea. Until now, I had only saved the z coordinates individually there.

tacit dagger
quaint mantle
#

and if you think it is really an error

#

post the log

tacit dagger
quaint mantle
solid cargo
#

@tacit dagger go to plugin.yml, and make it as a dependency

#

pretty easy stuff

#

like this

#

but you replace Netherboard with ArmorEquipEvent

tacit dagger
#

ahh okay thanks

solid cargo
#

np

tardy delta
#

hey if i colourize a string and then replace a part of the string, will that replaced part be colored or not?

#

like i colourize this and then replace the {0}
"&aSuccessfully set your new home ( &6{0}&a )."

plain helm
#

Yes

tardy delta
#

oki

#

i guess because &.. is converted to the ChatColor enum and that stays there

plain helm
#

Yep

#

I can confirm because i tested it myself

#

This is a line from the config file of one of my plugins %prefix% &b%player% Has been jailed!

#

Even if you replace %prefix% with “&a[Hello]” if there is ChatColor.translateAlternateColorCodes (idk if the method is exactly this) it will be a green [Hello]

proud fiber
#

How do I get a config in another class

vagrant stratus
#

?paste

undone axleBOT
vagrant stratus
proud fiber
vagrant stratus
proud fiber
#

👍

vagrant stratus
#

so again, learn java first.
This is all basic knowledge

proud fiber
#

I am learning while coding the plugin

vagrant stratus
#

learn first, then you won't be asking simple questions like this

#

just about any tutorial goes through the exact question you asked

tardy delta
#

is there no Map.of(K, V) method somewhere?

vagrant stratus
tardy delta
#

smh me using java 8

ivory sleet
#

ImmutableMap.of

tardy delta
#

mmmh yea

vagrant stratus
opal juniper
ivory sleet
#

Map.of returns an immutable map impl tho

ivory sleet
#

So in principle they’re equivalent in terms of what they achieve but Java’s hiding it thus breaking liskov principle Ig

tardy delta
jovial nymph
#

is there a way to set inventory title without createing a new one?

tardy delta
#

i don't think there is

jovial nymph
#

ok ty

tender shard
#

does someone know how fast allatori responds to purchases?

#

I didnt get any information from them after the purchase lol, not even an email

vagrant stratus
#

lol that can be reversed easily

tender shard
#

that's not the question

quaint mantle
#

@vagrant stratus hi

#

Can i have help?

vagrant stratus
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. Create a thread in case the help channel you are using is already in use!

vagrant stratus
quaint mantle
#

The plugin rainbowpro i want get the normal not pro

tender shard
#

I don't think so. after starting to use allatori I haven't ever seen my plugins on warez sites anymore

quaint mantle
#

How to get it

vagrant stratus
quaint mantle
#

😐

vagrant stratus
ivory sleet
quaint mantle
vagrant stratus
#

I don't know

quaint mantle
tender shard
#

does a free version even exist?

ivory sleet
ivory sleet
#

No worries 👍

tardy delta
#

what's better: an abstract class or a private constructor? (both dont have instances)

pastel mauve
#

Hey, does somebody know how to do a Scoreboard Plugin in Spigot 1.17.1?

#

I would just need to know how to set it up

tender shard
pastel mauve
#

rn i got this piece of code but i dont know what i can change:

#

public void createBoard (Player p) {
Scoreboard board = (Scoreboard) Bukkit.getScoreboardManager().getNewScoreboard();
Objective obj = board.registerNewObjective("mainscoreboard", "dummy");

    obj.setDisplayName("§6§lScoreboard");
    obj.setDisplaySlot(DisplaySlot.SIDEBAR);
    obj.getScore("Teams§8:").setScore(14);

    p.setScoreboard(board);
}
jovial nymph
#

what is the event name for leting go of an item

#

in inventory

tender shard
jovial nymph
radiant oak
#

is there a way to check wether a user has forge or not and if so, it will give them the custom item. i want to be able to have a minecraft rpg server in which people can connect even if they dont have the mod installed but the mod will improve their experience. ik its a lot to ask but it would be kinda cool

tender shard
#

InventoryClickEvent, getAction will be Action.DROP or sth like that

jovial nymph
#

thank you

tender shard
#

I sometimes hate IntelliJ. All dependencies are setup correctly but intellij simply doesnt see them after restarting... invalidating caches also doesn't help....... >.<

#

this only seems to happen using the Ultimate Edition... never had this problem before switching to IDEA Ultimate -.-

proud fiber
#

MY EYES AAAAAAAA

tender shard
pastel mauve
#

xD

hasty fog
#

light mode keeps you awake

#

no more coffee needed

tender shard
#

but for real... what's wrong with IntelliJ... it compiles fine >.<

proud fiber
#

I use eclipse cuz it's much simpler tbh

tender shard
#

I actually think eclipse is much more complicated^^

#

I switched from Eclipse to IntelliJ about a year ago or sth

hasty fog
#

shading is hard in eclipse

tender shard
#

well, maven does the shading

#

for me

hasty fog
#

yeah but setting everything up in general

#

basic stuff eclipse is fine

tender shard
hasty fog
#

maven is easier on inteliJ

tender shard
#

maybe I should upload it to github so other people can contribute

#

yaaay

#

IntelliJ just fixed itself

tribal holly
#

is it possible to serialize an itemstack via object output stream ?

#

i don't wanna use base64 to wright it

opal juniper
#

a single itemstack?

tribal holly
#

yep

#

i have an object which contain a variable itemstack and i wanna serialize this object

#

but itemstack is not serializable

opal juniper
#

take a look at that

tribal holly
#

already look

#

but has i said i cannot use base64

#

i just wanna use oos

opal juniper
#

why cant you use b64

tribal holly
#

how do you serialize an entire object with a partencoded in base64 ?

#
public class Stand implements Serializable {

    public static List<Stand> serverStands = new ArrayList<>();
    public static String shopName = "§6Stand";

    private ItemStack item;
    private int price;
    private Location location;
    public static NamespacedKey shopKey = new NamespacedKey(Histeria.getInstance(), "stand");
    private final String uuid = UUID.randomUUID().toString();
...
...
}```
quaint mantle
#

How do i customize max enchant levels with enchant gui?

tribal holly
#

i wanna serialize Stand object which contain an itemstack

opal juniper
#

write object to outputstream

tribal holly
#

but here it only write itemstack object

#

not an object containing an itemstack

opal juniper
#

try writing ur stand

#

and see how it goes

quaint mantle
#

How do i customize max enchant levels with enchant gui?
1.17.1

tribal holly
#

NoSerializableException : itemStack

tribal holly
opal juniper
#

you need to implement

#

org.bukkit.configuration.serialization.ConfigurationSerializable

#

and implement the method

quaint mantle
#

How do i customize max enchant levels with enchant gui?
1.17.1

quaint mantle
#

ok

#

i just want a awnser