#help-development

1 messages ยท Page 266 of 1

young nimbus
#

thank you ๐Ÿ™

#

i dont know hahah mybe im just too tired

#

should go to bed

sterile axle
#

Also I know you didn't ask but those == comparisons are going to lead to some annoying bugs down the line

#

You need to use .equals for object comparison

dry forum
#

                wc.environment(World.Environment.NORMAL);
                wc.type(WorldType.FLAT);
                wc.generatorSettings("2;0;1;");

                world = wc.createWorld();``` https://pastebin.com/f3JHGbpe why am i getting this error
young nimbus
sterile axle
#

np

#

(line 54 specifically, comparing against null is fine to use ==)

sterile axle
dry forum
#

ok thanks

sterile axle
# dry forum doesnt work with spigot either

It appears to be an issue with something PersonalMines is doing, so you'd probably want to talk to the author. It's producing malformed JSON. So as the error says, they can turn on lenient mode. Or they can fix their JSON.

dry forum
#

iits my plugin

sterile axle
#

Ok well, without seeing the json I couldn't tell you. But it's quite clear.

dry forum
#

json for what though

sterile axle
#

You have malformed json. Turn on lenient mode, or fix your json.

dry forum
sterile axle
#

Not sure then. Json is being used somewhere internally. Maybe the generator settings? That's a complete guess however. Maybe someone else knows more

dry forum
#

alright thanks anyway

velvet chasm
#

Does anyone know how I could code a plugin like lifesteal?

jagged monolith
#

Depends what you're wanting to do, but the first step is getting your ide ready and make sure you know what you're wanting for the plugin.

velvet chasm
#

I have made a project in Intellij

jagged monolith
#

Then you need to work out what you're wanting the plugin to do exactly and make sure you've added the required dependencies into the build file etc..

velvet chasm
#

It has spigot in there. What else would be required?

#

I am coding a plugin with a few things. One of the things is lifesteal but they loose a random amount of hearts from 1 to 3.

jagged monolith
velvet chasm
#

You kill someone they lose anywhere between 1 - 3 hearts and you gain those hearts.

atomic swift
#

whats the event for player kill

#

so i can do event.getKiller()

jagged monolith
atomic swift
#

ye im a little dum lol

jagged monolith
jagged monolith
velvet chasm
jagged monolith
#
@EventHandler
public void deathEvent(EntityDeathEvent event) {
  // Your code here
}
#

Make sure the class implements Listener

#

An that you registry the event in your onEnable method.

velvet chasm
#

Okay now how would you code it to randomly take away 1-3 hearts?

jagged monolith
#

Get the player from the event, use the setdamage method and take the health away

velvet chasm
#

Not health. Permanent hearts.

jagged monolith
#

Same thing, Then you'd probs use something like setMaxHealth to change how much health they have.

velvet chasm
#

Okay.

#

How do you get the player from the event?

white root
#

Probably just event.getPlayer()

river oracle
#

My just use docs

velvet chasm
#

Okay.

white root
#

Google or stackOverflow might know

sterile token
river oracle
sterile token
sterile axle
#

In general, taking a list and turning it into a single entity is a reduction. You can do it manually by creating a new document and looping your list and somehow serializing them all into one or you can use streams and use the reduce method. It's not mongo specific.

jagged monolith
sterile token
velvet chasm
#

Yes well I am used to c++ so this is a little different.

sterile token
#

You can use them when you are coding, they tell you everything about a library

velvet chasm
#

It hurts my eyes.

sterile axle
sterile token
sterile axle
#

?

sterile token
#

If you dont wanna use it, its not our reponsability

sterile axle
#

You want to append a list of documents into a single document. So you can loop your list of documents and repeatedly call #append or you can try to find a more apt method that does the job. I don't know what answer you want.

jagged monolith
velvet chasm
sterile token
sterile axle
#

Chill, the point already got made

sterile token
#

ok i seee ๐Ÿ‘€

velvet chasm
#

I have a listener and stuff that does the things using java docs and stuff but how do I use it in the main plugin class?

sterile token
jagged monolith
velvet chasm
#

plugin

jagged monolith
#

That's almost just as bad as Main...

sterile token
#

?main

jagged monolith
#

^ that definitely applies

velvet chasm
#

Why does setMaxHealth have a line that goes through it?

sterile axle
#

That means it is deprecated and there is an alternative method to use instead. If you hover over it, the Javadoc should indicate the preferred method to use

vapid grove
#

How would I detect an item being added into the inventory?

#

(ChestGUI inv)

river oracle
#

Inventory click even you'd be looking for cursor having an item on it

#

And then make sure it's in the chest gui by making sure it's In top inventory

vapid grove
#

what if your shiftclicking an item

river oracle
#

You can check click type

#

Shift clock is prob a type

#

Everything yoh need is in inventory click event though

regal scaffold
#

How can I spawn particles not in a terribly random way using

#

p.getWorld().spawnParticle(Particle.FLAME, p.getLocation(), 5, 2, 1, 2, 0.);

#

The area is so wide I can't just get it to be a tiny particle spot

vapid grove
#

do you mean you want it to spawn more particles in that area

#

or for it to be smaller

#

i dont understand your issue

regal scaffold
#

I wanna concentrate that mess of a particle radius

#

Into a smaller area in front

#

Like a "dot" of some sorrt

#

@vapid grove

velvet chasm
sterile axle
#

If your IDE isn't showing you the full javadoc then you can go to your web browser and look at the full javadoc instead

velvet chasm
#

Okay another issue. I have put the plugin in my plugins folder and when I do /pl it says 0 plugins.

sterile axle
#

Then look at the console for any errors.

#

Did you include a plugin.yml file?

velvet chasm
#

Don't you just move jar file in?

sterile axle
#

Yes but your jar file needs to contain both the code and a plugin.yml file so that Bukkit knows what to do with it.

velvet chasm
#

ahhhhhh now where do I find that yml?

sterile axle
#

You have to make it...

velvet chasm
#

Oh I found it.

sterile axle
atomic swift
atomic swift
sterile axle
#

use the documentation

#

1+ makes no sense. Other than that, hover your mouse over the red underlines and see what it is telling you

atomic swift
#

ik

#

their all final modifiers

sterile axle
#

The IDE is not magic. It tells you exactly what the problem is.

atomic swift
#

and the run is to remove the @Override

river oracle
undone axleBOT
atomic swift
river oracle
#

No you don't

sterile axle
#

Clearly....you don't

velvet chasm
sterile axle
#

If you're not using maven or gradle, then just put it in the project root folder.

jagged monolith
velvet chasm
#

Okay.

sterile axle
#

If you know Java so well, then you know how to hover your fucking mouse over the red squiggles and find what the problem is.

#

Once you find that problem, come tell us

#

Then we can help you

#

No point in trying to flex your skills when you can't even help us help you

river oracle
#

Use your ide if you claim to know what the fuck is going on

atomic swift
#

BRO why does it make me remove the @Override

sterile axle
#

Why don't you HOVER YOUR MOUSE OVER THE ERROR and figure out what it says instead of just going with the default suggestion

river oracle
#

Also just use a lambda

atomic swift
#

THERE IS NO ERROR

river oracle
#

There's no reason not to use a lambda

sterile axle
#

Does it say you're not overriding the method properly? As in the signature does not match what it should?

#

Because that is

#

In fact

#

Believe it or not

#

AN ERROR

sterile axle
#

Woah!

#

Crazy!

#

You're not overriding the method properly!

atomic swift
sterile axle
#

@FunctionalInterface

#

() -> {}

river oracle
#

Mans doesn't know what a lambda is yet knows java interesting

#

Fairly basic concept

atomic swift
#

IK

velvet chasm
sterile axle
#

Did you use maven or gradle? If not then you don't have that folder.

velvet chasm
#

Maven

sterile axle
#

src/resources

velvet chasm
#

Okay.

sterile axle
#

wait no

#

src/main/resources? shit i dont even remember the folder structure

atomic swift
velvet chasm
#

Found it

sterile axle
#

mate

velvet chasm
#

Plugin.yml is there.

#

Why does it not work?

sterile axle
#

scheduleSyncRepeatingTask(plugin, () -> ..., 0, 20);

jagged monolith
velvet chasm
#

Yeah I have it.

#

But it still does not show up when I do /pl

sterile axle
jagged monolith
undone axleBOT
velvet chasm
#

Okay.

sterile axle
#

make sure it is plugin.yml, not Plugin.yml

atomic swift
sterile axle
#

sir

#

a runnable is a functional interface, a lambda will handle that

atomic swift
sterile axle
#

im gonna go shoot myself

velvet chasm
#

[15:32:41 ERROR]: Could not load 'plugins\1-1.0-SNAPSHOT.jar' in folder 'plugins': uses the space-character (0x20) in its name

sterile axle
#

good luck

atomic swift
velvet chasm
#

oh I see how to fix it I think

river oracle
jagged monolith
velvet chasm
#

That was the part about the plugin though.

sterile axle
#

Yes it just means you cannot put a space in your plugin name in the plugin.yml file

sterile axle
# atomic swift same

Notice you are not overriding runnable. You are making a new runnable. That's not subclassing, it's providing an immediate instance of the runnable class. There is nothing to override. You can move it to a different class and then implement Runnable and voila your override will work. Or you can use it as a functional interface like most people would when an explicit subclass is not required and just provide a lambda.

#
void someMethod(Runnable r) {
 r.run();
}

// ok
someMethod(new Runnable() {
  public void run() {
    //blablabla
  }
});

// better if you don't need the full Runnable
someMethod(() -> { //blablabla })
#

that's as much as I'm willing to provide you

jagged monolith
#
    Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, messageAnnouncements::broadcastAnnouncements,
    20L * plugin.getSettingsHandler().getConfigFile().getConfig().getInt("Announcement_Messages.Interval"),
    20L * plugin.getSettingsHandler().getConfigFile().getConfig().getInt("Announcement_Messages.Interval")
    );

Then there's mine, to add more confusion ๐Ÿ˜›

sterile axle
#

hot

river oracle
#

He knows java guys he should beable to break it down

sterile axle
#

meh

#

im goin back to YT

river oracle
#

Fairrrr

vapid grove
#

if i set language level to the highest will that break spigot in any way?

#

like am I allowed to do that or should I keep it at my current language level for intellij

sterile axle
#

You can set it as high as you want, but you usually want to set it to the minimum version that a server will be running so that you don't use features that aren't available for the user(s)

jagged monolith
vapid grove
#

its for my mc server

sterile axle
#

Language level as in Spigot's api-version annotation or the Java language level?

#

If you only plan to run your plugin on your own server then you can set the Java language level to whatever version of Java is running on your server

vapid grove
#

java language leve

#

*level

vapid grove
#

oh cool

sterile axle
#

For a public plugin, you'd decide whatever minimum Java version to support and set it to that. I usually choose the latest LTS

vapid grove
#

i got 0 clue what version of java version my server uses however

sterile axle
#

Well, ask. But 17 is the latest LTS so it might be a safe bet I guess.

vapid grove
#

okay so 15 should be fine then correct?

sterile axle
#

Likely fine

#

But you'd need to ask your host

#

If they're worth their salt, it is probably fine since they're likely running 17 or newer

vapid grove
#

but from what i can tell they automatically use the latest version

jagged monolith
#

Ask them

vapid grove
#

i did

#

they arent online lol

jagged monolith
#

Then wait

river oracle
#

Just use j17

sterile axle
#

Seems they let you choose your own version.

#

so choose your own and set it to that.

jagged monolith
#

If you're using 1.19.x Then just stick with Java 17

sterile axle
#

17 is a safe bet

atomic swift
#

how do i clear scoreboard slots

vapid grove
#

oh ok cool

vapid grove
#

Will 2 bukkitrunnables run back to back without issue like so?

new BukkitRunnable() {
            boolean done = false;

            @Override
            public void run() {
                if(done) return;

            }
        }.runTaskTimer(Main.instance, 0, 20);

        new BukkitRunnable() {
            boolean done = false;

            @Override
            public void run() {
                if(done) return;

            }
        }.runTaskTimer(Main.instance, 0, 20);
#

or will only the top once run than the second one after the first one is complete

#

also, is the period auto set to 1 even if you say its 0

#

or does 0 just mean runs every frame or whatever

drowsy helm
#

that is the point of a runnable

vapid grove
#

oh good

drowsy helm
#

wait no

#

one at time

#

if its not async

vapid grove
#

oh

jagged monolith
#

1st one will run, then the 2nd one will be queued till the 1st is done

vapid grove
#

ok noted

#

does a period of 0 btw just auto equal 1 tick

#

or do i need to specify it as 1 normally

jagged monolith
#

0 means instantly I think never tried it though

eternal oxide
#

always a minimum of 1 tick

drowsy helm
#

it defaults to 1

vapid grove
#

ty

#

srry for so many questions

eternal oxide
#

Only way to learn

regal scaffold
#

Is the client/server system time unsynchronized?

#

Is the client/server system time unsynchronized?

How can I fix this spam in console

sterile breach
#

How to change eseentials'message can create an language file? Edit source code ?

jagged monolith
vapid grove
#

how do I get the slot of the cursor from InventoryDragEvent

rotund ravine
#

Update ur server @regal scaffold

regal scaffold
#

1.19.2

#

@rotund ravine

jagged monolith
vapid grove
#

after

jagged monolith
#

getCursor()

vapid grove
#

doesnt that give the itemstack

jagged monolith
vapid grove
#

is PLACE_SOME just ALL, ONE, and HALF combined

#

for IventoryAction

vapid grove
#

Yea I read that but I dont understand it @sterile axle

#

First thing I checked before I msged here

#

Place_Some doesnt exact strike as explanitory

sterile axle
#

I am pretty certain you can assume it is more than one, and less than all.

jagged monolith
vapid grove
sterile breach
#

What is a server core ?

vapid grove
#

incluiding one, half and all

jagged monolith
sterile axle
#

They might be asking about plugins that noob developers call a "core"

#

For some reason makes them cream

jagged monolith
sterile breach
jagged monolith
#

Huh? You just download the one you want to use. Whether that be Spigot, Paper, etc.. You don't need to compile anything

#

Don't use custom ones. Use already compiled ones

drowsy helm
#

how is it custom

#

do you know what has been changed

jagged monolith
#

It's best to always avoid custom ones. Because you'll likely not get much support using a custom one.

#

Because no one knows what exactly is "custom" about it. And depending where you got it from, it could contain malicious code.

drowsy helm
#

sounds malicious

jagged monolith
#

That screams red flags.

#

I would never trust something like that.

drowsy helm
#

what does the plugin do that requires a custom server jar anyway

jagged monolith
#

probs nothing good. An some janky horrible code

sterile breach
#

Its a claiming plugin

drowsy helm
#

like land claiming?

#

why does it need a custom jar

#

there are VERY few use cases where a plugin needs a custom jar and those plugins do some crazy stuff

jagged monolith
#

Sounds too sketchy, Use a more well known land claiming plugin

orchid gazelle
#

Either something made extremely bad and dumb or straight up a virus

#

its that simple lol

jagged monolith
#

Just delete that plugin and the custom core, An just use more well known an trusted ones

orchid gazelle
#

Yeah

sterile breach
#

Okay thanks

wet breach
velvet chasm
#

When I use event.getEntity().setMaxHealth(2); it does not work.

mighty pier
#

send full code

velvet chasm
#

Wait I think it just wanted me to use GENERIC_MAX_HEALTH instead

#

import org.bukkit.Bukkit;
import org.bukkit.attribute.Attribute;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.PlayerDeathEvent;

public class DeathHandler implements Listener {

public void deathEvent(PlayerDeathEvent event) {
    event.getEntity().getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(2);

}

}

#

That should work right?

harsh totem
jagged monolith
#

?paste

undone axleBOT
jagged monolith
#

Please use that when sharing code.

velvet chasm
harsh totem
velvet chasm
#

No

#

Max health goes to 1 heart after they die.

#

So they only have 1 heart to live with

harsh totem
#

ok

sterile axle
#

It should work but you forgot the @EventHandler annotation.

velvet chasm
#

OH THANKS

sterile axle
#

However, it might be better to use an attribute modifier rather than setting the base value (upon which all the other attribute modifiers are then applied.)

velvet chasm
#

How would this be done?

sterile axle
#

Though that's nitpicky and may not matter for your case

jagged monolith
#

An you need to make sure you register the event in the onEnable method.

harsh totem
sterile axle
#

There should be an add modifier method rather than the set base value method

#

Check the docs

#

But again depending on what else is running, it may not even matter

velvet chasm
#

Is there anything wrong with this script?

drowsy helm
#

yes

sterile axle
#

The @EventHandler is not in the right place.

drowsy helm
#

why is there a random @EventHandler annotation

velvet chasm
#

Where should it be?

drowsy helm
#

and lowcase p

sterile axle
#

That needs to go on your listener's event handler method.

sterile axle
velvet chasm
#

Okay thanks

pastel peak
#

hello i am trying to make a plugin and ive never made one before ive gotten my plugin to compile i see in the console and plugin list in game but it doesnt seem to do what i think it should can someone look at the code and tell me where i might have gone wrong?

jagged monolith
#

?paste

undone axleBOT
pastel peak
jagged monolith
#

You need to example what you're wanting to achieve and what it's doing wrong

pastel peak
#

so basically it should listen for players commands and when someone does for example "/poll "what should i eat for dinner" "mac and cheese" "lasagna" it then broadcasts a message asking what should i eat for dinner with two clickable answers and then after 30 seconds it should give the results broadcasted to the chat

#

but it just says /poll is not a command

sterile axle
#

The command needs to be defined in your plugin.yml.

pastel peak
#

is this line not defining it?
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equalsIgnoreCase("poll")) {

sterile axle
#

That's defining the code for it.

jagged monolith
#

It needs to be in the plugin.yml as well

sterile axle
#

It needs to also be in your plugin.yml

jagged monolith
#

It also should be in your onEnable method. so it can be registered properly.

sterile axle
#

Just like just having a class extending JavaPlugin doesn't magically allow Bukkit to know about your main class, just having the onCommand handling code doesn't magically allow it to know about your commands.

#

The plugin.yml is your source of truth

pastel peak
#

okay thats fair completly new to all this i will see if i can figure this out ๐Ÿ˜„ thanks

sterile axle
#

np

velvet chasm
#

I want to take away -2 health from the max health. How would I change the setbasevalue so it does that?

sterile axle
#

you would get the current base value, subtract 2 from that, and then set the base value to that new value

velvet chasm
#

Yes but how do I get the current base value and put it into the parenthesis after setBaseValue?

sterile axle
#

I think if you apply yourself a little bit you will be able to get this

#

There is a method called setBaseValue. Is there an analogous method called getBaseValue?

#

What can you do then?...

velvet chasm
#

hmmm

#

one sec

#

Would you change the setbasevalue to getbasevalue then do -1? That seems wrong.

sterile axle
#

That's actually correct

#

You can make it a little cleaner but that's what you do.

velvet chasm
#

It goes red when I do that.

sterile axle
#

Let's see what your code looks like

velvet chasm
sterile axle
#

It's red because that method takes a double rather than an int, but that's not what you want to do regardless

velvet chasm
#

Okay

sterile axle
#

I'm not gonna write the code for you because there's value in figuring it out yourself

#

But I'll try to guide you

velvet chasm
#

Okay

#

But how do you call them both in one?

sterile axle
#

You'd just call getBaseValue inside of the parenthesis for setBaseValue. It works. getBaseValue returns a double which is precisely what setBaseValue wants as its input

velvet chasm
#

Oh okay

sterile axle
#

Functions can take in other function calls as their input, no problem

pastel peak
#

so i have my plugin.yml file and i think i set it to look for the command but it now says this when i run the plugin im not sure i did the yml file properly

java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "chatpoll.chatpoll.ChatPoll.getCommand(String)" is null
at chatpoll.chatpoll.ChatPoll.onEnable(ChatPoll.java:30) ~[ChatPoll2.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:372) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:550) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:624) ~[purpur-1.19.3.jar:git-Purpur-1876]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:538) ~[purpur-1.19.3.jar:git-Purpur-1876]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:310) ~[purpur-1.19.3.jar:git-Purpur-1876]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.19.3.jar:git-Purpur-1876]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[purpur-1.19.3.jar:git-Purpur-1876]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]

tardy delta
#

Register command in plugin yml

sterile axle
#

?paste

undone axleBOT
pastel peak
sterile axle
#

Put your yaml file on there

#

Thanks

pastel peak
#

this is my yml file

sterile axle
#

That looks ok

#

Hold on

velvet chasm
sterile axle
#

That method is returning null

#

line*

gilded knot
#

Yo so uh I'm making a custom AirDrops plugin

#

How do I edit the stuff inside the chest

sullen marlin
#

?jd

sullen marlin
#

You can't easily, falling blocks can't have tile entities

#

Long way - set PDC With items and then set on falling block event

#

Always forget which event that is

#

?pdc

velvet chasm
gilded knot
#

right

sterile axle
velvet chasm
sterile axle
#

Yes just use a bound of 2. That will let it generate any of 0, 1, and 2. But then if you add one each time, it will be generating any of 1, 2, and 3.

velvet chasm
#

Okay that does make sense.

sterile axle
#

Sorry, use a bound of 3. The bound is exclusive. So a bound of 3 will do 0, 1, and 2. A bound of 2 would be 0 and 1.

velvet chasm
sterile axle
#

If you put some code inside the first if block that drops an item, yes

velvet chasm
#

Yes thats what I was doing.

sterile axle
#

But it's worthy to note that computers can't do true randomness, so it might end up dropping items more often than you might expect. It's only pseudorandom. But it's close enough.

wary kettle
#

How do you convert a furnace block to a org.bukkit.material.Furnace instance

#

I tried the getType and getState

#

i got it

#

it was getState.getData

#

weird

velvet chasm
#

How do I make lore for items?

jagged monolith
velvet chasm
#

Why cant I just ("do this")?

#

How do I type in it?

tardy delta
#

It's a list of strings

jagged monolith
#

get the item, get the items meta, then do a setLore() on that meta.

tardy delta
#

Use Arrays.asList

sterile axle
#

You might also be able to just use List.of("", ...), or if you have just one line to add, Collections.singletonList("")

tardy delta
#

Arrays.asList superior to List.of

sterile axle
#

I just bit my lip somehow

jagged monolith
#

@velvet chasm You do it like this

ItemStack item = new ItemStack(Material.STONE);
ItemMeta meta = item.getItemMeta();
meta.setLore(<The lore>);
item.setItemMeta(meta);
sterile axle
tardy delta
#

both do

sterile axle
#

Pretty sure you can modify elements in the list returned by Arrays.asList

#

You canโ€™t add elements to either

tardy delta
#

i believe set works

sterile axle
#

But mutation is different than addition of elements

#

Try mutating an element in List.of vs the other one

tardy delta
#

set works yes

#

List.of is completaly immutable

sterile axle
#

Yeah that's what I said

#

uncomment as necessary and play with it

#

it's as i originally said

#

but my point was, Arrays.asList is not necessarily superior. Sometimes we want completely immutability

tardy delta
sterile axle
#

That's weird

tardy delta
#

invalidate caches ig

#

doesnt work

#

wait why did i do =0

#

thats what 5 hours of sleep gives me

sterile axle
#

Ah indeed

velvet chasm
#

How do I check if the base value is = to 2?

sterile axle
#

just use getBaseValue and compare it to 2

velvet chasm
#

How do you compare it?

sterile axle
#

What do you think? :p

velvet chasm
#

Not actually sure for this one.

sterile axle
#

How to you check if something equals something else?

velvet chasm
#

==

sterile axle
#

:P

#

See you do know

velvet chasm
#

But how do I use it in this context?

#

Where would I put the ==?

sterile axle
#

Right after getBaseValue. Check if it equals 2 there and then finish the if statement's parenthesis

velvet chasm
#

omg how did I not figure that

#

Thanks.

sterile axle
#

np

velvet chasm
#

How do you get it to ban the event.getEntity?

sterile axle
#

I think the Player class has a method called banPlayer

velvet chasm
#

Can I get to that from event.getEntity?

sterile axle
#

Nvm wait, it doesn't. Might be on server

#

trying to find it

velvet chasm
#

Oh okay

sterile axle
#

but yes you can, you need to cast the variable

velvet chasm
#

Wait so how do I ban the player?

sterile axle
#

checking

velvet chasm
#

Okay

quaint mantle
#

guys i'm trying to make a plugin that shows a player head before the chat message

#

like the head icon on the default online player list

velvet chasm
#

Is that even possible?

sterile axle
quaint mantle
#

but i have no idea how to get the head icon via bukkit plugin

quaint mantle
#

i'm just guessing and it seems that packet modification may be required

sterile axle
quaint mantle
#

but i can't step further

velvet chasm
#

Alright.

sterile axle
#

Not sure exactly how to achieve what you want but good luck

quaint mantle
#

like this one

#

gosh this is really way far from my ability

sterile axle
#

Yup. Read that thread I sent. You'll need to change it for your purposes. It boils down to getting the player's skin from mojang's API and then doing something special with that data to encode it into chat.

#

That's how you'd start.

quaint mantle
#

oh

#

lol i just saw that

#

thx dude

dawn plover
#

hey, i want to make a async task in some kind of way. in c# you can just make a async task, but i coudnt find this
Though i know a tread also works async so this works fine
My question is, is this the best way to do it, or am i overcomplicating it
(for now i am making tick tack toe, so no big deal if its not optimal, but i am learning the good ways cus i am planning to make much larger games)
(Players can start a game by some kind of /start command, but i dont want bukkit to wait for the onCommand() return for as long as the game is going, so thats why i though making the /start command only call to the game as an async task)

sterile axle
#

Use Bukkit's scheduler

quaint mantle
#

maybe i have to start over there

ivory sleet
#

Starting new Thread objects just like that in Java is not cheap

dawn plover
sterile axle
#

๐Ÿ‘

sterile axle
velvet chasm
#

Thanks.

dawn plover
#

i changed the threads into this now, this works like it should, and this is also the best way you mentioned right?

Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> start_game(player1, player2) );```
ripe owl
#

https://github.com/PaperMC/Paper/tree/ver/1.8.8
I wanna compile this project (1.8.8 paperSpigot) but ./build.sh tell me always

cat: BuildData/info.json: No such file or directory
cat: BuildData/info.json: No such file or directory
Downloading unmapped vanilla jar...
The MD5 checksum of the downloaded server jar does not match the BuildData hash.```
eternal night
sterile axle
#

Let me guess. Banned in Paper?

eternal night
#

I don't think so ๐Ÿ˜‚

sterile axle
#

smh.

#

Alright heading off for real

ripe owl
eternal oxide
#

?1.8

undone axleBOT
ripe owl
#

I don't want to develop older version, but unfortunately I need to develop this right now

jagged monolith
ripe owl
#

I am trying to add patch in bukkit for my game server

#

I am new to modify bukkit and I think I need to compile it first in my situation

jagged monolith
#

1.8.8 is that old. It's pointless trying to patch it. It's that outdated.

vocal cloud
#

Why patch when you can just use a new version

orchid gazelle
#

I can understand that people are still using 1.8 tbh

ripe owl
#

yes i know but i should use 1.8. I have no choice

orchid gazelle
#

Some things were just better in 1.8

ripe owl
#

um

vocal cloud
#

Nothing that can't be added to the newer versions

ripe owl
#

I don't think so but

jagged monolith
#

Or probably already is in the new versions

orchid gazelle
orchid gazelle
ripe owl
vocal cloud
orchid gazelle
#

now its basicly required to use maven or gradle to use nms

vocal cloud
#

The new height limit?

orchid gazelle
jagged monolith
vocal cloud
#

Yeah show me the new height limit lmfao

orchid gazelle
orchid gazelle
vocal cloud
#

Mods not vanilla lmfao

orchid gazelle
#

Sure

ripe owl
#

And I hate older version because there is no blocks, no mobs, no api, no feature(resourcepack, etc..)

vocal cloud
#

I'm talking spigot

ripe owl
#

but right now I should use 1.8.9

orchid gazelle
#

Dude for Vanilla, you can't bring the argument that there is nothing you cannot add in new versions

ivory sleet
ripe owl
#

there is no other choice to me

ivory sleet
#

Pointless argument

orchid gazelle
#

Sure. Its just a theoretical view

jagged monolith
vocal cloud
#

We're in the spigot discord talking about adding features via spigot and you claimed you can add everything seemingly through spigot

orchid gazelle
ripe owl
#

no.. you can't impl some glitch like blockhit/bow boosting in server-side at 1.19

orchid gazelle
ripe owl
#

because it should be fix

eternal night
vocal cloud
orchid gazelle
#

Yeah and its still possible

#

My point is just that some things were better in 1.8.

ivory sleet
#

Scarcely

ripe owl
ripe owl
jagged monolith
#

If you depend on a bug or glitch... You are asking for trouble.

eternal night
#

well, the server jar is no longer hosted on the amazon download service

ripe owl
#

oh..

#

then that means I couldn't compile 1.8.8 paper spigot?

#

like literally outdated?

jagged monolith
#

1.8.8 is like 7 years outdated.

ripe owl
#

yes i know

#

I have said it many times. I know newer version is worthy and better than 1.8

#

I know that fact

eternal night
#

well

ripe owl
#

I prefer to develop newer version

eternal night
#

you just have to throw the actual jar in there

#
mkdir -p work/1.8.8; wget https://launcher.mojang.com/v1/objects/5fafba3f58c40dc51b5c3ca72a98f62dfdae1db7/server.jar -O work/1.8.8/1.8.8.jar
ripe owl
eternal night
#

into your terminal

ripe owl
#

ah

eternal night
#

git bash

ripe owl
#

ok thx

eternal night
#

or whatever you are using

#

yeet the work folder first

ripe owl
#

thx for help!

ripe owl
#

garbage version

eternal night
#

the fuck is 1.8.9 ๐Ÿ˜‚

#

that is not a server version

#

that is only for clients

#

the last 1.8 trashcan server is 1.8.8

ripe owl
#

gg give up

eternal night
#

I mean, 1.8.8 compiled fine for me

#

but probably for the best here

#

1.8.8 shall remain dead

ripe owl
#

I will never go down and make 1.8.8 server/contents

young belfry
#

hi some one can help me to create storage.yml file?

eternal night
#

Well yea kekw

reef turret
#

If I forcibly update my plugin to 1.19.2 from 1.17.1, will the code break? It is a very very simple plugin and should not be version dependent

river oracle
#

Just use the same jar

#

And upgrade your server as normal

terse ocean
#

Hey guys how do i make my config scorlable like here

river oracle
#

You can't AFAIK, but just put a spoiler if you don't want it to take up a ton of space

shell trench
#

What happens when I try to register a command that was already registerd by another pluggin?

eternal oxide
#

last to register gets control

shell trench
#

and how can a user execute the command from the first pluggin?

terse ocean
#

like how do I add the Code (Text) thingy when I upload a plugin?

echo basalt
terse ocean
#

thx man!

velvet chasm
#

I am doing custom recipes is it possible for me the ingredient a custom item?

wary kettle
#

Is there an easy way to get the depth of water without scanning the blocks until itโ€™s not water

wary kettle
velvet chasm
#

1.19.2

reef turret
velvet chasm
#

Are datapacks similar to plugins at all?

echo basalt
#

why tf would you run datapacks on a spigot server

wary kettle
reef turret
velvet chasm
#

I want to do it in my plugin

opal juniper
wary kettle
#

They handle all the annoying nuances with custom items nbts and duping

echo basalt
opal juniper
#

lol

velvet chasm
#

Is it possible to detect how many of an item is in a pile on the floor?

wary kettle
#

Yes

velvet chasm
#

How would I do that then

wary kettle
#

Cast it as an item entity then you call getitemstack().getamount()

velvet chasm
#

What kind of event would I use?

wary kettle
#

It depends where you need it?

velvet chasm
#

Well I want it to turn into something when 9 are thrown on the ground

wary kettle
#

Itempickupitemevent should already have a method that gives you the item entity

#

I think you want the item spawn event then

velvet chasm
#

Whats that?

wary kettle
#

Idk the exact name for it google it

velvet chasm
#

Okay.

#

Does it count as an item spawning?

wary kettle
#

Itโ€™s probably exactly that or similar

velvet chasm
#

Yeah

wary kettle
#

I think player dropping an item might be different I canโ€™t recall

velvet chasm
#

Okay.

wary kettle
#

It might be playerdropitemevent maybe idk

velvet chasm
#

I don't understand the javadocs. Any advice for understanding how it works?

wary kettle
#

Can you screenshot it so I can guide you

#

On my phone

velvet chasm
#

Well I cant send ss here.

#

I can dm it to you though.

echo basalt
#

y'all both are missing half the problems that can arise

velvet chasm
#

wdym

echo basalt
#

You'll need some kind of scheduler (items can move around y'know)

velvet chasm
#

Yeah you just gotta make sure to drop them into the stack

echo basalt
#

Or use some sort of ItemMergeEvent

velvet chasm
#

That might work better actually

echo basalt
velvet chasm
#

True

#

I will use the merge event then

#

How would I check if the merge event is my custom item?

echo basalt
velvet chasm
#

How do I see if it is the custom item I made?

tender shard
#

just use RecipeChoice.ExactChoice. It will then only work for exact matches. However it's only valid for shaped recipes, not for shapeless ones

velvet chasm
#

How do I spawn a custom ground item on the ground?

echo basalt
#

man thinks we're google

#

?bing

undone axleBOT
velvet chasm
#

already done that

velvet chasm
#

I am in the event that detects an itemstack of my custom items. Do I add code in that event to spawn the new item on the ground?

tender shard
#

if you want to spawn the item during that event, then yes, otherwise no

velvet chasm
#

I do.

#

So what code do I want to use

velvet chasm
#

Does the javadocs say how to put it into the script?

tender shard
#

script?

#

are you using skript or java

velvet chasm
#

Java

#

It is a scripting language

tender shard
#

it's not

#

anyway, the javadocs tell you exactly how the method works

#

it tells you which class / interface defines it ("World"), the method name ("dropItem") and the parameter types ("Location" and "ItemStack")

velvet chasm
#

Could you please explain to me what its telling me though? Because it says this:
@NotNull
Item dropItem(@NotNull
Location location,
@NotNull
ItemStack item)
Drops an item at the specified Location
Parameters:
location - Location to drop the item
item - ItemStack to drop
Returns:
ItemDrop entity created as a result of this method

#

Where in that does it tell me how I can use it

tender shard
#

it tells you that you can call a method on every "World" object that is called "dropItem" and takes a Location and an ItemStack as parameter

#

and if you don't know how to call a method, then you should check out this:

#

?learnjava

undone axleBOT
tender shard
#

wow thanks netbeans, very helpful project wizard

velvet chasm
#

I figured out how to do the drop item

#

How do I get rid of the old items on the ground?

tender shard
velvet chasm
#

Okay thanks for all the help

#

Despawn is something else in the javadocs

#

Yeah but I think despawn refers to something else

wicked remnant
#

looks like you're incorrectly checking if the items are what you expect them to be

#

you're doing
ItemStack == ItemMeta which will always be false because

  1. completely different class
  2. you don't compare equality of objects using ==, you do it with .equals()
  3. you probably shouldn't even be using .equals() to check if they are your special nether stars
sterile breach
#

hi, what on compiligne ij idea send
what?
import org.bukkit.inventory; (cannnot find symbole) ?

hushed spindle
#

you should use event.getEntity().getItemStack().equals(soul)

#

generally when using objects instead of primitive types or enums you should use .equals

#

when using primitive types like ints or booleans you should use ==

#

and like phin said an ItemStack will never be equal to an ItemMeta because they're different classes

#

yeah that too

#

anyway i was wondering if anyone here worked with campfire recipes and how i would be able to access the CampfireRecipe used when a campfire finishes cooking an item

#

because right now its looking like i manually have to figure out which campfire recipe is used in cooking

velvet chasm
hushed spindle
#

ok

#

there's another difference you should be aware of

#

.equals() will compare the items as they are exactly, that means if one stack has a different amount than the other it will not be equal

#

if you want to ignore amounts you should use isSimilar()

velvet chasm
#

Hmm

#

Okay

#

The soul block works but the souls dont get removed

eternal night
#

evil people would say, identify your custom items using a PDC entry

velvet chasm
#

Good thing I don't know what that is.

eternal night
hushed spindle
#

pdc truly is a blessing

velvet chasm
#

I am not on paper

eternal night
#

arbitrary data storage on a lot of things

#

spigot has it too

#

just no official doc ๐Ÿ˜…

#

?pdc

eternal night
#

there is also alex's tutorial somewhere

hushed spindle
#

but honestly man i dont think you're ready to make a plugin like that where you make a whole new custom crafting system with dropped items and stuff, i mean you could try but i wouldnt set your expectations too high

#

learn the basics of java first and the process will be much easier

velvet chasm
#

This is the only thing I am struggling with

#

I can do the rest

hushed spindle
#

i mean you were comparing an itemstack to itemmeta

#

i dont think you understand it yet

velvet chasm
#

Yeah Its 2 am

#

I understand what I messed up.

#

I just need the remove thing to work and I am done

hushed spindle
#

in which case its a little weird because .remove() should be working

velvet chasm
#

if (event.getEntity().getItemStack().isSimilar(soul)) {
if (event.getEntity().getItemStack().getAmount() == 9) {
event.getEntity().getWorld().dropItem(event.getEntity().getLocation(), soulBlock);
event.getEntity().remove()

#

It does not get rid of it

hushed spindle
#

and it is spawning the result item?

velvet chasm
#

Yes.

hushed spindle
#

no exceptions?

velvet chasm
#

What does that mean?

hushed spindle
#

like no errors in console

velvet chasm
#

I don't believe so.

#

I will check again

velvet chasm
hushed spindle
#

i mean something very scuffed you could do is teleport the item to below bedrock xd

tawdry cedar
#

Using version 1.19.3 - Buildtools are imported and like half of the classes have errors. Anyone know how I find the new names for the classes? https://imgur.com/koluJHs

velvet chasm
#

You know what I am doing it,.

#

this is so scuffed lol

hushed spindle
#

afaik .remove() doesn't guarantee the entity's removal, it just sort of tells the game that this entity should be removed

#

but i dont know what conditions would have to apply for that not to happen

velvet chasm
#

How does it want me to put the location in for .teleport()?

tall dragon
#

by putting it between the brackets

velvet chasm
#

Like cords?

hushed spindle
#

well it either expects another entity or a location for its destination

tall dragon
#

no

#

a Location Object

hushed spindle
#

a location is an object

#

simply new Location(x, y, z)

#

world, x, y, z, if you feel so inclined

velvet chasm
#

So what would I do to make it go under bedrock?

hushed spindle
#

wouldnt make sense in this scenario though

tall dragon
tawdry cedar
#

I have been on this website

#

And it doesn't show there is a difference in the names in 1.19.3

tall dragon
#

do u mean

#

?bootstrap

tawdry cedar
#

(I am updating the code from 1.19.2 - 1.19.3 btw)

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

hushed spindle
#

๐Ÿ—ฟ

velvet chasm
hushed spindle
#

i dont think teleport likes it when you try to teleport something to unloaded chunks

tall dragon
#

it should work

#

just laggs ๐Ÿ˜„

hushed spindle
#

just use the entity's x and z and a low y

tall dragon
velvet chasm
#

I want the entity to under bedrock.

tall dragon
#

in what way

velvet chasm
#

Because .remove isn't working

undone axleBOT
hushed spindle
#

also does anyone happen to know how to get the CookingRecipe associated with a campfire finishing a cook

#

yeah but this guy is new at this so maybe he'd take it literally and complain it doesnt work

undone axleBOT
hushed spindle
#

yeah its quite literally a skill issue

sterile breach
#

what??

#

i can not import this?

import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.event.block.Action;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionEffect;
import org.bukkit.inventory;

#

mmmh

#

what is the difference betwen import org.bukkit.inventory; and import org.bukkit.event.block.Action;?

tall dragon
#

the fact that they import something else ?

sterile breach
#

aaah okkay

#

so what is the inventory class?

hushed spindle
#

after experimenting a bit it looks like the only events relevant for campfire recipes are BlockInteractEvent for when you put something on a campfire, and BlockCookEvent which has no knowledge of the CookingRecipes used and neither does the campfire, how can i figure out which recipes are used without manually looping through each campfire recipe and determining the recipes based on that

sterile breach
#

i make a gui

hushed spindle
#

or do i need to do this the annoying way

solemn meteor
#

Does setWalkSpeed apply just the speed of the player before the speed calculation or the final speed? If I'm making sense here

tall dragon
hushed spindle
#

yea

#

i wanna make it so the resulting items change depending on player stats

#

so regular campfire recipe implementation doesnt work enough

tall dragon
#

ah yea

solemn meteor
tall dragon
hushed spindle
#

damn

#

manually figuring out recipes it is then

solemn meteor
river oracle
#

The former seems the most logical atleast no harm in trying and seeing though

hushed spindle
#

setWalkSpeed probably just sets the player's default movement speed, which sprinting would then speed up

river oracle
#

Thats indeed how that works sir afaik

solemn meteor
#

Alright alright thanks for the help!

hushed spindle
#

im doing something similar except with sneaking where with a PlayerToggleSprintEvent you could change the player's walking speed to be faster (or sprinting slower) to have both of them match

velvet chasm
#

It keeps going red

hushed spindle
#

but you'd have to look up exactly the speed multiplier for sprinting

river oracle
#

!learnjava!

tall dragon
river oracle
#

Please

undone axleBOT
tall dragon
#

e.g just an example not the exact way to type it out

#

so u cant copy paste that

river oracle
#

My dumbass

velvet chasm
#

Material.air doesn't work

river oracle
#

Sl

hushed spindle
#

guy

river oracle
#

Sir

hushed spindle
#

go to bed

river oracle
#

No learn Java before coding with spigot

hushed spindle
#

also dont code plugins at 2am where your brain is running at -5% capacity

velvet chasm
#

This is the last thing I have to do.

#

I have got through the rest of the plugin already

river oracle
velvet chasm
#

I just need this to work

hushed spindle
#

yeah but not this guy

river oracle
#

Fr

hushed spindle
#

why do you have to finish it right now anyway just take your time

#

dont force it

velvet chasm
#

I used to do c#

river oracle
#

Gross

velvet chasm
hushed spindle
#

C# is nice shut up

#

but i kinda doubt it because C# is so super similar to java lmao

river oracle
#

C# is just offbrand Microsoft Java

velvet chasm
hushed spindle
#

makes for a more solid backend tho

#

oh unity

#

yeah nah

river oracle
#

Oh unity isn't c#

hushed spindle
#

that's scripting stuff

river oracle
#

That's fake scripting c#

velvet chasm
#

Got an error

#

Method call expected

hushed spindle
#

god

#

did you copy paste the code again

velvet chasm
#

No.

#

I didn't last time

hushed spindle
#

what does it look like

velvet chasm
#

I just did the same thing

#

Item item = event.getEntity();
item.setItemStack(ItemStack(Material.AIR));

hushed spindle
#

try putting new before the ItemStack air part

#

i swear man if you think you have enough of a grip on java you really dont

#

learn first

velvet chasm
#

IT HAS NO ERRORS

#

I CAN BARELY KEEP MY EYES OPEN

hazy parrot
velvet chasm
#

i gotta test

undone axleBOT
hushed spindle
#

what's happening here is that when you do ItemStack(Material.AIR) on its own the IDE thinks you're trying to execute a method with Material.AIR as parameter, except no such methods exist. but you dont really want a method, you want a class instance, so you want to do new ItemStack(Material.AIR)

#

ItemStack being a class and it has a constructor which takes a Material parameter like here, constructors are ""methods"" classes use to make instances of themselves

#

a class you can kinda see as the concept of a car but an instance of such a class would be an actual car

velvet chasm
#

Okay.

#

how long does it take to learn java

hushed spindle
#

the basics i'd say maybe a month

ancient plank
#

How fast do you learn

#

Is the correct answer

velvet chasm
#

Decently fast

hushed spindle
#

i mean you can learn the basics faster than that but if you want to understand it well it'll take longer, its not just about memorizing

velvet chasm
#

Yeah ima look at that stuff cos the plugin does not work

#

it said "cannot drop air"

ancient plank
#

Wow

hushed spindle
#

makes sense

velvet chasm
#

Well yeah I don't think minecraft works in those ways to drop air

hushed spindle
#

another thing you could try is delaying the .disable() method by a tick

#

also question

#

why do you specifically use the merge event for this

velvet chasm
#

Because then it runs when the 9 things merge

hushed spindle
#

one way to do it i guess

#

but yeah try delaying it by a tick

#

look up bukkit scheduler for this

velvet chasm
eternal oxide
#

?scheduling

undone axleBOT
ancient plank
#

๐Ÿ˜ฉ I wanted to do it

hushed spindle
#

bru literally just said it

velvet chasm
#

looks complicated

#

maybe I should learn java

hushed spindle
#

maybe you should learn java

velvet chasm
#

Thats a great idea I just came up with

regal scaffold
#

How can I prevent spam on PlayerPickupEvent

#

I wanna send a message once every 3 seconds instead of every tick

#

Wouldn't that prevent any items from being picked up at all?

zealous osprey
#

Save the unix-timestamp last time you send a msg and then check if next time the event is called if x seconds have passed

regal scaffold
#

Isn't that a bad performance?

zealous osprey
#

Don't you want to send a msg every x seconds when someone tries to pickup an item? Or what do you want to do

regal scaffold
#

Make it so a user can only pickup a specific item every 10 seconds

#

Got that part sorted

#

But don't wanna spam the message

#

So I guess another hasmap would work?

zealous osprey
#

I still think that it'll be better than having a scheduler

regal scaffold
#

Alright I'll try then

misty ingot
#

is this kind of file structure acceptable? lmao

zealous osprey
#

I'd have the commands and tabcompleters in the same place, but that's my preferance

misty ingot
#

actually its a good idea to have the tab completers in the commands package and not the helpers package

zealous osprey
#

ye

misty ingot
#

moved it

tardy delta
worldly ingot
#

You can do tab completion and execution in the same file

#

You can either implements CommandExecutor, TabCompleter, or be big brain and implements TabExecutor

misty ingot
#

even better!

worldly ingot
#

If you want to keep them separated, that's up to you. Though most people keep them in the same file because why not

#

But yeah aside from that, only other critique is just lowercase package names

misty ingot
#

it actually would be a good idea to keep em together cuz then I have all the command's main stuff in the same file

#

and I'll lowercase the names in a sec

worldly ingot
tardy delta
#

imagine having such a big tablcomplete method that it needs its own file

misty ingot
#

lol

#

I wanna have that some day

#

thats how you know that you have peaked

remote swallow
misty ingot
#

nah its when remake the entirety of Bukkit but betterโ„ข

#

or when you make Minecraft 1.20 before mojang

vocal mirage
#

Hello,
I'm trying to code an extension for GemsEconomy and I'm getting an NPE (Caused by: java.lang.NullPointerException: Cannot invoke "me.xanium.gemseconomy.GemsEconomy.getCurrencyManager()" because "this.plugin" is null). I don't know how to fix it as it's apparently coming from the plugin.

Can you please help me out?

Full code: https://pastebin.com/4gX7G9ak
Full error: https://pastebin.com/BmmprjYe

sterile breach
#

public void onClick(InventoryClickEvent event)

what package a i do import? org.bukkit.clickevent?

tardy delta
vocal mirage
#

GemsEconomy

misty ingot
tardy delta
#

seems to be in the constructor of GemsEconomyAPI

#

is that your class?

vocal mirage
tardy delta
#

are you sure youre depending or soft depending on it, cuz it looks like onEnable hasnt been called

terse ocean
terse ocean
#

?

terse ocean
tardy delta
#

whats pluginManager.getPlugin() supposed to do

#

just use dependency injection with your plugin

terse ocean
#

how did you get my code?

lucid stream
#

What coding language are you using?

tardy delta
#

decompiling

zealous osprey
#

java?

tardy delta
#

id rather use an itembuilder too

#

and i would just use a enum for those bow constants which are lazily constructed

zealous osprey
#

does the decompiled code keep linebreaks or are those all discarded when compiling

chrome beacon
#

Discarded probably

#

Actually... Java should be keeping track of line numbers for errors ๐Ÿค”

zealous osprey
# tardy delta hmm

Not sure how much this differes from the src code, but it would be benefitial to extract alot of those tasks to their seperate obj or function atleast

terse ocean
#

ok I just started coding with java so I am kinda new to it ๐Ÿ˜

sterile breach
#

event.setCanceled(true); send cannot find symbol because i froget a package?

tardy delta
#

which refers to the instructions

zealous osprey
tardy delta
#

like line 20 Player player = (Player)event.getWhoClicked();

#

what linebreak?

zealous osprey
#

exactly, none

terse ocean
#

is it legal to decompile someone's plugin?

zealous osprey
#

Dunno, but there is not much you can do about it, except obfuscating it, ig

tardy delta
#

who cares, most of peoples code is on gh anyways

terse ocean
#

whats gh?

tardy delta
#

github

terse ocean
#

oh

tardy delta
#

you just werent here