#help-development

1 messages · Page 554 of 1

river oracle
#

nvm found it

remote swallow
#

i use the left side of the screen

noble lantern
#

that shit barely works half the time

remote swallow
#

make sure ur github info is setup correctly

river oracle
tardy delta
#

oh man i can already think how many http requests are needed to initialize a discord client

#

its horrible

chrome beacon
#

Surrond 1.20 with ""

tardy delta
#

only fifty requests per second :(

chrome beacon
#

or it will think it's a float and remove the 0

#

Change it in the plugin.yml

#

api-version

gray hornet
noble lantern
gray hornet
#

im using intellij to compile it as a artifact, and i used 7zip to look in the jar file using open archive

kind hatch
#

There's your problem. Don't build it as an artifact.

#

Are you using maven or gradle?

gray hornet
#

maven

kind hatch
#

Use the panel on the right side and double click package.

gray hornet
#

can i make it so it automatically packages into the plugins folder using that?

kind hatch
#

Yes, you just need to adjust your pom.xml a little bit to do so.

gray hornet
#

oh and it didnt fix the error

dry forum
#

no.. the color class not chat color

kind hatch
gray hornet
#

same error

dry forum
#

is there not a way to get a bukkit color using a string?

kind hatch
#

?paste

undone axleBOT
gray hornet
#

should i use the normal jar or the shaded jar?

kind hatch
#

Probably won't make a difference, but you should probably use the latest version of the shade plugin. (3.4.1)

#

Use the normal jar.

#

As of right now, are you using the jar that's located in your target folder?

gray hornet
#

yes

kind hatch
#

And it is the normal jar? Not one of the -original or -remapped-obf?

gray hornet
#

there is no -remapped-obf for me, i just use the one that has no prefix/suffix

#

so the name is just server-manager-1.0-SNAPSHOT.jar

kind hatch
#

Sounds about right.

#

When you open that jar file, what's in it?

gray hornet
#

its all my dependencies, is it alright if i upload it to mediafire so you can take a look yourself?

kind hatch
#

A screenshot would work just fine. Just double check that your source files are in there. Especially the one that the error is telling you about.

#

?img

undone axleBOT
gray hornet
kind hatch
#

The file names don't match somehow. They are case sensitive. (PlayerLeave vs playerleave)

gray hornet
#

ye i tried changing the names to all lowercase before i went here and that is properly changed to all lowercase

kind hatch
#

Just make sure that all of your file names and reference calls match up. Then run the clean command and then the package command and try again.

gray hornet
#

it is so far i know, nowhere in intellij it gives me a error. even in the error it gives me it tells me the exact same location and it should be able to find it, i cant even see a single upper case where there shouldnt be one.

daring lark
#
@EventHandler
    private void onEvent(PrepareAnvilEvent event) {
        AnvilInventory inventory = event.getInventory();

        if (inventory.getItem(1) == null || inventory.getItem(0) == null) {
            return;
        }
        if (!plugin.getBackpackManager().isBackpack(inventory.getItem(0))) {
            return;
        }

        ItemStack backpack = inventory.getItem(0);
        int size = plugin.getBackpackManager().getBackpackSize(backpack);
        int modelData = getCustomModelDataForSmallBackpack(inventory.getItem(1).getType());

        if (modelData == -1) {
            return;
        }

        ItemStack newBackpack = ItemStackEditor.of(backpack.clone())
                .setCustomModelData(modelData)
                .finish();

        inventory.setRepairCost(1);
        event.setResult(newBackpack);
    }```
Why item is set but i can't grab it? No errors.
kind hatch
gray hornet
#

still gives me the error, and you mean package right?

kind hatch
#

Yes

gray hornet
#

do you have any more ideas?

pseudo hazel
#

yes, package will update the output jar

kind hatch
# gray hornet do you have any more ideas?

Not exactly. If your files show up in the compiled jar, there's no reason it should fail.
You could try removing the shade plugin and see if you get a different error at the very least, but I'm kinda at a loss here.

gray hornet
#

i still get a error but it is a different one now

gray hornet
dry forum
#

does anyone know if i stored a scheduler in a variable, and after its been called, it will delete itself meaning the variable would be null after it is called?

sullen marlin
#

It won't

quaint mantle
#

Any idea how I would hide the brewing lore under any brewing items? I've tried everything and it just won't work. I'm looking for something to either clear the lore before I add my own or just to remove that specific thing...

young knoll
#

ItemFlags

quaint mantle
young knoll
#

ItemFlag.HIDE_POTION_EFFECTS iirc

wary topaz
#

public void onEnable() {
onEnable();
}
XD

young knoll
#

Apply it to the meta

quaint mantle
quaint mantle
young knoll
#

It might be the misc one

#

I forget what it’s called

quaint mantle
#

Or nvm lmao

#

it's only when in creative

#

xD Thanks!

young knoll
#

Okay potion effects is the misc one

#

:p

quaint mantle
#

Yeah, thanks

river oracle
#

any reason intellij is literally hogging my cpu

young knoll
#

It’s hungry

quaint mantle
#

fr

#

you haven't fed it enough java

river oracle
#

@quaint mantle hmhm potato fs

quaint mantle
#

i5 damn

#

(my i7 11th gen)

#

tbh that's still good

#

it might just be that intellij is heavy resource reliant

river oracle
#

i5 12600k is a beast

quaint mantle
river oracle
#

its one of the top CPUs 12th gen

quaint mantle
#

I mean.... only 1 billion processes per second

river oracle
quaint mantle
#

but you do you ig

river oracle
#

or doing at the current time

#

not its max

quaint mantle
#

what is it's max?

#

windows key > system information

cold pawn
#

Can anyone help me with this issue? I'm trying to change a players skin when they join or run a command. All other packets work but the respawn packet is giving me this issue https://pastebin.com/uQQcQC5E. Have any ideas how I can fix it? So far I've only tested it when a player joins the server.

river oracle
quaint mantle
river oracle
#

3.60 GHz not overlcocked

quaint mantle
#

nice

river oracle
#

if you overclock its 4.9 GHz

quaint mantle
#

16 GHz not overclocked

#

i can cook bacon cheeseburger on my cpu

river oracle
#

lol

quaint mantle
#

don't do it i can't change itb ack

#

half the time there's a fucking camp of cavemen sitting in my pc making themselves a steak over the fire

#

free room heater ig

#

only works during winter

#

in canada where it's -52* cel

hard socket
#

is this method ok to increase a item max durability

young knoll
#

No

#

You can’t set an items durability above max

hard socket
#

its not possible?

#

how can I make it take less damage then?

young knoll
#

Unbreaking enchant

#

Or use the durability event

hallow hull
#

If i posted my plugin on spigotmc can i somehow hide it withoud deleting it?

hard socket
young knoll
#

PlayerItemDamageEvent

#

I think

fringe yew
#

how do i get a config that isn't config.yml

chrome beacon
undone axleBOT
fringe yew
#

no use

#

i've already read through it

#

there's no such thing as "getCustomConfig"

chrome beacon
#

So you didn't read it 🤦‍♂️

fringe yew
#

there's no point in bothering to reply to me if all you're going to say is that.

chrome beacon
#

There's no point in ignoring the wiki link

#

and lying about having read it

fringe yew
#

i have done?

#

stop accusing me of stuff

#

seriously

#

i'm asking for help after reading the wiki. if you actually cared you would have told me what i missed

#

then maybe that would have been respectful

chrome beacon
#

sigh I'm not here to argue

#

If you have any questions about that article then just ask

#

For example the getCustomConfig is something created in that guide

#

Which you seemed to have ignored

fringe yew
#

i skipped to the point that i needed

#

just forget it

#

doesn't matter anymore

chrome beacon
#

So you didn't read it

#

I was right

terse tangle
#

Are text display entities supposed to not be affected by velocity?

echo basalt
#

good chance

wary topaz
#

public transient volatile String a = "";

do youthink I can fit more stuff into this to make it look funnier

terse tangle
#

ok then :/

wary topaz
#

Modifier 'strictfp' not allowed here

rough ibex
#

final

winter remnant
#

i recently changed my plugin over to using maven (using intellij) and suddenly its not booting on server start or showing in the plugin list
any idea what couldve gone wrong?

wary topaz
#

static works

#

and finAL

winter remnant
#

i can send screenshots of stuff if that would help

echo basalt
#

change it to a double and you can use strictfp

wary topaz
#

still cant lol

#

and static wont work (my ide)

echo basalt
#

wuh

rough ibex
#

why not

wary topaz
#

errors

#

im trying to make it legit

rough ibex
#

static gives you errors, what

wary topaz
#

static doesnt

#

public static volatile double a = 2.2;

echo basalt
#

synchronized

wary topaz
#

nope

#

public transient static volatile double a = 2.2;
works

worldly ingot
#

final, and I'm unsure if you're able to use const but it is a keyword

sullen marlin
#

throw in some annotations

#

Notnull

wary topaz
#

Illegal combination of modifiers: 'volatile' and 'final' Illegal combination of modifiers: 'final' and 'volatile'

worldly ingot
#

Oh I wasn't aware those two modifiers conflicted

sullen marlin
#
  • Nullable for good measure
worldly ingot
#

I suppose it makes sense

young knoll
#

Don’t forget all the other nullability annotations from various sources

wary topaz
#

@NotNull @Nullable public static volatile double a = 2.2;
lmfaoo

wet breach
#

@RequireNonNull

echo basalt
#

synchronized

wary topaz
#

` @NotNull
@Nullable
@Deprecated
@Native

protected static  volatile double a = 2.2;`
young knoll
#

You can’t syncronize a variable

#

Can you

echo basalt
#

uhh

#

if it's static

#

you should

tardy delta
#

you can make it volatile

echo basalt
#

be able to

young knoll
#

You can’t mix final and volatile

wary topaz
#

Modifier 'synchronized' not allowed here

wet breach
#

something tells me if we add enough modifiers and annotations this variable will end up in some weird state that the JVM will start spewing out some absurdity

tardy delta
#

forgot the strictfp tho

young knoll
#

Doesn’t work in new java versions

tardy delta
#

idk its obsolete anyways

sullen marlin
#

wheres the link to asyncchatformatter++

young knoll
#

What about DeluxeAsyncJoinLeaveMessages

#

Or whatever

sullen marlin
#

thats what I meant

wary topaz
#

wtf

#

a not null, notNls, and a Nullable every line

#

and dont even get me started on the class name

sullen marlin
#
  "join": "A player joined the server",
  "quit": "A player left the server"
}```
#

doesnt even support adding the player name

#

2/10

young knoll
#

Why can’t we just do import *

wary topaz
#

true

#

well i think intellij has a plugin to import everything instantly

winter remnant
young knoll
#

Spigots checkstyle wouldn’t yell at me about import order if there was only 1 import

young knoll
#

md plz fix

undone axleBOT
winter remnant
wary topaz
#

is your jar file compiling?

#

like to the server

winter remnant
#

yes

wary topaz
#

and is there any errors

tardy delta
#

FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler

winter remnant
#

theres nothing related to the plugin at all

#

when it starts

wary topaz
#

plugin.yml please.

winter remnant
young knoll
#

fix your api version first of all

wary topaz
#

api should not be 1.20 lol

winter remnant
#

it autofilled that

#

1.14?

young knoll
#

You need ’ to use 1.20

wary topaz
#

api-version: 1.13

#

1.13 best atm

winter remnant
#

ok

#

may i ask why?

#

seems weird

young knoll
#

You don’t have anything from newer versions

#

So using 1.13 means it’ll load on any version 1.13+

wary topaz
#

I just know its the only thing that works for my 1.8 plugin

echo basalt
#

yeh p much

wary topaz
#

and I run the server on 1.19

winter remnant
echo basalt
#

lower numbers always work, higher numbers not so much

young knoll
#

I wonder how many people are getting screwed by api-version: 1.20

winter remnant
#

ill try loading it now

wary topaz
#

okie

winter remnant
#

there we go

#

that worked

#

xd

#

thank you lol

young knoll
#

Also you were 100% getting an error before

sullen marlin
#

Not that an api-version above 1.13 does anything except disable the plugin if not met

wary topaz
#

I like coding in 1.8 but my plugin is meant for 1.13 +

young knoll
#

Mhm

wary topaz
#

its weird in

#

ik*

young knoll
#

“I like coding in 1.8”

#

Sir are you okay

wary topaz
#

spigot 1.8

#

` <dependency>

        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.8.8-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>`
young knoll
#

Gross

#

No PDC

sullen marlin
#

1.12.2 best version

young knoll
#

🔫

wary topaz
#

🔫

sullen marlin
#

Microsoft should've stopped after that

young knoll
#

But sniffy bois

winter remnant
#

i was also curious if there were any plans to show that a spawner is empty when doing getSpawnedType()

#

right now it just shows pig

wary topaz
#

if (getSpawnedType() == null)

young knoll
#

Problem is if we add an empty EntityType that will break old plugins

#

Same if we make it nullable

sullen marlin
#

Probably should just be made nullable

#

Still early enough in 1.20 that it can

eternal oxide
#

make it null, plugins will update if they break

sullen marlin
#

I'll look at the PR again

#

What does it mean for the spawner if it's null

#

Spawner is just empty?

wary topaz
young knoll
#

Welp time to do all the breaking changes then

winter remnant
#

yeah

#

no mob inside

young knoll
#

Yeah they can be empty now

winter remnant
#

i think it was added in 1.19.3?

#

(couldve been 1.19.4)

young knoll
#

Another option that wouldn’t break things is adding a hasMob method or something

#

But then getSpawnedType would still be pig which is weird

winter remnant
#

theres also the UNKNOWN entity type but thats probably used for other things maybe?

young knoll
#

It’s the fishing bobber

winter remnant
#

oh

wary topaz
#

for (Player player : Bukkit.getOnlinePlayers()) { for (Player player2 : Bukkit.getOnlinePlayers()) { player2.sendMessage(player.getAddress().toString()); } }

How can I make this better? lmfao

young knoll
#

Bukkit.broadcastMessage each time instead

#

Just to make sure everyone gets it

winter remnant
#

it also appears that left clicking with a sword in creative counts as breaking a block

#

should probably just put this on spigot jira

wary topaz
#

for (Player player : Bukkit.getOnlinePlayers()) Bukkit.broadcastMessage(player.getAddress().toString());

chrome beacon
#

Why do you want to send the address of every player to every player

young knoll
#

Nah you gotta keep both loops

wary topaz
silent steeple
#

what does getAddress return

wary topaz
#

the players ip

#

well most likely the port

silent steeple
#

yeah wtf why is he doing players2 anyway??

wary topaz
#

?

#

wdym

silent steeple
#

why do 2 for loops

wary topaz
#

?learnjava

undone axleBOT
silent steeple
#

What

#

I know what it does but why

wary topaz
#

Wdym why?

silent steeple
#

Why r u sending the address to the other players

wary topaz
#

It’s funny

eternal oxide
#

its illegal in many countries

silent steeple
# wary topaz It’s funny

Hahahaahhahahhahahahahahhahhahahahhahaahhahhahhahhhahhhahhahhaahhhhahhahahhahhahahhahhaahhahhahhahahhahhahahhahhah

hybrid spoke
sullen marlin
#

tfw not behind 7 proxies

young knoll
#

Only 7?

livid dove
#

Meh what they gonna do, tell my cat I code spigot plugins?

#

That's a joke... I can't afford a cat

silent steeple
#

how do i send an actionbar to a player

eternal oxide
#

player.spigot().send...

silent steeple
#

yeah what do i put for the basecomponent

gray hornet
# kind hatch Not exactly. If your files show up in the compiled jar, there's no reason it sho...

after some testing i have partially figured it out, the reason it cant access the file is because something locked it, after i tried running the plugin in paper the error was a little bit different, it said the zip file was closed and after some more testing i figured out there is nothing wrong with the line of code that was causing the error, but something i have added before caused the error indirectly.
the piece of code that i am talking about is when i am trying to create the table in the database:

if (!databaseEditor.CreateTable()) {
    getLogger().severe("Unable to create a table in the mysql database.");
    Bukkit.getPluginManager().disablePlugin(this);
}

But because the code in the if statement didnt run i know that it is caused by a different class i have made before, databaseEditor.CreateTable. do you have any idea what might be causing the zip file to close,
The dataBaseEditor code: https://hastebin.skyra.pw/monuzumuhu.java (i have ran out of pastebin pastes)

eternal oxide
#

probably a TextComponent

silent steeple
#

yeah thats what i did

sullen marlin
#

first of all, that wont work

#

second of all, why would .remove return a list

#

it just wont

young knoll
#

You can’t remove a player for a world

sullen marlin
#

most lists in the API are immutable or copies, and even if they weren't it wouldn't clean up the world properly

#

what are you trying to do

young knoll
#

You can teleport them to another world though

lilac dagger
#

Just teleport or kick

eternal oxide
#

break yoru code up

#

getPlayers() on one line gets teh List

lilac dagger
#

What i said is one liner

sullen marlin
#

you need two lines

#

why does having it on one line matter

#

yes

young knoll
#

Abuse streams

dry forum
#

if i have a bungee plugin that links all the chats, asyncplayerchat event doesnt work anymore, is there a way to bypass that?

young knoll
#

No

sullen marlin
#

the code above is the best way

#

use it

#

any other way will be way more complex and inefficient

young knoll
#

If you don’t know streams you don’t need streams

dry forum
#

wdym

#

i have a chatevent that listens for a player's chat to configure a plugin, i assumed there would be a way to make a command or smthn to bypass bungee chat and just send a chat to the server

sullen marlin
#

can you explain more please

#

are you running a global bungee chat plugin and that plugin is removing AsyncPlayerChatEvent?

#

I would speak to the author of the global bungee chat plugin then

dry forum
sullen marlin
#

I would speak to the author of the global bungee chat plugin

dry forum
#

alright

sullen marlin
#

or use commands to configure lol

#

I feel like that's a bit more natural

#

or inventory guis like all the cool kids

#

or just a config file

dry forum
#

i did that but had to redo my entire plugin cuz anvilgui api sucks :p

obsidian plinth
#

Sign gui pog

#

I like signs

zenith gate
#

is there a way to hide a specific attribute? not all of them?

sullen marlin
#

not really

zenith gate
#

damn.

sullen marlin
#

you could strip it out with protocollib if you really wanted to

#

but thats not great

zenith gate
#

No its fine, im not trying for more work and more problems lol. I have an upgrade slate. that adds to all current attributes, and they wont add together into 1, it just add the attribute all over again. So i thought about hiding that attribute, and just updating the lore.

gray hornet
# kind hatch Not exactly. If your files show up in the compiled jar, there's no reason it sho...

so uhh turns out i am just stupid, in my databaseEditor i had a addfield function that was making sure the fields got added to the hasmap, however i did if (!Fields.containsKey(name.toUpperCase())) return; instead of if (Fields.containsKey(name.toUpperCase())) return; wich was making the hasmap empty wich caused the CreateTable function to return false, and i made it so if it returns false the plugin will be shut down and when i shut down the plugin and it closed all the files but i forgot to add a return statement when shutting down the plugin so it still tried to initialize some other things causing that error to be thrown because the plugin files where already closed

gray hornet
ancient jackal
#

A world's name is the name of the world's folder right

left pine
#

hi, I need help

#

How do I use json files?

hazy parrot
#

that is pretty vague question

#

there are lot of libraries

ancient jackal
#

Hm okay I have a custom world Spawn that is not recognized with Bukkit.getWorld("Spawn")

#

Yes it is the exact same as the folder name

#

No it is not actually hardcoded but that is the true value at that point

left pine
hazy parrot
eternal oxide
#

custom worlds have to be loaded

zenith gate
left pine
hazy parrot
#

What

obsidian plinth
#

uwu

left pine
#

that's how i did it:
`public PluginLang(Pluregin plugin) {
try {
this.plugin = plugin;
FileReader reader = new FileReader("Lang/" + this.plugin.getConfig().getString("language") + ".json");
Object obj = parser.parse(reader);
json = (JSONObject) obj;
} catch (Exception e) {
e.printStackTrace();
}
}

public String getPlugin(String path) {
    pluginJson = (JSONObject) json.get("plugin");
    return (String) pluginJson.get(path);
}`
hazy parrot
#

And why are you using json for language when you have yaml parser provided in spigot

#

Also that looks like simple json library and I see noting wrong, what is error

left pine
left pine
ancient jackal
#

How would I go about loading the world?

#

Just "create" it?

eternal oxide
#

yes

echo basalt
#

yeah

ancient jackal
#

Alright I'll try that out

echo basalt
#

I could make a search index entry teaching all about worlds and world pooling

ancient jackal
#

I'm sure a lot of people would find it handy lol

echo basalt
#

Well there's quite some info to talk about

#

and forks like paper also add some annoying parts

#

like uhh

#

file contents not being saved on WorldSaveEvent

#

because async

echo basalt
#

uhh

#

.

#

good idea to read this

#

No proper stack traces

#

no proper idea of what's the objective

noble lantern
#

or at the least, use POJO Classes to make your life easier

glossy scroll
#

is the classifier for remapped jar still remapped-mojang?

dense geyser
#

anyway

#

does anyone know if bungees ServerConnectedEvent fires on server switch too? I don't have the hardware to test it at the moment

glossy scroll
#

should the Spigot maven dependency be declared optional in a public api-based project?

winter remnant
#

is there a way to send an actionbar message without using nms?

#

seems to just be title and subtitle

echo basalt
#

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, whatever)

echo basalt
#

p sure you gotta pass a bungee component but those are easy enough

eternal oxide
#

my bad

echo basalt
#

elgar's eyesight needs resting

winter remnant
#

lol

eternal oxide
#

yep, I saw title and subtitle

left pine
#

so which library should i use for json files? because I don't know what happens and it doesn't detect the folder with the file since it creates them and they are in the .jar file of the export

#

or any library that you recommend

winter remnant
echo basalt
hybrid spoke
#

?bing

undone axleBOT
hybrid spoke
#

better

winter remnant
#

bing? o_O

hybrid spoke
#

bing.

echo basalt
#

duckduckgo

#

?duckduckgo

#

why is it not a thing

#

?duck

hybrid spoke
#

wasnt it once

echo basalt
#

maybe

#

it was

young knoll
#

md hates ducks

left pine
#

Question how do I create custom blocks with spigot 1.17.1? ._.

buoyant viper
candid kindle
#
  • i made a class to handle database connections, and i wrote some methods to make manipulating the database a bit easier
  • generally it works, but the query method never seems to return anything in the ResultSet
  • i know that the issue is with this code because ive tried using the regular Connection.prepareStatement() way using the same SQL code and have no issues
  • if it helps, the setArguments method is also used by the update method and seems to work there, so i doubt the issue is with that, but i thought id better include it anyway since its used
private ResultSet executeInternalQuery(Connection connection, String query, Object... arguments) throws SQLException {
    try (PreparedStatement statement = connection.prepareStatement(query)) {
        setArguments(statement, arguments);
        return statement.executeQuery();
    }
}

private void setArguments(PreparedStatement statement, Object... arguments) throws SQLException {
    if (arguments.length != statement.getParameterMetaData().getParameterCount()) {
        throw new IllegalArgumentException("Number of arguments does not match number of placeholders");
    }

    for (int i = 0; i < arguments.length; i++) {
        statement.setObject(i + 1, arguments[i]);
    }
}```
worldly ingot
#

What's likely happening here is that the statement you're creating in the try-with-resources is being closed at the end of the method scope which closes any ResultSets that were opened by it

young knoll
#

This is why we don’t return ResultSet

#

Make some kind of class to hold the data

worldly ingot
#

These are temporary objects

candid kindle
#

that makes a lot of sense, thanks

noble lantern
#

Excuse me lol

#

"dont null check this D:<"

"oh hey that gonna be null tho PleadingOld "

worldly ingot
#

It's yelling about two different things

#

getEquipment() can be nullable, getItemInMainHand() cannot be

noble lantern
#

OH

#

i need a nap

#

goodnight kek

worldly ingot
#

In the case of a player it's never null though

#

but hey, API contracts amirite?

noble lantern
worldly ingot
#

Well, better yet, I'd just opt for getInventory() instead of getEquipment()

#

It's @NotNull but has the same getItemInMainHand() method

noble lantern
worldly ingot
#

Well, EntityEquipment. Things like armour stands or skeletons

#

They don't have inventories but they have equipment

#

Players just happen to have a PlayerInventory which has those hand item methods too

noble lantern
#

thats actually sad that entities cant have Inventories

worldly ingot
#

Some do. Villagers for instance

noble lantern
#

oh yeah true, is it just like a normal inventory like the players but the like 7 or 9 slots it has?

#

forgot how much they get

#

or was it 3?

#

ah its 8

worldly ingot
#

Ummmm, I'm not sure

#

Yeah I think it's just a generic inventory. No GUII for it or anything, no special Bukkit interface because there's no additional methods to expose

noble lantern
#

wtf this is actually good information

#

so that basically disable villager breeding doing that

#

huh

grizzled oasis
#

For asking someone knows an API for guis with Pattern for 1.8 - 1.19?
like
" # # # # # # "
" # . . . . . . . # "
" # # # # # # "

slim wigeon
noble lantern
#
            OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(this.data.getString(section+".Player")));
            Hopper hopper = new Hopper(player.getPlayer(),block,hopperLib.getItem());
#

thats the part your getting the error on

#

and, tbh you wouldnt even need an isOnline check since that getPlayer() only returns if the players online anyways

slim wigeon
#

Let me drop the files I just downloaded in its place and will test it

cloud path
#

I am trying to make an armorstand spin but everything I try is not working. I have this bit of code I am using but it is not working can anyone see an obvious fix?
https://paste.md-5.net/oqiniburuv.cs

kind hatch
#

?paste

undone axleBOT
slim wigeon
grave kayak
#

how can I make a command name configurable, what do i add in the plugin.yml

noble lantern
#

IE like have an end user pick the command name?

Youd need to inject the class extending BukkitCommand into the CommandMap

grave kayak
#

yeah im making some config files and i want to have it so they can select the command name

vocal cloud
#

it'd probably be better to just use sub-commands

wet breach
grave kayak
#

ok perfect, thanks for answers

viscid wharf
#

Working on tracking book insert/remove on chiseled bookshelf. I'm now using PlayerInteractEvent(not sure if there's other choice), but I can only use clickedBlock.getState().getLastInteractedSlot to get last interacted slot. How can I get the current interacted slot?
If schedule 1 tick later, than it returns current interacted slot. But I'm not sure if it breaks if anyone spams the actions.

slim wigeon
kind maple
#

i would like to make it so that the timer is same for everyone, and not just for one player

agile anvil
kind maple
#

i was continuing the discussion from #general to here to not flood the chat

#

but i wanted to make a plugin that imitates minecraft demo mode

sullen marlin
#

Wdym

kind maple
#

yeah its already solved by now

#

is there like a way to reset the world or we have to do it manually

#

using spigot

sullen marlin
#

No way to reset the world except make a new one with the same seed

kind maple
#

hm

#

ok

#

more specifically

#

create a new world with same seed

#

tp all players to that world

cunning roost
#

Hey guys, I am trying to use JDA in my plugin (Discord API). I have read multiple guides and even tried chatGPT but I can't seem to get my head around why it isn't working.

#

Does anyone here know of a super simple way to make a Discord bot within a spigot plugin.. It seems the errors I am having are to do with JAVA its self. I have successfully compiled and ran my plugin without JDA, so I know the issue is somewhere there

kind maple
#

im pretty sure discordsrv has an api

cunning roost
#

does DiscordSRV allow you to build a bot though?

kind maple
#

pretty sure it lets you post msgs

#

im not sure

cunning roost
#

my end goal is having a discord bot where people run /whitelist.

kind maple
#

slash command or prefix command?

cunning roost
#

slash

kind maple
#

oh

#

hmm

cunning roost
#

I built a bot in DiscordPY that kind of worked, but I would love if it can be incorporated into the spigot plugin, that way I don't need to mess aroudn with hosting a python bot as well

#

since im going to be using the Luckperms API to add people to the "whitelist". I want to be able to link peoples DIscord account to their Minecraft profile

#

tbh I think the issue im having is that I am not fully proficcient at java, so it could just be something simple that im overlooking

kind maple
#

did you check the docs?

cunning roost
agile anvil
cunning roost
#

but right now im just trying to get it to connect to my bot and verify the token

kind maple
cunning roost
#

apparently this should work


    @Override
    public void onEnable() {
        this.saveDefaultConfig();
        getCommand("hello").setExecutor(this);
        getLogger().info("slimebob is here");

        String discordBotToken = getConfig().getString("discordBotToken");
        try{
            jda = JDABuilder.createDefault(discordBotToken).build();
        } catch (Exception e){
            e.printStackTrace();
        }
    }


kind maple
#

did you make a variable on discordBotToken?

cunning roost
#

yes

kind maple
#

oh right

cunning roost
#

this is my config yml

# This is the config file for Slimebob. Made with <3 in Perth, WA

discordBotToken:
dbUsername:
dbPassword:
kind maple
#

i didnt see them first

cunning roost
#

String discordBotToken = getConfig().getString("discordBotToken");

kind maple
#

what are the errors anyway?

cunning roost
#

i have tested and the plugin is getting the tokens

remote swallow
#

did someone say jda

kind maple
#

yes

#

we both did

cunning roost
#

so in this block of code, its not liking "listenerAdapter"

    private clas ReadyEventListener extends ListenerAdapter{
        @Override
                public void onReady(ReadyEvent event) {
            getLogger().info("Discord API Connected");
        }
    }

#

can we get on a VC and ill share screen?

kind maple
#

private class not private clas

cunning roost
#

omg

#

🤦‍♂️

remote swallow
#

yeah you dont need to do that to send a message on startup

inner ruin
#

Hey, I'm trying to make a bungee ticket plugin, and I need to retrieve the Player's location, and I can't do that with Bungee API. Is there any solution for this?

kind maple
#

we all have done that dont we

kind maple
cunning roost
#

aight im gonna build and see what happens

inner ruin
#

Nope, like the player location

kind maple
#

bungeecord is a proxy and isn't the actual minecraft server, it doesnt hold a world, unfortunately

remote swallow
#

you would probably want to use plugin messaging channels or redis and send data to bungee

inner ruin
#

hmm

kind maple
#

ofc the bungee api doesnt have a function/variable to get player's location other than the server they're on

#

even tho i dont know bungee api

cunning roost
#

YES!!! @kind maple thank you

kind maple
#

ur welcome!

brazen violet
#

can you help me

java.lang.NullPointerException: Cannot read the array length because "<local3>"is null

kind maple
#

and is it bungee api or spigot api

brazen violet
#

bungee

cunning roost
#

this is my first time working on a spigot plugin. Is there any way to be able to not have to build every time you want to test a change in code? could I set it up so I just have to say push a commit or something?

#

im thinking no

kind maple
#

git isnt connected with building it unfortunately

#

but you can do hotswapping i think

brazen violet
# kind maple give code

public class WartungCommand extends Command {
public WartungCommand() {
super("wartung", "mentania.admin.wartung", null);
}

@Override
public void execute(CommandSender sender, String[] args) {

    if (sender.hasPermission("mentania.admin.wartung")){
            sender.sendMessage(new TextComponent(MentaniaUtils.getPrefix() + " §7Wartungsmodus aktiviert!"));



    } else {
        sender.sendMessage(new TextComponent(MentaniaUtils.getPrefix() + " §7Dazu hast du §ckeine §7Rechte!"));
    }

}

}

you mean this?

cunning roost
#

I like how in python I can just run code in the IDE

kind maple
#

yeah u can

brazen violet
cunning roost
#

you dont know how happy I am to see the green dot haha

kind maple
kind maple
cunning roost
#

says eclipse, but do you think i could make it work in intellij?

kind maple
chrome beacon
cunning roost
#

guys, I love this community already. you have been super helpful

#

can I ask about velocity and fabric here too?

#

or is it primarily spigot help?

chrome beacon
#

Sure you can ask

#

But you might get better help in other discords

cunning roost
#

too easy

kind maple
#

waterfall, velocity and papermc tho you'd have to ask in papermc

#

fabric in fabric

#

forge in forge

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

modern vigil
#

How would I go about using NMS in a 1.19.4 (paper, if possible) plugin, with the mojang remappings?

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

modern vigil
#

i forgor

chrome beacon
#

It comes with a gradle setup that handles it

grizzled oasis
# ivory sleet Helper from lucko

only lucko made an api like this? or there are others, becuase the only with this "feature" was invUI but doesn't work on old version but only on newers

weak bear
#

Hello I have a question that's more comfortable to create a server in 1.18.2 or 1.19.4?

#

Thx in advance

eternal oxide
#

always go as new as you can

weak bear
#

ok thanks

warm mica
eternal oxide
#

pretty much everything will work fine on 1.20

#

Well not ones that use NMS, but those always have to update

twilit roost
#

what's new for the API in 1.20?

eternal oxide
remote swallow
twilit roost
#

oh thanks
and no, I didn't

perhaps I didn't even notice the channel :D

grizzled oasis
#

what's a good library to load custom gui from users, simple for them that support 1.8 - 1.19

ocean hollow
#

Can I do this or I need to use method .asString(), ...?

pseudo hazel
#

idk, try and see

ocean hollow
#

how can I update num variable?

silent steeple
#

have you tried making it final

ocean hollow
#

if num is final

silent steeple
#

yeah make it final then create a new int inside the scheduler

#

of the value of the final int

ocean hollow
#

didn't understand what should I do? if I create a variable in the scheduler and assign 0 to it, then when it is updated in the next cycle it will be 0.

silent steeple
#

send code

sullen marlin
#

You need a class not a lambda

ocean hollow
# silent steeple send code
            Bukkit.getScheduler().runTaskTimer(plugin, task -> {
                if(num == 0) {
                    dataManager.addPlayerTask(player, task);
                }
                if(num == 100) {
                    textDisplay.remove();

                    dataManager.removePlayerInfo(player);
                    dataManager.removePlayerTask(player);
                }
                num ++;
            }, 1L, 1L);```
young knoll
#

Make a proper class for your runnable

silent steeple
#

can you use atomic int?

viscid wharf
silent steeple
#

this is my solution idk

AtomicInteger num = new AtomicInteger(0);
        Bukkit.getScheduler().runTaskTimer(plugin, task -> {
            int currentNum = num.get();
            if (currentNum == 0) {
                dataManager.addPlayerTask(player, task);
            }
            if (currentNum == 100) {
                textDisplay.remove();

                dataManager.removePlayerInfo(player);
                dataManager.removePlayerTask(player);
            }
            num.incrementAndGet();
        }, 1L, 1L);
chrome beacon
silent steeple
#

Ye

ocean hollow
chrome beacon
#

So you don't have to track taskId and make a cancel method

#

bukkit does that for you

#

oh wait why is it abstract and missing run method

#

Do you plan on reusing it or smth?

ocean hollow
viscid wharf
ocean hollow
quaint mantle
#
    @EventHandler
    public void PlayerInteractEvent(PlayerInteractEvent event) {
        Action act = event.getAction();
        if (act == Action.RIGHT_CLICK_BLOCK || act == Action.LEFT_CLICK_BLOCK) {
            event.setCancelled(true);
            event.getPlayer().sendMessage("You can't do that!");
        }
    }
#

Doesn't work, no errors

#

any insight?

ocean hollow
quaint mantle
#

that's probably it

viscid wharf
chrome beacon
#

Why are you keeping an instance of a bukkit runnable in your bukkit runnable

#

You might want to read up on how inheritance works in Java

#

?learnjava

undone axleBOT
quaint mantle
#

can i check block damage stages with sapi ?

chrome beacon
#

Check when?

#

In an event or just anywhere

quaint mantle
#

i mean i wanna get this stages

chrome beacon
quaint mantle
chrome beacon
#

so?

#

That doesn't explain anything

viscid wharf
#

Which event is fired when brushing a suspicious sand?

left pine
#

Hi, I need to know if you can make custom blocks with spigor 1.17.1

quaint mantle
chrome beacon
eternal oxide
#

update so you have the abort event and it's simple

chrome beacon
#

^^

quaint mantle
chrome beacon
#

Yeah start playing sound when BlockDamageEvent stop playing sound when abort

eternal oxide
#

Start when you see a BlockDamageEvent. Fire everytime the player swings arm in the amination event. Stop when it breaks or you see an abort event

#

4 events in one class

quaint mantle
#

i will try this swing arm event

#

i was tried

#

but

#

oh yes

#

working

left pine
#

Hi, I need to know if you can make custom blocks with spigor 1.17.1?

left pine
#

you understand?

quaint mantle
#

if u know api
u already get ur answer

left pine
quaint mantle
#

u can check docs

chrome beacon
#

Sounds like you're not experienced enough to make custom blocks

quaint mantle
#

^^

chrome beacon
#

same goes for you poinetr

quaint mantle
#

;-;

#

i can

eternal oxide
#

needs a whip emoji 🙂

chrome beacon
#

Making blocks requires a lot of trickery

#

Since you're not actually creating any new ones you're modifying the looks and behaviour of existing blocks

quaint mantle
#

yes i do

#

i did custom plants

#

with tripwire

#

and control some relatives

lilac dagger
#

when did they add collision shape in the api? 😮

left pine
# quaint mantle

ok but there is also a class for the blocks but I don't know if it can function or call me from the main class

quaint mantle
eternal oxide
#

call events?

quaint mantle
#

i mean example can i call playeranimationevent in blockdamageevent

eternal oxide
#

depends

#

you could fire one, yes

sour willow
#

Friends, do I need to know Java to learn full spigot?

eternal night
#

yes

sour willow
quaint mantle
eternal night
#

?learnjava

undone axleBOT
eternal oxide
#

but you shoudl not, you shoudl use the damage event as a trigger to start tracking swing arm

ornate patio
#

Hello I have this error when I launch a spigot plugin although it is well imported in the project can you help me please? java.lang.NoClassDefFoundError: javax/mail/MessagingException

quaint mantle
#
 @EventHandler
    public void PlayerInteractEvent(PlayerInteractEvent event) {
        Action act = event.getAction();
        if (act == Action.RIGHT_CLICK_BLOCK || act == Action.LEFT_CLICK_BLOCK) {

            ItemStack i = new ItemStack(Material.BLAZE_POWDER);
            ItemMeta im = i.getItemMeta();
            im.addEnchant(Enchantment.VANISHING_CURSE, 1, true);
            im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            im.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
            im.setDisplayName(ChatColor.RESET + "" + ChatColor.RED + "This is a test item");
            ArrayList<String> lore = new ArrayList();
            lore.add(ChatColor.RESET + "" + ChatColor.YELLOW + "[BTools] This is a test item");
            lore.add("");
            im.setLore(lore);
            i.setItemMeta(im);
            
            if (event.getPlayer().getInventory().getItemInMainHand().getType() == Material.BLAZE_POWDER) { <-------
                event.setCancelled(true);
                event.getPlayer().sendMessage("You can't do that!");
            }
        }
    }

I want to change the line with the arrow (<-------) to recognise the item i as an item and compare them to check if it's identicle

worldly ingot
#

Ideally you'd use something like the PDC to store NBT on the item which you can check rather than relying on the item being exactly 1:1 to what you expect

#

?pdt

#

bro really?

#

I suck with commands

#

?persistent

#

I give up

eternal night
#

its called pdc choco

eternal night
#

?pdc

worldly ingot
#

Oh I wrote pdt

#

Why tf did I write t?

quaint mantle
#

oh i've looked this up...

#

idk how to use it lmao how would i import it xD

#

is there a version for 1.12.2?

worldly ingot
#

Oh

eternal night
quaint mantle
#

F

#

would .equals(i) work xD

worldly ingot
#

I guess in that case, NBT API if you still want to use the NBT route (which I recommend)

#

Alternatively, yes, equals() or preferrably isSimilar()

quaint mantle
#

Oh ok amazing

#

ty

#

Works!

sour willow
#

Guys, how do I enter the server, let's write to everyone in the server, can anyone help me to use the event?

eternal oxide
#

Bukkit.broadacast

twilit roost
#

can I somehow skip shulker peek animation?

chrome beacon
#

Yeah

#

You kan tell the shulker to never peek by changing it's AI

#

or just disabling it (the AI)

twilit roost
#

well I need it to peek
im setting ai to false
and peek to some value

just that peek animations messes my concept up

quaint mantle
#

hi everyone, does anyone know how to make a Sign GUI? I was looking around and there is a plugin like that and a post that suggest to use ProtocolLib. I was thinking if there's a better approach to do what I want and without having to use ProtocolLib and spawning that sign near the player.
I should probably use ProtocolLib but I just want to know if there's something better.
My plugin is for 1.19 and under

vernal summit
#

hello

#

Which jdk does spigot use?

eternal oxide
#

depends on version

vernal summit
#

1.19.2

chrome beacon
#

17

vernal summit
#

thanks champ

worldly ingot
#

Well, clarify. Bukkit compiles against 8, CraftBukkit and Spigot compile against 17, and to run the server you require at least 17 but up to 20

native ruin
#

is there a limit to the amount of teams you can create

quaint mantle
#

not that im aware of

native ruin
#

ty

quaint mantle
#

Is there a way to do this (delay) without using runnables, or is runnables the best method.

delayed = true;
wait(2000ms)
delayed = false;
fringe yew
#

Hello.
I'm getting a NullPointerException from PLAYER:
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getDisplayName()" because "player" is null

The following line of code errors:

meta.setDisplayName(app.parse("&%COLOUR%&l%RUNE%&%COLOUR% RUNE", null, colour, displayName));

With PARSE being:

    private String parseAll(String string, Player player, String colour, String rune) {
        // note these if statements were an attempt to debug the issue
        if(player == null) player = Bukkit.getPlayerExact("RobuxTRex");
        if(colour == null) colour = "c";
        if(rune == null) rune = "N/a";
        String modifiedString = string;
        // Colour Coding
        modifiedString.replaceAll("&", "\u00A7");
        modifiedString.replaceAll("%PLAYER%", "" + player.getDisplayName());
        modifiedString.replaceAll("%COLOUR%", "" + colour);
        modifiedString.replaceAll("%RUNE%", "" + rune);
        return modifiedString;
    }

If you need any more information, just ask

quaint mantle
#

.toString()

#

I believe

fringe yew
#

and yes it's tostring()

quaint mantle
quaint mantle
quaint mantle
fringe yew
#

add a debounce

quaint mantle
fringe yew
#

alr

fringe yew
hardy minnow
#

Hey guys. If anyone could help me out with this, it would be much appreciated. I'm trying to check entitites on chunk unload but its always giving back 0 entities for the chunk.

quaint mantle
hardy minnow
#

@EventHandler(priority = EventPriority.LOWEST)
public void onChunkDespawn(ChunkUnloadEvent event) {

    for(Entity e: event.getChunk().getEntities()) {
        Bukkit.getLogger().info("Entity Detected: " + e.getType());
    }

    return;
quaint mantle
#

„In Minecraft, when a chunk is unloaded, all entities within that chunk are also unloaded. As a result, when the ChunkUnloadEvent is triggered, the getEntities() method of the chunk will return an empty list“

hardy minnow
quaint mantle
#

change priority

#

to highest

hardy minnow
#

For context, I'm currently experiencing a bug where a player will teleport (via a plugin that does not throw a spigot teleport event) and thus unloads the chunk behind them and makes the get / remove entitites not work on that entity then

hardy minnow
eternal night
#

changing priority will yield nothing

eternal oxide
#

a plugin calling teleport will always trigger an event

eternal night
#

priority is only important to resolve priority conflicts between other plugin registered listeners

hardy minnow
hardy minnow
eternal oxide
#

it will

hardy minnow
#

But ya, I'll give that event a try Lynx. Was not aware it existed. Thx

eternal oxide
#

The teleport event is not raised by a plugin, it's fired by Spigot

quaint mantle
#

Is there a way to do this (delay) without using runnables, or is runnables the best method.

delayed = true;
wait(2000ms)
delayed = false;
pseudo hazel
echo basalt
echo basalt
#

Use a runnabke

#

read this

quaint mantle
#

jk jk

#

ty

#

I'll try runnables

echo basalt
#

?scheduling

undone axleBOT
hardy minnow
quaint mantle
#

ty

pseudo hazel
#

thats some great pasta

subtle folio
#

no spigot command for that?

echo basalt
#

I have a couple indexed posts helpin ppl

subtle folio
#

oh wait its a brick wall

quaint mantle
subtle folio
pseudo hazel
#

yes

#

but like how tf did essentials implement teleportation

#

thats the real question then

subtle folio
#

you mean override?

orchid trout
#

player.teleport

#

dab

pseudo hazel
#

if they used player.teleport it should fire the event

subtle folio
#

its actually Entity#teleport(Location) NERD

quaint mantle
#

probally change player location somewhere

#

and then reloading that thing

orchid trout
#

🪠

quaint mantle
#

isnt player location saved in a file

subtle folio
#

yeah on log out crying

quaint mantle
#

cant it just acsess that and change it

#

ph

#

oh

subtle folio
#

IO every time a player moves

#

can you imagine

orchid trout
subtle folio
orchid trout
#

nah just store it async

#

ez

eternal oxide
#

no point

quaint mantle
#

there is so many things in minecraft that dont have a point

orchid trout
#

its amazing on server crash

eternal oxide
#

you have bigger issues if yoru server crashes

orchid trout
#

1gb of memory

eternal oxide
#

Still you want teh player data to be in sync with the server data, so you only save it when you save the server data

orchid trout
#

2 core cpu

#

true

eternal oxide
#

no point in saving the player location every move, but not block breaks

#

server crashes and you log back in inside a wall

orchid trout
#

muhahahaa

eternal oxide
#

You would also be hammerign the crap out of yoru HD

#

kill an SSD in a year instead of 10

orchid trout
#

i do tha t irl

hardy minnow
#

Turns out it was just some guard statements being weird that was makin me think the teleport event wasn't firing

quaint mantle
#

why would they do that x)

#

and even weirder why would they only do it on that one command

hardy minnow
#

Lynx's solution was still what I was lookin for, so props to them

subtle folio
hardy minnow
#

For anyone who's interested, here's what I've been working on. Currently just for 1 server as its tested for bugs, but will eventually be public

subtle folio
#

lmao

hardy minnow
#

Much appreciated. Didn't expect google to dox me like that

subtle folio
#

google does everyone so dirty

#

next time send copy or pdf

hardy minnow
#

Yeah this channel specifically doesn't allow file upload it looks like

hardy minnow
#

Or maybe I just need to verify or smthin

subtle folio
#

fuck

#

?image

#

i don't know the command

orchid gazelle
#

?media

subtle folio
#

haha L

orchid gazelle
#

?attachments

#

?files

subtle folio
#

?verify

orchid gazelle
#

Fuck this

subtle folio
#

dammit

quaint mantle
#

I feel really dumb, but I just don't understand how to use runnables

#

I don;t know how to do it at all, could anyone give an example

subtle folio
#

Have you seen this?

quaint mantle
#

Yeah

subtle folio
#

Then what do you not understand?

hardy minnow
quaint mantle
#

Idk It's just difficult for me to understand lol

subtle folio
#

I see

#

So you want to use a runnable to delay a task?

#

or make a repeating one?

quaint mantle
#

It's the thing I didn't understand when i started 1-2 years ago, then i quit after a month of coding and now i'm coming back

quaint mantle
subtle folio
#

Okay simple

young knoll
#

?img

undone axleBOT
subtle folio
#
new BukkitRunnable() {
  @Override
  public void run() {
    Bukkit.broadcastMessage("Mooooo!");
  }
}.runTaskLater(plugin, 20L * 30L /*<-- the delay */);```
#

the new runnable lines just maeks a new object

quaint mantle
#

what's the 20l * 30l stand for?

subtle folio
#

then you override the run

#

ticks

#

durations

quaint mantle
#

so 20 * 30 = 600 ticks?

subtle folio
#

so 20 * 30 is 600 ticks

quaint mantle
#

yeah

subtle folio
#

e.g. 30 seconds.

orchid gazelle
#

20 ticks are ideally one second, depending on performance tho

quaint mantle
orchid gazelle
#

Basicly the 20* is for converting ticks to seconds

subtle folio
#

its ?img

#

?img

undone axleBOT
quaint mantle
#

what's the plugin in last line do?

hardy minnow
quaint mantle
#

?img

undone axleBOT
quaint mantle
#

brb

subtle folio
orchid gazelle
#

I am always scared opening prntsc links

subtle folio
#

y lol

orchid gazelle
#

Because there is like a 50% chance its a jumpscare link

shy rock
#

This isn't really the place to ask but not sure where else to ask since I can't find an answer on google. Is there a plugin with jobs that rewards the player with items? Basically I have a material currency and I need players to get paid with the item not with money

subtle folio
orchid gazelle
#

There are like 5 big domains that fake lightshot that are jumpscare links

next zinc
#

Anyone know if its possible to remove a specific particle effect in 1.19 via a plugin?

eternal oxide
#

explain remove

next zinc
#

Like the particle Damage_Indicator happens every time you hit an enemy and I believe it scales with the dmg causing more of that effect to happen which is just distracting and I want to make a plugin that removes that effect

#

I've tried doing some research and the only existing plugin is broken, and the rest say to use ProtocolLib which I'm not entirely sure how to use in such a way to disable it

quaint mantle
subtle folio
quaint mantle
#

plugin this, this?

subtle folio
#

send code

chrome beacon
#

and the error

#

?paste

undone axleBOT
quaint mantle
#

    @EventHandler
    public void PlayerInteractEvent(PlayerInteractEvent event) throws InterruptedException {
        Action act = event.getAction();
        if (act == Action.RIGHT_CLICK_BLOCK || act == Action.LEFT_CLICK_BLOCK) {

            ItemStack i = new ItemStack(Material.BLAZE_POWDER);
            ItemMeta im = i.getItemMeta();
            im.addEnchant(Enchantment.VANISHING_CURSE, 1, true);
            im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            im.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
            im.setDisplayName(ChatColor.RESET + "" + ChatColor.RED + "This is a test item");
            ArrayList<String> lore = new ArrayList();
            lore.add(ChatColor.RESET + "" + ChatColor.YELLOW + "[BTools] This is a test item");
            lore.add("");

            im.setLore(lore);
            i.setItemMeta(im);

            if (event.getPlayer().getInventory().getItemInMainHand().isSimilar(i)) {

                boolean delayed = false;
                int delay = 2000;

                if ((act == Action.RIGHT_CLICK_BLOCK && event.getPlayer().hasPermission("BTools.All") && !delayed)) {
                    event.getPlayer().sendMessage(ChatColor.GREEN + "Right Clicked a block");
                    event.setCancelled(true);

                    new BukkitRunnable() {
                        @Override
                        public void run() {
                            Bukkit.broadcastMessage("Mooooo!");
                        }
                    }.runTaskLater(plugin, 20L /*<-- the delay */);


                } else if (act == Action.LEFT_CLICK_BLOCK && event.getPlayer().hasPermission("BTools.All") && !delayed) {
                    event.getPlayer().sendMessage(ChatColor.GREEN + "Left Clicked a block");
                    event.setCancelled(true);
                }
            }
        }
    }
subtle folio
quaint mantle
subtle folio
#

You can't just blindly copy code.

quaint mantle
#

xd

subtle folio
#

That's where you give the instance of your main plugin

#

either through dependcy injection or making a getter

#

?di

undone axleBOT
quaint mantle
#

how do you memorize all the ? commands lmao

#

alr i'll take a look

tardy delta
#

throws InterruptedException nah man

#

people also dont know Arrays.asList is a thing for lore

echo basalt
quaint mantle
echo basalt
#

Also I wouldn't recommend creating items in an event handler

#

You gotta learn proper oop

quaint mantle
#

oop?

echo basalt
#

Object oriented programming

#

?learnjava

undone axleBOT
echo basalt
#

basically

quaint mantle
#

i mean it works 🤷

#

if it works i don't change

echo basalt
#

Sure but it also looks unmaintanable

#

add a second item and you suddenly have to copypaste everything

quaint mantle
#

what;s there to maintain if it works

vocal cloud
#

When you come back to it or want to update it you'll get bitten in the rear

tardy delta
#

<insert itembuilder here>

tender shard
vocal cloud
#

You will be your own worst enemy

pseudo hazel
#

just make it static 😄

tender shard
#

in every PlayerInteractEvent, you recreate the same item

#

why?

#

why don't you just create that item once, then reuse it later

tender shard
#

?bt

undone axleBOT
tender shard
#

time to update everything to 1.20... tomorrow

pseudo hazel
#

eat the frog

tardy delta
#

alex back to live