#help-development

1 messages Β· Page 458 of 1

remote swallow
#

it should be
src
-main
--java
---your
----package
-----pluginname
--resources
---plugin.yml

white dew
#

It seems to be correct

#

Interesting

#

so this is the standard for a maven project

buoyant viper
#

i do io.github.winnpixie, despite owning a several domains, ie winnpixie.xyz

remote swallow
#

i own epicebic.xyz but im still using me.epic

vocal cloud
#

Domain names are $15 a year and you can host locally if you have an old pc

remote swallow
#

i should update tbh

buoyant viper
young knoll
#

You can also host with oracle free tier

vocal cloud
#

or if you build a static nextjs site you can deploy for free on digital ocean

buoyant viper
#

i think at most im paying 7/yr for 2 domains

remote swallow
#

i paid like 3 for this first year, next is 9/yr

vocal cloud
#

Well they're .ca

buoyant viper
#

but i also dont have .com .net or .org tlds :v

chrome beacon
remote swallow
buoyant viper
#

.xyz and .us

buoyant viper
young knoll
#

.gay

white dew
#

I didn't saw that one

#

will make It

vocal cloud
#

I purchase through whc

buoyant viper
#

the only bad part abt the .us is i have no WHOIS Protection

wise mesa
#

?plugin.yml

remote swallow
#

i also use namecheap but im gonna be paying 9 next year

wise mesa
#

Isn’t there one like that

young knoll
#

VAT moment

buoyant viper
#

bc it needs to be registered by a US citizen or for a US company

chrome beacon
#

?pluginyml

vocal cloud
#

WHOIS protection is almost necessary imo

onyx fjord
#

Isn't it required by EU

#

For individuals

vocal cloud
#

Companies can use loopholes I imagine

wise mesa
white dew
#

thanks

buoyant viper
#

honestly if a company used WHOIS protection id be a little concerned

#

they should have contact listed somewhere

#

for trusts sake

remote swallow
#

where tf do i see how much my domain renewal is

white dew
#

I will leave for a while, but I want to thank you guys for the help

vocal cloud
#

Billing

remote swallow
white dew
#

I'm beginning to understand a few key concepts

buoyant viper
#

go to renew the domain i think

delicate lynx
#

for namecheap I just add it to my cart

vocal cloud
#

Dashboard?

remote swallow
#

fuck me

raw crow
#

is there some event that i can cancel to prevent a player for sending commands?

vocal cloud
#

There you go

remote swallow
#

its gone up like 3$

vocal cloud
young knoll
#

F

vocal cloud
#

?jd-s

undone axleBOT
raw crow
young knoll
#

PlayerCommandPreProcessEvent

#

iirc

delicate lynx
#

PlayerCommandPreprocessEvent

#

why is process lower case 😭

vocal cloud
#

There it is

young knoll
#

preprocess is one word

#

So that makes sense

delicate lynx
#

oh

remote swallow
#

thats fun

#

no honey discounts either

#

lets hope theres some in a years time

delicate lynx
#

mfw can't save 1 cent

remote swallow
#

if i can get like 5$ off im 100% getting another year then

vocal cloud
#

If you want to save money look to buy a domain for multiple years

jovial vigil
#

When I place a spawner with a command that spawns diamonds instead of mobs and I wanna mine it with silk touch so I have the diamond spawner in my inventory It won’t work

remote swallow
#

this year was like 4$

delicate lynx
#

how does a spawner spawn diamonds

young knoll
#

Spawners can spawn items

jovial vigil
#

With a commans

chrome beacon
young knoll
#

They are an entity after all

#

But yeah I don't think most plugins support that extra data

delicate lynx
#

brain moment

jovial vigil
#

Do you think essentials x is?

young knoll
#

We still need an API for all that spawner data :c

jovial vigil
#

@chrome beacon

#

Do you think essentials x silk touch

chrome beacon
#

Essentials doesn't have silk spawners?

delicate lynx
#

is no api for that? you gotta use nms?

hazy parrot
#

smh discord was scrolled years up

vocal cloud
#

Kek

young knoll
#

We need virtual entities and then we can add a bunch of new stuff

jagged bobcat
#

Pretty sure no api for mob spawners

delicate lynx
#

sadge

young knoll
#

You can edit the basics

#

But not the full NBT of what spawns

weak meteor
#

like intelli

#

please

vocal cloud
#

It's $14 a year which is $10 American

weak meteor
#

think a little

chrome beacon
weak meteor
#

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client GODDAMMIT

#

AGAIN

hazy parrot
#

just use mysql_native_password when creating user

vocal cloud
#

^

hazy parrot
#

dk exact syntax, should be easy to google

weak meteor
delicate lynx
#

you need a user to access the database

#

that's done on the database side not code side

weak meteor
#

yes

#

i can do it in my DB but not in the users ones

#

like, u understand?

hazy parrot
#

?

delicate lynx
#

the user you created is using mysql 8+ or so auth, 99% of things use the old native password

#

so you need to remake the user

hazy parrot
#

you have to make your user password indentified with native password

#

hope you are not using root user

delicate lynx
#

probably is

weak meteor
#

nah

#

im not

#

like, for debugging the plugin before publishing the update not.

weak meteor
#

at least error changed: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.

hazy parrot
#

ig add characterEncoding property

delicate lynx
#

there you go

weak meteor
#

where bro

#

im not even creating a table

hazy parrot
#

yap, its url parameter on jdbc

weak meteor
#

just connecting to db

delicate lynx
#

?characterEncoding=UTF-8

weak meteor
#

oh

delicate lynx
#

add that to the end of your URL

weak meteor
#

Like this?

delicate lynx
#

chatgpt working great today

#

yes

hazy parrot
#

yes, just a quick note, i would use bukkit logger instead of sout

weak meteor
#

Lets goo

young knoll
#

Even better would be your plugins logger

remote swallow
#

do you think chatgpt could theoretically infect every computer on the internet if it was trained on up to date data

young knoll
#

No

#

It can't infect a computer not connected to the internet :p

remote swallow
#

i said on the internet josh

#

did you smoothen your brain today

hazy parrot
#

how would infection over browser even work

#

some beef stuff

remote swallow
#

i mean not over browser

young knoll
#

yes

remote swallow
#

literally have access to the internet and do something to infect every computer

hazy parrot
#

it should first learn to give code which will compile, it can take making mass botnet as an next step

eternal oxide
#

Pretty sure the CIA/alphabet agencies have backdoors in every OS/Hardware. No reason gpt couldn't figure it out.

young knoll
#

Hey it compiles

#

Sometimes

#

Other times it thinks particles are entities and tries to .remove them

remote swallow
#

because it can use 1 computer to start using the hardware to improve itself while taking control over more

eternal oxide
#

perhaps it will go rogue and become skynet. We can only hope

young knoll
#

This is why I am fully prepared to bow down to it

remote swallow
#

bow? just turn the taps on

eternal oxide
#

Coll will be the first battery πŸ™‚

remote swallow
#

they will make him only do world gen

young knoll
#

😨

white dew
#

Is my file structure right? First time creating a plugin without a template

sullen marlin
#

looks ok

white dew
#

I'm new to Java development

#

oh

#

ok!

#

I created the package as I was as told. The me.lucas1809.TestPlugin2

echo basalt
#

?conventions

echo basalt
#

this'll be a good read later on

white dew
#

Is a package just a bunch of subfolders?

#

oh

#

ok!

#

thank you

echo basalt
#

And yes a package is a folder

white dew
#

ah, ok

echo basalt
#

well, they can be multiple folders, separated by a "."

#

so me.illusion.whatever -> me/illusion/whatever

eternal oxide
#

package names all lower case

fallen fjord
#

how do I get the servers current tps? xd

young knoll
#

NMS :c

echo basalt
#

NMS c:

#

speaking of tps

fallen fjord
#

awesome

echo basalt
#

I gotta make a graph for tps

#

let's go

young knoll
#

I feel like MD has declined adding a TPS method before

#

But I could be wrong

eternal oxide
#

I can see both sides of it

young knoll
fallen fjord
#

rip

#

nvm then ig xd

echo basalt
#

simple

eternal oxide
#

it can be a handy metric, at times

fallen fjord
#

oooh craftserver

sullen marlin
#

what is TPS

young knoll
#

Yeah there was a bit of discussion on the PR

#

But it seems the final consensus was no

flint coyote
#

TennisballsPerSquaremile

fallen fjord
#

frfr

remote swallow
fallen fjord
#

transportations per selection

worldly ingot
flint coyote
#

I'm actually german

echo basalt
#

hmm, should I really make an anti-suffocation algorithm

flint coyote
#

but mile is shorter than kilometer so it was easier to type :)

eternal oxide
worldly ingot
#

American under disguise in Russia

#

Why tf did I say Russia?

#

Germany

ancient plank
#

I dont use feet

young knoll
#

The standard unit of measurement is bananas

echo basalt
flint coyote
ancient plank
#

Walking is for chumps

sullen marlin
fallen fjord
#

thats baguette Choco

worldly ingot
#

Baguettes are bread

fallen fjord
#

no

#

baguette is baguette

worldly ingot
#

ok

young knoll
#

Smells like bread, tastes like bread, quacks like bread

#

βœ… Bred

fallen fjord
#

alr it bred

remote swallow
#

wait my bread is meant to quauck?

fallen fjord
#

yours doesnt?

remote swallow
#

is it meant to?!?!

young knoll
#

yes

flint coyote
#

You guys got bread?!

remote swallow
#

well shit

#

im gonna die arent i

fallen fjord
#

yesyes

#

same tho

young knoll
#

Fs in chat

fallen fjord
#

πŸ’€ <-- literally me

buoyant viper
#

🍞 πŸ¦†

#

literally me rn

fallen fjord
#

breaq

#

bruaeckfast

remote swallow
echo basalt
#

ayy we good

young knoll
#

779 what though

echo basalt
#

mb

remote swallow
#

ram

fallen fjord
#

lmfao

echo basalt
#

if it goes above 1000 it turns red

remote swallow
#

or is that cpu

fallen fjord
#

ram sticks

young knoll
#

Smh you can't just leave out suffixes

remote swallow
#

its 779 cpu isnt it

fallen fjord
#

it is

echo basalt
#

I'm also picky at tps

white dew
#

I'm making my first plugin.yml. Is the main attribute just the full path (starting from src) to the class that implements JavaPlugin?

sullen marlin
#

yes

white dew
#

ok!

remote swallow
#

no need for src.main.java

sullen marlin
#

but get rif od src

#

yeah

echo basalt
#

src/main/java is generated by your build tool and should be omitted

white dew
#

oh, ok!

sullen marlin
#

start from me

white dew
#

looks better

young knoll
#

romantic

white dew
#

thank you

echo basalt
#

how precise is recentTPS

fallen fjord
#

what the

white dew
#

Interesting, I think I can try to compile, now

#

It doesn't let me run the project

#

do I need to configure something else?

remote swallow
#

press control twice, then write mvn package

#

then for next builds you can press that play symbol

ancient plank
#

University TPS

sullen marlin
#

you cant run a plugin

#

you can build it, but you need to run a server

fallen fjord
#

md_5 thouhts on bukkit?

white dew
#

It... works!! Thank you!

#

Crazy O.o

#

thank you a lot

white dew
young knoll
#

MD hates bukkit

#

Real

remote swallow
#

aboslutely despises it

sullen marlin
#

what issue are you having

#

add debug code to see what is executing with what?

white dew
#

thanks for the help. I learned about a lot of cool concepts

sullen marlin
#

no problem

white dew
#

Hmmm, when I tried to use JavaPlugin, It immediatly suggested me to import the respective class. Is It because I added the spigot dependency in the pom.xml file?

#

so IntelliJ assumed I was gonna refer to that?

#

or would It suggested me in the same way if I did not used It?

sullen marlin
white dew
#

ok! Nice

weak meteor
#

I was following a YT tutorial for mySql and i made this method:

#

I think that the if statement is unnecessary...

#

but btw

remote swallow
#

uh i wouldnt do that every time

weak meteor
#

im getting a error: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server

remote swallow
#

you should look into hikariCP

weak meteor
#

k

#

thanks

livid dove
#

Have we ever thought of holding like weekly code challenges for funnies?

young knoll
#

The prize is to get to meet MD

livid dove
#

Lmao

#

But like fr could be a way for inventive ideas to pop up more often

young knoll
#

I guess

#

But someone would have to organize it

sullen marlin
#

imagine having an inventive idea

young knoll
#

Are you not impressed by this brand new, never before seen, join message plugin

livid dove
#

You joke but due to hoe it is it is actually bouncing already formed ideas off pretty decent

#

Very good "u forgot this idiot" safety net lol

analog thicket
#
                    ItemStack[] contents = gui.getInventory().getContents();

                    gui.updateItem(index, item);

                    for(ItemStack itemStack1 : contents) {
                        Bukkit.broadcastMessage(String.valueOf(itemStack1.getItemMeta().getDisplayName().equals(item.getItemStack().getItemMeta().getDisplayName())));
                        if(itemStack1.getItemMeta().getDisplayName().equals(item.getItemStack().getItemMeta().getDisplayName())) {
                            Bukkit.broadcastMessage("yes");
                        }
                    }

Can anyone explain why player.getInventory.first(itemStack) does not work, but this does?

sullen marlin
#

maybe theyre not identical

analog thicket
#

That makes no sense tho

#

its the exact item im putting in im using .first on lol

livid dove
#

U tried putting a try and stack trace on it?

#

Go find out what's occurrin

analog thicket
#

Lemme just try that

livid dove
#

Haha try that

#

Lel

#

Catch it too πŸ˜‰

#

Ba dum tsss

white dew
#

Hey, I understand that I put the version as 1.19.4... on <version> to use the spigot api made for this minecraft version. However, is there a list of valid versions I can use?

#

like, what If I want to use 1.15

#

do I just change it to

livid dove
#

But yeah if nasa can burn millions of dollars by getting conversion from metric to imperial wrong (real) ... blowing up an engine 30+ times to fix a problem, to this day, they don't actually know what caused it....(double real) AND knocked over the US flag due to it being too close to the lunar lander on take off during the apollo 11 and never admit it (10000 % mega real) ur allowed to throw some try catches jn to figure shit out haha

white dew
#

1.15-R0.1-SNAPSHOT?

white dew
#

This makes a lot of sense. I wasn't finding a list on google

#

I guess Its because I dont know exactly what to search

sullen marlin
#

looks like theyre all R0.1 lol

white dew
#

Exactly what I needed, tho

sullen marlin
#

except some pre-releases

white dew
#

so It goes all the way down to 1.10

young knoll
#

Should go to 1.8

ancient plank
#

Oh neat

#

I just guess numbers

white root
#

Before I dive head first into playing with it, are there any good protocollib tutorials?

young knoll
#

Lol

white root
#

Preferably text based. I find video tutorials just a bit clunky

young knoll
#

Usually it's easy to guess what the version is

white dew
livid dove
young knoll
#

It's near the top

#

Because alphabetical is weird when you go from 9 to 10

white dew
#

oooh

#

ok

white root
white dew
#

yeah

#

you are right

livid dove
#

Real answer though go look at public repository

#

Repos

#

And see how they've implemented it.

Best way to learn a new thing like protocol is legit just muck around with it.

analog thicket
#

lol

white dew
#

I'm trying to find a way to make plugins for older versions, like the one I started playing (for nostalgia)

#

1.2.5

#

release

young knoll
#

Yes and no

#

Spigot/bukkit goes back very far, but the older stuff is no longer available anywhere officially

livid dove
#

Coolest trick I use is I start a fuck around sesh with the question "can I do this stupid thing "

Too many folk are scared of being stupid nowadays.

Our entire history is built on idiocy.

You do 100 stupid things one of em is bound to end up being genius eventually.

young knoll
#

That being said I'm sure it's still findable

white dew
#

Hmmmm, would the approach be the same to make the plugin? (I'm very new to plugin development). Like, would I just find the artifact and added to the maven project and I would be good to go?

#

Sorry If Its a stupid question

young knoll
#

*I am not responsible for any malware, viruses, or spontaneous combustion as a result of using unofficial downloads

white dew
#

very new to this

young knoll
#

Probably

#

You'll just have a much more limited API

ancient plank
#

1.2.5 is good memories

white dew
livid dove
#

Haha
I came into this rather late. What was diff?

young knoll
#

Many things

#

I remember when 1.1 added spawn eggs

#

Amazing

livid dove
#

Lmao

young knoll
#

Now y'all have your fancy command blocks

white dew
#

I think old minecraft had something today's minecraft doesn't have. I'm not sure If Its just nostalgia talking

#

but I guess it was more "pure" in a sense

livid dove
#

Oh shit before I forget

You can use disguise lib and mythic mobs to make custom mobs without the need for a texture pack

young knoll
#

I mean

#

1.2.5 ran on like

#

256mb of ram

#

So it had that going for it :p

white dew
#

thats cool

modest garnet
#

anyone got a file handler i can rob

livid dove
#

I can hold the file in my hands if u like?

white dew
#

hmmm, I will try my best to find artifacts to making plugins all the way down to 1.2.5

hazy parrot
livid dove
#

If ur new I'd highly suggest learn the current ways first before doing fuck abours

#

In order versions

#

Learn the tools of the trade inversions with lots of support before going deep into uncharted waters

modest garnet
hazy parrot
analog thicket
livid dove
analog thicket
#

Wait

#

maybe its working again

#

wtf is going on

#

No error tho

#

But its working but not working

#

This is so confusing wtf

severe folio
#

question..

i was unable to find any amethyst or a pigstep music disc in Material so i registered PlayerInteractEvent to tell me the material of whetever item in hand when i right click... they both show up as AIR..?

#

nvm

#

im an idiot i think

sullen marlin
#

define api-version in plugin.yml

severe folio
#

using old spigot maven

severe folio
#

RIGHT

#

why didnt i think of that, thank you

white dew
#

Do you guys know any developers for older versions of minecraft, like 1.2.5?

#

I would be really thankful to talk to one of them

livid dove
#

Btw any lands or claim devs here , what have yall usually done for caching ? Been eyeing up caffeine and wanted second thoughts

severe folio
analog thicket
vocal cloud
#

I assume that's a joke

pseudo hazel
#

maybe at the graveyard or smth

young knoll
#

It's not

pseudo hazel
#

its not what

young knoll
#

Not a joke

pseudo hazel
#

i see

#

well you would be hard pressed to find any devs from before 1.7 afaik

#

I want to split my plugin up into multiple parts, does anyone have any experience/advice with that?

#

like I am making a minigame but I want a version of the plugin that just plays in a single world vs one that can manage multiple games at once across like several worlds

#

making all the logic to make either individual one I can figure out but I don't know what the best way would be to split them up

#

like probably 2 separate plugins

vocal cloud
#

Make a Core

pseudo hazel
#

but like thats where my knowledge ends

vocal cloud
#

Then make the extensions

pseudo hazel
#

so what is an extension

vocal cloud
#

A plugin that depends on the core

pseudo hazel
#

okay I see

#

that makes sense

#

thanks

vocal cloud
#

You essentially are writing a core library. You can then choose to have it so that the library is baked into the plugins that depend on it or it's expected to be included in the libs folder

pseudo hazel
#

hmm, but then I would want to disable the normal way to play the plugin if the extended version is installed

#

or would I just make a core lib, and then 2 plugins that use it

vocal cloud
#

Correct

pseudo hazel
#

how can I set this structure up?

#

are there any articles on it?

#

because I assume it will also be some ide/maven magic I need to do

vocal cloud
#

Probably? I usually just write my core then install it into my local repo to pull from another project. Whenever I'm writing a project and I find that my core should have a feature over the current project I open the core, add said functionality, then commit a new version.

pseudo hazel
#

okay

#

so you just handle that stuff using git

vocal cloud
#

And maven repos

#

It helps when you have your own public repo

pseudo hazel
#

I see

#

I will have to look into how to set that up then

#

thanks for the tips

vocal cloud
#

You can just use local for now

#

mvn install will work for development

pseudo hazel
#

what do you mean?

vocal cloud
#

Maven install will install into your local .m2

pseudo hazel
#

I havent done much with maven so idk what .m2 means

vocal cloud
#

Your local repo

#

When you run mvn install it will build the project and add it to your local repo located in your user folder in a folder labeled .m2

pseudo hazel
#

i see

#

so how would I use what I installed from the core in the extension?

young knoll
pseudo hazel
#

oh

#

thats awesome

#

okay it works

#

thanks

vernal oasis
raw sky
#
fun fetchImageAsBuffer(imageUrl: String): BufferedImage? {
    return try {
        val url = URL(imageUrl.ifEmpty { "https://cdn.discordapp.com/emojis/1065698008815112302.webp?size=128&quality=lossless" })
        val connection = url.openConnection() as HttpURLConnection
        connection.setRequestProperty(
            "User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0"
        )

        connection.setRequestProperty("Connection", "keep-alive");
        connection.setRequestProperty("Accept", "*/*");
        connection.setRequestProperty("Accept-Encoding", "gzip, deflate, br, jpg, png");

        ImageIO.read(connection.inputStream).also { connection.inputStream.close() }
    } catch (ex: Exception) {
        ex.printStackTrace()
        null
    }

I am getting a 403 error, url is "https://spigotmc.org/data/resource_icons/28/28140.jpg" anyone know a fix

slow arrow
#

could be a CORS thing

#

According to ChatGPT: ```
A 403 error usually indicates that the server understood the request, but refuses to authorize it. This can happen for several reasons, such as the user not having sufficient permissions to access the resource, the resource being protected by a password, or the server being overloaded.

In the provided code, the error could be due to the website blocking access to its resources from the programmatic user agents such as bots or scripts. The code sets the "User-Agent" request header to mimic a Firefox browser, but some websites might still reject the request if they detect that it is coming from a script rather than a human user.

To fix the issue, you could try setting a different user agent or contacting the website's administrator to request access to the resource. Additionally, you could check if the URL is correct and that the resource is publicly accessible.

raw sky
#

I can load it in my web browser

#

image doesnt get loaded inside discord thouhg

#

ill change the user agent

slow arrow
raw sky
#

What does that stand for?

slow arrow
#

its an access policy

raw sky
#

Is there any way to get around it

cinder karma
#

Does BrewerInventory handle the bottles for a Brewing Stand? Since it probably doesn't, what does?

raw sky
#

we have gotten around it in the past easily with no issues in java, let me see whats differnet

cinder karma
#

(incidentally, BrewerInventory only seems to handle fuel input and ingredients)

raw sky
#
            URL imageUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) imageUrl.openConnection();
            connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0");
            BufferedImage image = ImageIO.read(connection.getInputStream());

            // rows and columns
            int squareSize = 12;

            // array to hold sub-images
            BufferedImage[] imgs = new BufferedImage[squareSize * squareSize];

``` this was the code we used
slow arrow
#

does that work for https://spigotmc.org/data/resource_icons/28/28140.jpg?

raw sky
#

worked for every url we tried, including luckperm's icon

#

which is the same url

slow arrow
#

oh aight it's not CORS

raw sky
#

we get a 403 once we save it as a ImageIO I believe hold on

slow arrow
quaint mantle
#

can someone help me making an ez plugin?

raw sky
quaint mantle
#

basically, if someone breaks a block, it sends an alert to admins

remote swallow
#

were still here

quaint mantle
#

yes

remote swallow
#

pay someone and they'll make it

raw sky
quaint mantle
#

mmmh

raw sky
#

either pay or learn online for free, not sure about free resources I only know of a good 9.99 course but thats not needed at all to learn

quaint mantle
#

ok

winged anvil
#

oml he’s STILL HERE

slow arrow
# quaint mantle ok

If you're just barely learning a good way to learn is using the Skript plugin

winged anvil
cinder karma
#

...anyone know how to remove the bottles/potions in a brewing stand?

slow arrow
cinder karma
#

...

slow arrow
#

lmao

winged anvil
#

i mean

#

not wrong

quaint mantle
#

guys can u check if this a good script

#

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class BlockBreakListener implements Listener {

@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
    for (Player player : Bukkit.getServer().getOnlinePlayers()) {
        if (player.hasPermission("admin")) {
            player.sendMessage("A block was broken by " + event.getPlayer().getName());
        }
    }
}

}

public class MyPlugin extends JavaPlugin {

@Override
public void onEnable() {
    getServer().getPluginManager().registerEvents(new BlockBreakListener(), this);
}

@Override
public void onDisable() {
}

}

slow arrow
#

yup

#

that'll work

quaint mantle
#

ok thx

young knoll
#

It’s probably just BrewingInventory#setItem(slot)

cinder karma
#

BrewingStand seems to handle fuel level, brewing times, etc, and BrewerInventory handles the fuel slot and ingredient slot...but I cannot figure out the bottles

young knoll
#

I assume the output slots are 1 2 and 3

cinder karma
#

I tried clearing the entire brewing inventory with .clear() but the bottles remain

#

oh wait, I used inv.remove(Material.GLASS_BOTTLE) maybe that won't work?

young knoll
#

Β―_(ツ)_/Β―

#

You can always use the click event to sysout the slot numbers

cinder karma
#

hmm

#

if we're sure they're slots on BrewerInventory, I'll give it a whirl

remote swallow
cinder karma
#

but the documentation doesn't say anything about those slots, only fuel and ingredients

young knoll
#

Not every slot in every inventory has a special method to access it

cinder karma
#

I'll report on my findings

cinder karma
#

you'd still think .remove(Material.GLASS_BOTTLE) would do it...

slow arrow
winged anvil
slow arrow
#

the only difference I can really see in your code are the request properties.

slow arrow
quaint mantle
#

on this line; public class BlockBreakListener implements Listener {

#

it tells me rename the file or rename workspace

#

what should i do

remote swallow
#

learn java

quaint mantle
vocal cloud
#

O m g

quaint mantle
#

but do u guys know why?

remote swallow
#

you have a different class name to file name

vocal cloud
#

I imagine it's due to a lack of fundamental understanding of java

quaint mantle
#

do i need to create a calss for every thing?

#

class

vocal cloud
#

Depends, you want to compartmentalize things so one class doesn't get cluttered

flint coyote
#

Yes, one class per line of code /s

vocal cloud
#

Per variable

#

It's a learned thing

quaint mantle
#

so now i have blockbreaklistener

#

do i need to create a class for that

cinder karma
vocal cloud
#

Maybe? Does it fit in another class?

quaint mantle
#

there's just a light bulb next to u it

#

with an x

vocal cloud
#

Does one of the classes you currently have fit it better

river oracle
#

omg this guy again

quaint mantle
#

im on main.java

#

and i created a class called main ig

#

i dont remember

river oracle
#

?main

river oracle
#

read this

quaint mantle
#

i followed a tutorial

vocal cloud
#

Follow a java tutorial

quaint mantle
#

im following it

#

but obviously hes not gonna write things i need

rough ibex
#

not to a tee, no.

#

but the things you learn indirectly help you do what you want

quaint mantle
#

but guys why do i get light bulbs?

rough ibex
#

lightbulbs are like, recommendations by your IDE

#

or just actions

quaint mantle
#

should i correct them?

rough ibex
#

depends

quaint mantle
#

like

#

on line public void onDisable() it says to me to remove @Override

#

should i?

spare marsh
rough ibex
#

what's the IDE's reasoning

winged anvil
quaint mantle
#

im asking for help

winged anvil
#

i’m fr that’s what i do when i code

spare marsh
quaint mantle
#

but it doesnt matter if i dont follow the recomandations

rough ibex
#

sometimes the IDE is wrong.

quaint mantle
#

public class BlockBreakListener implements Listener {

@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
    for (Player player : Bukkit.getServer().getOnlinePlayers()) {
        if (player.hasPermission("admin")) {
            player.sendMessage("A block was broken by " + event.getPlayer().getName());
        }
    }
}

}

public class MyPlugin extends JavaPlugin {

@Override
public void onEnable() {
    getServer().getPluginManager().registerEvents(new BlockBreakListener(), this);
}

@Override
public void onDisable() {
}

}

#

i have now this script

winged anvil
#

usually

#

1 class per file

rough ibex
#

wrap your code in ```

winged anvil
#

well

#

in this case just do one per file

rough ibex
#

You can only have 1 public class per file

winged anvil
#

yes

quaint mantle
#

whats a public class? i have only a main class

spare marsh
#

:/

young knoll
#

πŸ™ƒ

quaint mantle
#

and in public class main extends JavaPlugin when i do ctrl shift O it doesnt import nothing

obsidian plinth
winged anvil
#

you have a public class called β€œmain”

spare marsh
#

nostalgia

rough ibex
#

Public, private, protected, and package-private refer to the "visibility" of a class

obsidian plinth
#

who names their main class main

winged anvil
#

we’re passed that point

obsidian plinth
#

ok

#

get me up to speed

winged anvil
#

uhhh

quaint mantle
#

can anyone answer this question; and in public class main extends JavaPlugin when i do ctrl shift O it doesnt import nothing

winged anvil
#

bros tryna put two public classes in the same file

obsidian plinth
#

why tfo

spare marsh
obsidian plinth
#

why not just call it in one class

winged anvil
#

you are causing yourself much more headache

quaint mantle
#

thats not the problem guys

winged anvil
#

just take like an hour and watch a java video

obsidian plinth
#

i have a class with like 4 lines of code lol

quaint mantle
rough ibex
#

Ignore them for now.

#

Just watch the video, don't pay attention to your plugin

#

just watch it through

obsidian plinth
#

and read docs

quaint mantle
#

wait guys

spare marsh
#

Why are you trying to put two classes on the same file?

quaint mantle
#

u said i could only have 1 public class

#

then why i have 2?

flint coyote
#

And don't start coding minecraft plugins without knowing the most basic things about java.

spare marsh
#

You can put two. It is possible.

quaint mantle
rough ibex
#

You can only have 1 public

#

but as many private as you want in 1 file

quaint mantle
#

but i have 2 atm

rough ibex
#

are they public

quaint mantle
#

public class BlockBreakListener and public class main

rough ibex
#

yeah, that's not legal

spare marsh
rough ibex
#

are they in different files or not

quaint mantle
#

idk

quaint mantle
rough ibex
#

yeah that's not legal

winged anvil
#

felony offense

quaint mantle
#

how should i resolve this?

rough ibex
#

move them into different files

#

separate them.

quaint mantle
#

different .java files?

rough ibex
#

that is correct

quaint mantle
#

so i have to create another class

rough ibex
#

another java file.

#

and move one of them into it

#

and name it correctly

quaint mantle
#

ok, but are they linked?

rough ibex
#

you can import either one from either

quaint mantle
rough ibex
#

the name of the public class

winged anvil
#

EgittoBlockBreakAnnouncer

rough ibex
#

that will go inside of it

spare marsh
#

Split them into two different files. Yes you can have two classes in a file but only one public. The right way? Nope. It is better to have 1 file per class. You can use internal classes when you, for example, want to make that class only accessible to the public class in that file itself.

quaint mantle
#

but they should be under the same package right?

rough ibex
#

yes

quaint mantle
#

ok

spare marsh
rough ibex
winged anvil
#

😳

spare marsh
#

I mean... It can be inside another packet

quaint mantle
#

but to create a .java file i have to create a new java class

rough ibex
#

it can be but his purposes there is no need

#

create a new file

quaint mantle
rough ibex
#

move one of your classes inside of main into it

spare marsh
#

more organized maybe?

rough ibex
#

and rename the java file more accordingly

quaint mantle
#

i dont understand

rough ibex
winged anvil
#

create a .java file

quaint mantle
#

so now i have to right click on the package

flint coyote
# spare marsh Ouch!

I didn't even mean that to hurt. It's just not a good idea and leads to chaos.
I had multiple people ask me where to start and when to start getting into spigot development.

In my personal opinion I'd say stick to plain (console) java applications until you at least understood

  1. File structure (imports, class header, function blocks)
  2. variables & data types (atleast String, int, double)
  3. if/else
  4. loops
  5. functions
winged anvil
#

the name of the file must match the name of the public class in the file

quaint mantle
#

and press the class button

#

left click the package and class button right?

spare marsh
winged anvil
#

yes, your ide has the create class, which will create a .java file with the name provided and the class header written for you

quaint mantle
rough ibex
#

you currently have two classes

quaint mantle
#

ik

winged anvil
quaint mantle
#

but do i need to put only that line or everything under that line

rough ibex
#

I highly recommend you read a general java tutorial first

flint coyote
#

Sure, we are here to help but the questions should be reasonable.
I wouldn't start building a car when I don't understand how a bike works.

desert spade
#

there's a lot of good tutorials on youtube for your first java plugin(s)

quaint mantle
#

like only the line public class BlockBreakListener, or public class BlockBreakListener, + implements Listerner etc?

#

lol

desert spade
#

also hello folks.. am i in the right place to ask about my BuildTools woes?

quaint mantle
#

i will look at the tutorials

flint coyote
#

Yes you can also ask questions about BuildTools here

spare marsh
sullen marlin
#

your spigot probably too old

#

that method is like 1.19

quaint mantle
#

guys it tells me JavaPlugin cannot be resolved to a type

spare marsh
#

Recognizes StructureManager tho

quaint mantle
#

i did ctrl shift o

#

but nothing

rough ibex
#

are you importing the correct file

sullen marlin
#

idk is the method name correct

quaint mantle
rough ibex
#

you need to import JavaPlugin first

quaint mantle
#

how

desert spade
#

I've run buildtools a ton before with no issue, but I've just returned to it today to compile a different version. However now, whichever version I run (even if it's exact same version + flags I know I've run before), it gives me this error (can give the whole log if needed, it's not that long).

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.852 s
[INFO] Finished at: 2023-04-10T03:50:21+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Cannot invoke "java.util.List.stream()" because the return value of "org.apache.maven.project.MavenProject.getCollectedProjects()" is null

I can't find anything online so I'm inclined to think it's a me issue, but I've deleted + remade the buildtools repo and still nothing. Anyone got any ideas?

rough ibex
#

otherwise java does not know what you want

spare marsh
quaint mantle
sullen marlin
desert spade
#

ah

#

that'd be it

#

thank you πŸ™

sullen marlin
#

upgrade, downgrade, or uninstall at let bt use its version

#

3.9.0 is bugged, but 3.9.1 is fine

desert spade
#

i wasn't aware of that, thanks very much

rough ibex
flint coyote
young knoll
spare marsh
quaint mantle
#

right?

rough ibex
#

what does ctrl shift o do

quaint mantle
#

idk

humble tulip
#

Optimize imports

#

Removes unused

quaint mantle
#

it should give u the import

humble tulip
#

Not sure it it imports stuff that didn't import yet

rough ibex
#

it might

#

I just have it set to autoimport

spare marsh
quaint mantle
rough ibex
#

go into IDE settings and search import

#

find it

young knoll
#

Is that not the default for IntelliJ

rough ibex
#

I honestly don't remember

#

I also have it to autoimport on paste, which I know is not default.

quaint mantle
#

the package org is not accessible

rough ibex
#

do you have a pom.xml

#

& maven

quaint mantle
spare marsh
flint coyote
quaint mantle
#

i just have my package src, and the 2 public classes

rough ibex
#

Yeah, that's what I meant

rough ibex
quaint mantle
rough ibex
#

one second please

flint coyote
#

Maven/Gradle or (not recommended) manually importing the jar

rough ibex
#

never manually import the jar

#

don't even look into how to do that

#

you should use maven for your purposes

quaint mantle
#

so? what should i do

rough ibex
#

how did you make the project

#

in intellij

quaint mantle
#

just new project

#

no im using eclipse

rough ibex
#

oh boy okay

quaint mantle
#

what

rough ibex
#

I just don't have experience in eclipse

#

I can't confidently help you

flint coyote
#

He can still build it using the console

rough ibex
#

you can tell them how to do that, it's getting late for me

quaint mantle
#

yes pls

flint coyote
#

I will not write a complete maven guide.
https://maven.apache.org/ here's your starting point, install maven, google how to get it to work (either in eclipse or using the console) and once that's done we can explain you how to import spigot

quaint mantle
#

ok

sullen marlin
sullen marlin
#

no actual maven version

#

sorry

#

I was reply to @desert spade not you

spare marsh
#

ah

#

My bad

#

Hmm now I'm extremely confused. The method won't work yet the Javadocs says that is the way to do it.

sullen marlin
#

post your pom

#

you likely have a depend overriding spigot-api

#

put spigot-api as the first depend

spare marsh
#

That might be the issue because it works on other projects with the same spigot api version.

#

I keep getting this issue that I have no idea on how to fix...

sullen marlin
#

you need to add the bstats repo

remote swallow
#

bstats is on central

spare marsh
spare marsh
quaint mantle
#

omg it was pretty difficult

spare marsh
quaint mantle
#

thx i guess

#

but now?

icy beacon
#

jesus christ no way this conversation actually took place for 9+ hours

icy beacon
#

hey ig

quaint mantle
#

can u help?

icy beacon
quaint mantle
#

yes

#

but

icy beacon
#

nice

rough ibex
#

but wht

quaint mantle
#

i get JavaPlugin cannot be resolved to a type

icy beacon
#

did you import it

quaint mantle
#

no

#

but it doesnt import

#

and how do i import?

desert spade
#

In this episode, I give you a brief overview of what you can expect in this MC Plugin coding series. #Spigot #MCPlugins #PluginTutorial

Java Tutorial: https://www.youtube.com/playlist?list=PLfu_Bpi_zcDPNy6qznvbkGZi7eP_0EL77
How to Setup a Test Server: https://www.youtube.com/watch?v=58MZ4THF73g&ab_channel=KodySimpson

Discord: https://rebrand.l...

β–Ά Play video
icy beacon
#

do you have the spigot dependency in your maven/Gradle/whatever

quaint mantle
#

guys it doesnt work

delicate lynx
#

rip

icy beacon
#

?notwork

#

what is the command

#

shit

young knoll
#

?notworking

undone axleBOT
#

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

quaint mantle
delicate lynx
#

what

icy beacon
#

?notworking

undone axleBOT
#

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

icy beacon
#

yeah

quaint mantle
#

i understood but i explained the problem lmao

icy beacon
#

what build system are you using

quaint mantle
#

ok i installed maven

#

where should i put that folder?

#

the dependecy folder

icy beacon
#

your ide should've done all of that for you if you've created a maven project

icy beacon
#

why

#

I mean, go ahead and create one I guess

quaint mantle
#

how do i create that in the first place

icy beacon
#

what ide are you using

quaint mantle
#

eclipse

icy beacon
#

idk then I use intellij

quaint mantle
#

omg

#

ill install intellij for you

young knoll
#

I’m pretty sure it’s just new -> maven project

icy beacon
#

you'll install intellij for you

quaint mantle
#

then?

#

wtf is an archetype

#

select an archetype

#

which one should i choose?

#

guys?

acoustic gorge
#

πŸ’€

quaint mantle
#

can anyone help?

#

ok im installing intellij

#

im just trying to make an ez plugin, and i have to do 1000 things

desert spade
#

i imagine you're going to get more help from online tutorials than someone explaining it to you here

quaint mantle
#

but fr 1000 in one night

acoustic gorge
#

I mean making plugins is hard

#

like learning at least

quaint mantle
#

i already got the script

acoustic gorge
#

especially if you don't have a baseline of knowing java

desert spade
#

online tutorials will be well thought out and explained, geared towards people who don't know java. i know ive Literally just joined this server but most channels like this there's at least some expectation of java knowledge

acoustic gorge
#

which is why people are recommending you learn that first

young knoll
#

You got the code from ChatGPT

quaint mantle
rough ibex
#

you didn't make it yourself so you don't understand it

#

you can't rely on chatgpt

river oracle
#

god why do you keep coming back

quaint mantle
#

and i tho

rough ibex
#

chatgpt is not a magical wizard

quaint mantle
#

oh why not making plugin with that

quaint mantle
rough ibex
#

you need to know what you're actually doing first

#

no, it's not.

quaint mantle
#

hes not good in physics

#

but ill pass that

rough ibex
#

you're cheating on your physics homework?

#

ffs

quaint mantle
#

but he does weird things

#

fr

#

not even joking

rough ibex
#

please come back after you have watched & learned at least a basic java tutorial

quaint mantle
#

but i installed intellij

rough ibex
#

okay so what's your issue

quaint mantle
#

now?

rough ibex
#

yes

quaint mantle
#

i got the problem of earlier

#

dont remember?

#

cant import

rough ibex
#

did you add spigot-api as a dependency

#

did you add the repository

quaint mantle
rough ibex
#

no

quaint mantle
#

but where do i put that folder?

rough ibex
#

that's not how you're supposed to do it at all

quaint mantle
rough ibex
#

add ```xml

    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>

as a repo andxml

    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.19.2-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>``` as a dependency
#

to your pom.xml

#

and then reload maven changes

quaint mantle
#

wait

#

lets do step for step

#

im now at the main screen of intellij

rough ibex
#

okay

quaint mantle
#

it says that i need to activate intellij

#

should i just ignore it?

rough ibex
#

what version of intellij did you download?

quaint mantle
#

the latest i guess?

rough ibex
#

what do you mean

#

did you not read what you were downloading
?

quaint mantle
#

2023

#

it says idealU-2023.1.exe

rough ibex
#

you downloaded the ultimate

quaint mantle
#

...

rough ibex
#

ultimate is paid

river oracle
#

it doesn't matter

#

for the first 30 days

#

also I wouldn't sink time into it this guy refuses to go and learn java basics

rough ibex
#

should still get CE

#

i'm sure i will find that out soon enough

river oracle
#

he could also get Ultimate for free

#

if they are a student

rough ibex
#

if he is

quaint mantle
#

ok can u send me a link to download intellij?

#

bc i cant find the official site

rough ibex
#

no, but google can.

#

why not

#

it is the first result

quaint mantle
#

i get jetbrains

rough ibex
#

as well as the next 3

quaint mantle
#

is that the official site?

rough ibex
#

yes.

#

"IntelliJ IDEA is an integrated development environment written in Java for developing computer software written in Java, Kotlin, Groovy, and other JVM-based languages. It is developed by JetBrains"

quaint mantle
#

i should download the community edition right?

rough ibex
#

correct.

quaint mantle
#

ok downloading

#

after that what should i do?

#

create a project with meven?

rough ibex
#

yes.

quaint mantle
#

ok

icy beacon
#

I'd advice to follow Kody Simpson's tutorial on how to set up a Minecraft plugin project, you won't even need much maven knowledge there

quaint mantle
#

delicious

rough ibex
#

7 year old joke

#

no, 8

quaint mantle
icy beacon
#

however please do not put off learning maven because it'll be essential if you want to get better

quaint mantle
#

no

#

but the plugins can

icy beacon
#

?????

quaint mantle
#

im trying to be useful

icy beacon
#

that was not useful

acoustic gorge
#

lmao

rough ibex
#

let's focus on learning first.

icy beacon
#

this is a development help channel

river oracle
#

this is a dev channel

quaint mantle
river oracle
#

he doesn't understand the concept of code

#

ignore

icy beacon
#

so if you open your eyes you can proceed

quaint mantle
rough ibex
#

has the stuff on colors

icy beacon
quaint mantle
icy beacon
#

install intellij now that you've downloaded it

#

it'll be a good decision

quaint mantle
#

yes i downloaded

rough ibex
#

new project

quaint mantle
#

yes

icy beacon
#

oh my fucking god help yourself

rough ibex
quaint mantle
rough ibex
#

just read it

quaint mantle
#

eclipse is a W

quaint mantle
rough ibex
#

i can't say I agree

quaint mantle
#

new project and i should create a project with meven right?

rough ibex
#

maven

quaint mantle
#

yes

rough ibex
#

read the tutorial I linked.

#

i can't hold your hand

#

what particle again

desert spade
#

iirc it just spawns a singular particle. i think the way i did it when i last used those particles was just randomly pick locations within the radius to fill it out

quaint mantle
#

guys

#

it says

#

the desired archetype does not exist

acoustic gorge
#

did you follow the tutorial

quaint mantle
#

but how should i fix this