#help-development

1 messages · Page 1931 of 1

solid lion
#

basically if i removed that whole code within, //START NEW CODE and //END CODE and uncommented my switch the plugin would work fine

#

yes

sharp flare
#

then dont cancel the event

solid lion
#

i removed the cancel and it still didnt work

sharp flare
#

didn't drop anything?

solid lion
#

thanos

#

poof

sharp flare
#

your code can be improved a lot in terms of readability

solid lion
#

idk, it is pulling a lot of instances from my config class where i store all my variables and config options

sharp flare
#

debug it, add debug messages on every condition

#

pretty sure something is not getting fired from your if else statements

solid lion
#

mkay ima test it out with all my messages

sharp flare
#

please use methods

charred echo
#

So I got a function getFruits which returns a mutable List<Fruit> , In the fruit class I have a method makeApple which gives me an instance of a Apple class.

How would I do somethind like

val apples = getFruits().onEach { it.makeApple() }

and have the variable apple be of type List<Apple>

#

@ me

sharp flare
#

for the sake of readbility

solid lion
#

so it completly skipped the for statement and went down to the if statement doing the random number drop math

sharp flare
#

then I'd debug it there if its getting skipped

solid lion
#

wdym? it skipped my debug messages too

sharp flare
#

focus your debug there

#

it got skipped right?

solid lion
#

i see

sharp flare
#

try adding more blocks to your key section

granite burrow
#

how can I get chat color of a string?

solid lion
#

okay now its trying to hit my else statement to drop only one item yet it still drops nothing

sharp flare
granite burrow
sharp flare
#

haven't tried doing chat things, you may try #getFormat or #getMessage

#

thats from the docs

solid lion
#

79

#

i commented it out and then just added the drop amount to be 1 and it still doesnt drop anything though

#

could it possibly be setting Material drop = Material.AIR causing the issue?

sharp flare
#

if your setting the block to air then this should still give u drops

granite burrow
sharp flare
#

then use the other one

granite burrow
#

get message just returns the message not the color

sharp flare
#

when they send the message does it include the "&colorcode" when u get it through #getMessage?

granite burrow
#

no its a formatted chat color message let me try to strip the colors and see what I get

sharp flare
#

so #getMessage just sends a stripped color?

granite burrow
#

to console yeah its stripped of its color, to chat is has all the color, ill show you what I see

#

thats what e.getMessage is

solid lion
#

sigh im about to summit1G my monitor

sharp flare
#

is it on github?

solid lion
#

sure gimme a moment to push it to github

sharp flare
#

aight

sharp flare
solid lion
#

just normal itemstacks, but i do have a custom item in there as an option for whoever wants to use it

#

it still uses the itemstacks though,

sharp flare
#

oh you're using commands to toggle it on

solid lion
#

mhm theres the main command /as to turn it on and off, then asreload to reload the config and /smelt {name} to recieve a pickaxe that autosmelts

sterile token
#

What the difference between: Class<?> clazz and Class<T> clazz?

sharp flare
#

first one is a wildcard

#

second one is generics

sterile token
#

Yeah and about working?

#

Its the same or its different?

sharp flare
#

they have different uses

sterile token
#

And thanks for answering

sharp flare
#

you might wanna check java docs

sterile token
#
public class Service<T> {

    private final Set<Object> services = new HashSet<>();

    public void register(T service) {
        this.services.add(service);
    }

    public void unregister(T service) {
        this.services.remove(service);
    }

    public T get(Class<T> service) {
        return this.services.stream().filter(clazz -> clazz.getClass().equals(service) || clazz.getClass().isAssignableFrom(service)).map(service::cast).findAny().orElse(null);
    }
}
#

What do you think?

sterile token
#

Im open to recommedantions

#

I just ask to understand your idea

granite burrow
#

how can I get the color of a string?

#

The text is already formatted

blazing scarab
sterile token
blazing scarab
sterile token
#

val?

sharp flare
#

kotlin

sterile token
#

Ah that why didnt understand

#

I was thinking that syntax its not from java

sharp flare
#

@solid lion

#

your code is logic mess

#

100% will not work, after debugging it myself

#

I guess you gotta rewrite your code, I managed to make it work

#

fixed the problem your having, you gotta rewrite it yourself . also the items that is being retrieved from the config are never gonna be used unless you make a list outside of the forEach and assign it from there, the main culprit you're not having any drops cuz ur cancelling the event and setting your variable drop to Material.Air, your debugging messages never get sent Idk what utils ur using for that buts it not working and most of all your if else statements are in need of rewriting they are logical mess and thats the reason its not working, your getconfig for retrieving the keys doesn't work so I fixed it in there

charred echo
undone axleBOT
tranquil viper
#

Anyone know why this wouldn't show the player or hide the player properly?

#

It seems to hide them but never ends up showing them

sharp flare
tranquil viper
sharp flare
solid lion
#

Thank you i am already planning on rewriting it, this was my first plugin and it was teaching me to learn java so im still trying to learn better habits and create reusable code 🙂 @sharp flare

tranquil viper
sharp flare
# tranquil viper wdym

the one your passing to the parameter of #showPlayer or #hidePlayer is the one that will be hidden to all online players

solid lion
#

Its taken me 3 years to get it that far lmao

tranquil viper
#

can't believe I did that

#

that's what I get for writing a plugin at 10:20 pm

#

thanks

sharp flare
#

no problem 🙂

sharp flare
#

just change your toVanish variable to online for readability

quaint mantle
#

Hi, so I just used custommodeldata to make a new item. I made a dagger, and it’s overriding the iron sword model. Is it possible to make this dagger independent? As in it can’t use any sword enchantments, and is identified as an independent item

short raptor
#

How can I open a link for the player? I've looked at some threads that say it's only possible when the user explicitly clicks on the link in chat but I know that's false because Hypixel has features where you can click an item in a GUI and it opens a link which is exactly what I want to do

sullen marlin
#

uh

#

pretty sure its not possible

#

do you have a mod installed

short raptor
#

Oh

#

I think I might be mistaken actually

#

LOL IM SO DUMB

#

They use a book

#

Sorry

sullen marlin
#

yes that is possible

#

works the same as chat

raw ibex
quasi flint
#

He literally said how to do it

#

Literally the first link

#

Is the spigot forum

quasi flint
quaint mantle
#

Gone, reduced to atoms

terse ore
#

which's the difference between creature and entity?

quaint mantle
#

They are the same

#

In the game

terse ore
#

does EntitySpawnEvent only detect entities spawned naturally?

#

Or also spawned with spawners

hybrid ledge
#

What is general consensus for libraries? I have one Core plugin with libraries shaded inside JAR and my other plugins are using this Core plugin.
Is it better to use that new mechanism for libraries introduced with 1.17 so libraries will be loaded from Maven central at runtime?

quasi flint
hasty wasp
terse ore
#
    public void onSpawn(CreatureSpawnEvent event) {
        System.out.println("test");
        if (event.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.NATURAL)) {
            System.out.println(event.getEntity().getName());
        }
    }```
#

It does not detect mob spawning

#

am I doing something wrong?

quasi flint
#

U got @EventHandler ?

#

And registered it in onEnable

terse ore
#

freaking stupid

#

yeah @EventHandler

quasi flint
#

Kk

terse ore
#

oh yes

#

omfg

#

this many mobs spawn at the same time

#

holly cow

gloomy arch
#

I have a noob question, if I wanted to damage a player every 1.25s when he has a certain state, where would I keep track of this time.

terse ore
#

scheduling?

#

?scheduling

undone axleBOT
gloomy arch
terse ore
#

yw <3

zinc spire
#

how can i cancel the map render task?

#

Ok

#

So if i stop rendering it , the image will disappear or stop updating (freeze)?

terse ore
#

I was trying to make a push command but this isn't pushing

public class test implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = ((Player) sender).getPlayer();
        player.setVelocity(player.getVelocity().multiply(2));
        return true;
    }
}```
#

lemme try that

#

the reason it wasn't pushing was because of I haven't said where to push?

raw ibex
terse ore
#

still not pushing :c

#

no

#

but it's the same right?

#

still the same

sharp flare
#

redundant

#

casting sender is enough

terse ore
#

k stupid issue

#

srry 4 bothering

tardy delta
#

Name your class Test not test

mortal hare
#

UIContainerElementPane<T extends UIContainerView<? extends UIContainer<T>>> extends UIContainerElement<T>

#

mmm yesss

#

generics

terse ore
#

so doesn't rlly matter

#

oh okok

tardy delta
#

Never start your class name with lowercase

terse ore
#

only that one is lowercase

calm linden
#

?resources

undone axleBOT
calm linden
#

?learnjava

undone axleBOT
terse ore
#

it was (Player) sender

#

without .getPlayer()

sharp flare
blazing rune
#

How do I get the last player alive?

quasi flint
#

?

#

Iterate over online players and check if game mode = 0

#

Last player standing

blazing rune
quasi flint
#

Why tho?

blazing rune
#

Cuz like

#

It will also get the other players

#

Who are not dead yet

quasi flint
#

U filter for SURVIVAL players

#

Or creative the shit u want

blazing rune
#

Hmmmmmmmmmmmmmm

#

I'll give that a try

#

Also

#

1 more thing

#

How do I reset a countdown timer I made

quasi flint
#

How shall we know?

#

We don't have your code

blazing rune
#

I mean like

#

When it ends

#

It will reset

quasi flint
#

We need ur code

#

So we can do shit

#

Yes man

#

Line 1750277492

#

The if else statement

#

Got a null value

#

@blazing rune get out of my dms

#

Rather quickly

#

?paste

undone axleBOT
blazing rune
#

THere

#

Finally I can talk

#

@quasi flint ^

quasi flint
#

I am in school

#

No pinging me

blazing rune
#

OOps

#

Sorry

quasi flint
#

Set the countdown variable to an number

blazing rune
#

Wai

quasi flint
#

And rerun the scheduler

blazing rune
#

tt

#

Lemme get it

#

final int[] gameTime = {600};

#

There

quasi flint
#

Why tf is it an int array?

#

Could your xplain that to me

blazing rune
#

¯_(ツ)_/¯

quasi flint
#

Why no int gameTime = 600

#

And the just reset the value once finished

blazing rune
#

But at some line it said like smth wrong

blazing rune
quasi flint
#

I suspect a little ?learnjava

#

! learnjava

blazing rune
#

?learnjava

undone axleBOT
blazing rune
#

:/

quasi flint
#

First learn java

blazing rune
#

Which one

#

Its all in my main

#

Ok

#

Yes

#

For me I find it easier to access

#

??paste

#

?paste

undone axleBOT
blazing rune
#

Fine ig

#

Ohh

#

Yeah

#

That

dark arrow
#

i am working on a command which sets nearby blocks on fire so is it possible to get near by blocks location?

unborn palm
#

get x y and z possitions with for

#

i think

short raptor
#

Hey guys, I've found that my plugin is incompatible with another, but I have no idea why. What are some steps to take so that I can figure out what's causing the issue? I don't really know where to start since the error is quite strange:
Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.bukkit.Server.getPluginCommand(String)" is null
Normally you'd see that one when you forget to put your new command in plugin.yml

dark arrow
spiral light
short raptor
#

also: does the other plugin have the same command name ?
Yes, but this is the only plugin where both have the same command name but there's an actual conflict that causes one to not load

#

There's another where both share a command but they work fine

dark arrow
#

ok

spiral light
unborn palm
#

make 3 loops with x y and z and if block is equals to air skip and continue with other blocks

short raptor
#

How come there are 4 plugins that have the same command, but three of them work fine with mine, and one will cause mine to not load?

#

Is it because their actual command is something like /command209487209834 and they added an alias for /command ?

dark arrow
#

also how can i look for block in front of players

spiral light
#

if 4 plugins have the same command name and 3 of them work.... you should concider sending the plugin yml of them

dark arrow
#

ok

sharp flare
blazing rune
#

;-;

sharp flare
grim ice
#

btw

#

i have a question about conventions

sharp flare
#

you can specify your radius in your #getRelative just gotta loop it

grim ice
#

what if i have an acronym

#

for example

#

o

#

why though

#

so I should have a 25 letters variable instead?

#

I can just use a comment?

undone axleBOT
wet breach
#

depends how well you can understand concepts for programming. If you are really good the last link then

#

since that is the official Java API 😛

#

otherwise there is many sites other then what was linked in regards to learning Java

#

well JS is no where the same as Java

#

python isn't quite the same but at least with python you have functional programming to a degree down which Java does support, but ideally should be doing OOP with java 😛

torn shuttle
#

Is there a way to modify hitbox sizes without using nms?

#

huh actually how can it be done at all

wet breach
torn shuttle
#

looking quickly at forum advice people seem to say you have to raytrace it

wet breach
#

it gets you the hitbox

#

doesn't let you change it API wise

#

I suppose you could do that and just apply the hit if it is close enough

torn shuttle
#

well that's not great

wet breach
#

no it isn't lol

torn shuttle
#

god what a mess

#

the stuff required to make custom models get displayed in-game makes my hair go white

#

it's not hard it's just very, very dumb

wet breach
#

yeah I am sure for others too 😂

torn shuttle
#

it's like

young knoll
#

What’s this about hitboxes

torn shuttle
#

convert the bbmodel json format to the minecraft json format but split it up by bones

#

then store your own data about how they relate and move

#

then animate it tick by tick

#

by rotating armorstands

#

then if you want damage you're just going to have to raytrace and I guess scan projectile proximity

#

there has to be a better solution for hitboxes though

wet breach
#

well hitboxes can be changed as they are hardcoded, just have to find where it is at

#

so NMS is needed and possibly reflection

young knoll
#

Only works server side though

#

The client uses their own hitboxes

wet breach
#

yeah won't change how the client sees it

#

but for some things probably doesn't make a difference

#

like an example is the hitbox for the wither doesn't include the heads on the sides but server side you could make it do so and thus apply damage in that way 🙂

young knoll
#

You’d have to rayTrace to apply damage but yeah

wet breach
#

a hitbox plugin is probably one of few plugins that can both be a plugin and clientside mod

#

downside of the mod part is that it would only really work on your server and not anywhere else

ebon topaz
#
public class JoinEvent implements Listener {
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        event.getPlayer().setResourcePack("https://www.dropbox.com/sh/44cki6n7xai7dir/AAAb1bKbA8CysgOonAnZEPdza?dl=1");
    }
}
``` so when i do this it works technically but doesn't change the texture for sugar but when i put the resource pack in my .minecraft it loads the texture fine?
wet breach
tardy delta
#

I think do it in playerloginevent

ebon topaz
wet breach
#

doesn't mean you can still force change it

ebon topaz
#

well other servers do it

wet breach
#

also, you would need to have the client to have downloaded said resource pack

#

first

wet breach
#

maybe outdated versions you could still do that like 1.8

ebon topaz
#

no it does the this server recommends the use of a custom resource pack and the yes and no thing

ebon topaz
tardy delta
#

Idk

#

Ifyou go go the texture pack window is it there?

ebon topaz
#

yeah but the texture for the sugar doesnt change where if i add it to client side through .minecraft it works fine

wet breach
#

that is why the forcing of it is done on the login

#

if the user hits no, you can have the option to kick

#

but, after login though you can't force the changing of it

ebon topaz
tardy delta
#

Have you already tried applying it in the playerlogin event instead of join? Idk if it may help

wet breach
#

login is the ideal place, because join is after login 🙂

tardy delta
#

That's what i thought

wet breach
#

also you can pause the connection for login for a longer period of time

#

then you can if they joined

#

which is nice if its taking them a bit to download that resource pack

#

for the join part, think at most you can wait 30 seconds before the connection is closed where as on login you can wait as much as like 30 minutes, I would need to relook at the code to confirm that

#

but it is significantly longer for the login part in terms of waiting

#

also, it doesn't cause the server to lag on waiting on the login vs the join part

ebon topaz
wet breach
#

I don't know how your code looks, but yeah that is generally sufficient

next stratus
wet breach
next stratus
#

Oh right ye.. hm. As it's possible during login I wonder if you can do it outside of.

wet breach
#

their code above has it being done in the middle of game play

#

which I am sure works but doesn't force the client to change packs either

next stratus
#

Mojang pls 🥲

wet breach
#

I wonder if the client reports changing packs

#

hmmm, doesn't seem like it

#

if the client at least reported when the pack has changed it would be better on owners considering some games rely on a particular resource pack

rancid hare
#

Why is the .sendPacket now called b?

quasi flint
#

Mojmap mappings

wet breach
#

in the middle of game play?

#

I am aware of it being done at login and join

#

join not being the wisest of places

#

since sometimes it can take more then 30 seconds to download said packs

#

well sure, but not everyone is running modded clients either

wet breach
#

I know, hence I said it would be nice if the client reported if the pack was changed

#

this way the server could kick on the basis of the official pack not being used

#

sure wouldn't get everyone

#

I am not sure what you are trying to say in regards to what I have said

#

this only gets sent when the box shows up to accept or not

#

doesn't indicate during the middle of the gameplay if they changed out the pack is what I am saying

#

a status of such sent from the client would just be handy for that

#

I am aware, I guess you are just missing the fact that I am just saying it would be nice if Mojang added it lmao

#

probably already has been suggested

#

I am just waiting for Microsoft to stop developing the Java version and then the community can really take control of it and do things that Mojang or Microsoft refused to do

#

probably won't be much longer, as long as the DRM AKA login stuff is left alone it will be fine to do such things 🙂

grim ice
#

the client is still rendering stuff and you're sending stuff to it

#

idk just a guess

wet breach
grim ice
#

and ur not sure if the user is banned or allowed in

wet breach
#

it goes prelogin, login, join

grim ice
#

OH

#

i didnt know prelogin existed

wet breach
#

but on the prelogin or login the client isn't trying to render anything and that is where you should be doing your ban check and resource pack sending

#

because those two events allow you to make the client wait for far longer if it is necessary or if the client needs time

#

the join part is where the client starts to try to render stuff and where time out limits decrease

#

the time out limit decreases because there is a packet the server and client need to send/respond to, but in the prelogin and login phases this packet isn't part of that so therefore it is the socket timeout you can wait up to

grim ice
#

o

wet breach
#

TCP socket timeout by default is 15 minutes

#

you can if you want increase this either from modifying the code or the OS settings

#

generally better to do it from the code this way you don't affect all applications like what would happen if done from the OS settings 😛

earnest wigeon
#

um..

#

i can't use mvn clean install

#

i added path and restart but not work

wet breach
#

some logs would be handy

#

?paste

undone axleBOT
wet breach
#

second, why are you doing maven clean every time?

#

you shouldn't really need to do that

earnest wigeon
#

i can't export my server jar

wet breach
#

again, some logs would be handy

#

we can't go based off what you are saying because you haven't presented a specific problem we can work at. There is like few hundred reasons why it isn't working

#

but if you use the link above to paste a log

#

we could narrow down what exactly is going on

earnest wigeon
wet breach
#

well that is an easy problem

#

you don't have maven installed

earnest wigeon
#

i install,added path and restart

#

but not work

wet breach
#

Maven isn't dependent on Java

#

the shell they are using is saying maven can't be found

earnest wigeon
#

i use java 17

wet breach
#

usually an indicator of not installed or it isn't on the path

#

however you don't necessarily need maven on the path, you could invoke the binary directly if you use the full path

#

but currently the issue of invoking maven needs to be resolved first for whatever they are trying to do. Either they need to install it or add it to the path if it is already installed. Or invoke directly if adding to path isn't working and also installed.

earnest wigeon
#

..?

spare prism
#

is there a way to get the new item slot in the InventoryDragItemEvent without iterating over the inventory and searching for the item?

worldly ingot
#

Dragging is multiple slots so you can do with that what you will

#

If you want where the dragging stopped, that's not really exposed

#

I don't think Minecraft really cares where it stops

wet breach
#

wouldn't that work?

#

if you wanted to know where it stopped XD

worldly ingot
#

That gets the item on the cursor

#

akin to InventoryClickEvent#getCursor()

wet breach
#

well the drag can't stop if the click wasn't released

#

unless the client is just weird like it usually is

spare prism
#

Thanks

red sedge
#

how can I make proper rotation system

#

for placing blocks

#

like the chest

#

or uh pumpkins

dark arrow
#

is it possible to create a custom event

red sedge
#

yes

quaint mantle
#

?customevent

#

?event

#

?cusevent

#

?cursedevent

#

@hasty prawn nooo this is not the day 😦

#

?eventcustom

hasty prawn
quaint mantle
#

?customev

#

@ivory sleet what is that command ☹️

spiral light
#

?customevents

#

?customesevents

hasty prawn
#

?eventapi

undone axleBOT
quaint mantle
#

noooooo

midnight shore
#

Hi guys! I'm making an animation using armorstands and spectator mode, is there any way to get an event when the player quits spectating the armor stand so i can cancel it and make it stay inside the armor stand as long as the animation goes on?

visual tide
#

is it possible to stop flowers from popping off when on the wrong block? does BlockPhysicsEvent trigger if that happens

hasty prawn
hasty prawn
midnight shore
hasty prawn
#

Actually nvm, I don't think there's a stop spectating event so I would just check every few ticks if they're still spectating and if they aren't then make them spectate again

midnight shore
#

how can i check if it is spectating?

#

are there any methods?

dark arrow
hasty prawn
midnight shore
#

ok! perfect

dark arrow
#

?eventapi

midnight shore
#

ty

undone axleBOT
dark arrow
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

spiral light
#

?mydata

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?mydata 
Commands which interact with the data CafeBabe has about you.

More information can be found in the End User Data Documentation.

**__Subcommands:__**

3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.

spiral light
#

?uptime

undone axleBOT
#

Been up for: 27 days, 16 hours, 48 minutes, 38 seconds (since <t:1641595966:f>)

hasty prawn
#

?whatdata

#

Ok LOL

spiral light
#

?mydata 3rdparty

undone axleBOT
#

I need to be able to attach files (try in DMs?).

spiral light
#

hm

hasty prawn
#

Oh those are sub commands

#

?mydata whatdata

undone axleBOT
#

This bot stores some data about users as necessary to function. This is mostly the ID your user is assigned by Discord, linked to a handful of things depending on what you interact with in the bot. There are a few commands which store it to keep track of who created something. (such as playlists) For full details about this as well as more in depth details of what is stored and why, see https://docs.discord.red/en/stable/red_core_data_statement.html.

Additionally, 3rd party addons loaded by the bot's owner may or may not store additional things. You can use ?mydata 3rdparty to view the statements provided by each 3rd-party addition.

midnight shore
#

Hi guys again! I was trying to remove an EntityPlayer but i don't know what enum to use, as they are all called with letters

hasty prawn
#

Yes

neon minnow
#

Hi all, im making a double jump and the way I handle is when the player hurt event from fall damage happens it will remove the playername from array so it can be used again, however sometimes the player hurt event does not execute depending on the players position when they finished double jumping they would only jump a couple of blocks so they would not get hurt. How do i efficiently remove double jump? I was thinking async waiting after they jump three seconds then remove their name so they can double jump again?
Thanks

spiral light
wet breach
#

there is very little you can do in regards to the quit event and a lot of the data part of the player object is gone. So you are limited in terms in what you able to use it for, instead you should cast it to OfflinePlayer instead if there is stuff you need from it.

neon minnow
spiral light
#

you can check if the play is back on the ground with player-isOnGround

neon minnow
#

ohh okay

#

but how do i wait a few sec async

wet breach
neon minnow
#

idk how to do that

wet breach
#

well if its fixed, then its fixed I suppose. Don't mind me then

neon minnow
obtuse ferry
#

Is there a way to convert ChatColor.COLOUR to "&x"

spiral light
# neon minnow do i check after a few sec?

depends... if you allow them to use double jump via flying is enabled you need to check it many times ... also buggy to use flying for this... most servers swapped to jump + sneak instead of double jumping

tardy delta
#

ChatColour.SOMETHING adds the § symbol interally iirc

spiral light
#

.toString() ?

obtuse ferry
#

Does #getChar() get 6 from gold for example

midnight shore
#

Hi guys how can i remove an entityplayer from the tab list?

spiral light
#

one of them is:

#

removing;
adding;
update-gamemode;
and update-ping

midnight shore
#

so i only have to try?

spiral light
#

what version ?

midnight shore
#

1.17

spiral light
#

gimme a sec

midnight shore
#

okay

spiral light
midnight shore
#

Uh! ty, what is that?

spiral light
#

a webpage

midnight shore
#

is it open source?

hybrid spoke
spiral light
#

well i think so

#

but ehm not updated on github xD

quaint mantle
#

?mydata forgotme

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?mydata 
Commands which interact with the data CafeBabe has about you.

More information can be found in the End User Data Documentation.

**__Subcommands:__**

3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.

quaint mantle
#

?mydata getmydata

undone axleBOT
#

This command doesn't do anything yet, but we're working on adding support for this.

quaint mantle
#

?mydate whatdata

#

hes just

#

gone

tardy delta
#

nice

spiral light
tardy delta
#

?mydata SELECT * FROM USERS WHERE 1 = 1 lol

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?mydata 
Commands which interact with the data CafeBabe has about you.

More information can be found in the End User Data Documentation.

**__Subcommands:__**

3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.

tardy delta
#

kekw

ornate heart
#

What could be the cause of this?

Whenever a letter with an accent is saved to config it (è) it comes back as this weird character shown in the picture. As you can see in the second picture, the accent saves completely fine to the config, it's just that for whatever reason whenever it tries to read this value from the configuration file, it messes up.

naive bolt
#

?mydata whatdata

undone axleBOT
#

This bot stores some data about users as necessary to function. This is mostly the ID your user is assigned by Discord, linked to a handful of things depending on what you interact with in the bot. There are a few commands which store it to keep track of who created something. (such as playlists) For full details about this as well as more in depth details of what is stored and why, see https://docs.discord.red/en/stable/red_core_data_statement.html.

Additionally, 3rd party addons loaded by the bot's owner may or may not store additional things. You can use ?mydata 3rdparty to view the statements provided by each 3rd-party addition.

spiral light
#

uff ... what did i start here O.o

tardy delta
#

storing the id for the user that doesnt makes sense

spiral light
#

? what do you mean

tardy delta
#

you can get the discord id by code like Player#getUniqueId does

naive bolt
#

but it probs uses a database

#

so SELECT * FROM something WHERE user_id = "id"

neon minnow
# spiral light do you know player.isOnGround ?

Caused by: java.lang.ClassCastException: class org.bukkit.event.player.PlayerMoveEvent cannot be cast to class org.bukkit.entity.Player (org.bukkit.event.player.PlayerMoveEvent and org.bukkit.entity.Player are in unnamed module of loader 'app')

spiral light
#

uff

neon minnow
#

val p = e as Player
if (p.isOnGround) {

spiral light
#

dont use "val p" if you not know what those stuff does

spiral light
#

also an Event cant be an Player

#

the Event can have a player involved or just an entity

#

to get the Player/Entity from an Event you can use
event.getPlayer()
or
event.getEntity()

#

some events provide more then 1 entity getter (EntityDamageByEntityEvent)
event.getEntity will return the Entity which got dammaged
and event.getDamager returns the Entity which did that dmg

maiden thicket
#

kotlin 😳

spiral light
#

also kotlin for the start might be more difficulty then just a normal proj with maven

neon minnow
#

Ty

quaint mantle
#

?learnjava

undone axleBOT
neon minnow
#

?learnjava

undone axleBOT
quaint mantle
neon minnow
#

I fixed it

#

You dont get it

quaint mantle
#

No I don't.

minor otter
#

any idea how one might try to cancel the initial block breaking animation from going through, like when you give a player mining fatigue upon hitting a block it still has a tiny delay where on their screen the block appears more broken than it should be, would sending my own block breaking packets override that?

winged spindle
#

Can someone help me pls
I'm using TextComponent from net/md_5/chat/TextComponent
I clearly imported it. It's in my project files but it's still throwing me this
Caused by: java.lang.NoClassDefFoundError: net/md_5/bungee/api/chat/TextComponent at de.louidev.louicity.houses.SellhouseCommand.onCommand(SellhouseCommand.java:30) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[bukkit-1.18.1-R0.1-SNAPSHOT.jar:?] ... 21 more Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.chat.TextComponent at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[bukkit-1.18.1-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[bukkit-1.18.1-R0.1-SNAPSHOT.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] at de.louidev.louicity.houses.SellhouseCommand.onCommand(SellhouseCommand.java:30) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[bukkit-1.18.1-R0.1-SNAPSHOT.jar:?] ... 21 more

lapis widget
#

Your running bukkit instead of spigot @winged spindle

winged spindle
#

?

lapis widget
#

Yep

winged spindle
#

huh

#

well thank you

lapis widget
#

You shouldn't be using bukkit in the first place btw

winged spindle
#

k

obtuse ferry
#

Do I need to use NBT API again or is there a new spigot api method since 1.8 for nbt tags

neon minnow
#

What would you use instead

#

Yeah aint doing that lmao

#

Like what

tardy delta
#

should i use strings as primary key in a database, im trying to store kingdoms and they cant have the same name

hasty prawn
#

The client controls whether isOnGround is true iirc, that's why it's deprecated.

tardy delta
#

what the hell

hasty prawn
#

Meaning it can be falsified by a hacked client

hasty prawn
tardy delta
#

ok but why got i four databases now

hasty prawn
#

It's just being thorough!

tardy delta
#

?paste

undone axleBOT
tardy delta
#

does this looks good tho? especially the intialize method?

leaden belfry
#

Hey! I got a problem when using a Kotlin plugin compiled w/ ShadowJar.

When importing it from another plugin I can use it's classes properly and the new plugin compiles, but the IDE does not detect the import correctly and everything is red, even though it compiles. Any idea?

I thought it could be the ShadowJar compilation, but checked other projects and they are not doing anything special

tardy delta
#

its kinda weird that you cant call a static field in an enum initializor however you can use a static method

#

which just returns the field ;/

elder oyster
#

Would Team.addEntry() work with UUID instead of the players name?

tardy delta
#

?tryandsee

undone axleBOT
minor otter
#

has anyone here worked with mushroom blocks as a custom block before?

#

I am trying to give the player a mining fatigue effect upon the onBlockDamageEvent but if you use any high level axe the block breaks before the event is even passed so they still get the effect but the block is already gone

hasty prawn
#

Cancel the break event

minor otter
#

would that look funky in game with the block reappearing?

#

ill run it if its the best option

tardy delta
#

the block will reappear

hasty prawn
#

Kinda, but there's not really another option unfortunately

minor otter
#

yeah ive browsed online and havent been able to see a better option

hasty prawn
#

Or use a different block I suppose

#

Note blocks and Glazed Terracotta are decent options

minor otter
#

I would use noteblocks but I dont want to take such a large block out of the game

#

How many blockstates are on glazed terracotta?

hasty prawn
#

4 each

#

It's just the rotation

minor otter
#

I think im just gonna have to stick with mushroom and accept that its going to look a little funky

hasty prawn
#

Which states of mushroom blocks are you using? Aren't they all technically obtainable on survival by placing blocks in the right places

young knoll
#

Yes

hasty prawn
#

Thought so

minor otter
#

yeah but im cancelling the ability to change blockstate and going to replace natural mushrooms with only full sided versions

hasty prawn
#

Ahh gotcha

#

That's actually a good solution I might steal that KEKW

minor otter
#

I was pretty proud of it until i found out axes annhilate my entire system

hasty prawn
#

Yeah... You could try giving them mining fatigue if they look at a mushroom block with an axe I suppose

minor otter
#

I thought about that but wasn't sure how optimised that may be

hasty prawn
#

Then pray it affects them before they click

#

I would just try both and see which you like more

minor otter
#

yeah yeah

tardy delta
#

would it be a good idea to save all the members of a kingdom in a collection the kingdom class and the kingdom the user belongs to in the user class or just on one place?

#

i assume that looping over all the members of a kingdom is easier than looping over all the users and determining whether or not that user is in that kingdom

blazing scarab
tardy delta
#

ah and the other one? (second one)

blazing scarab
tardy delta
#

yea :C

raw ibex
#

how to remove all bossbars

tardy delta
#

wont this work?

obtuse ferry
#

Any ideas why the message doesnt appear and the function doesnt run?

#

The event works as the enchantmenu stuff below works

#

I just added another message and it 100% is running

#
e.getWhoClicked().sendMessage("EVENT");
if (e.getAction() == InventoryAction.SWAP_WITH_CURSOR) {
    e.getWhoClicked().sendMessage("SWAP WITH CURSOR");
    applyEnchantBook((Player) e.getWhoClicked(), e.getCursor(), e.getCurrentItem());
}
#

Tried if (e.getAction().equals(InventoryAction.SWAP_WITH_CURSOR)) { also doesnt work

blazing scarab
#

immutability moment

tardy delta
#

Validate.notNull moment

#

you can compare enums constants with == too

blazing scarab
obtuse ferry
#

void

#

I just changed it a bit

#

and changed the action thing to

if (e.getCursor() != null && e.getCurrentItem() != null) {
    if (e.getCursor().getType() == Material.ENCHANTED_BOOK) {
        applyEnchantBook((Player) e.getWhoClicked(), e.getCursor(), e.getCurrentItem());
    }
}
#

And its at least running now

#

The e.getAction() == InventoryAction.SWAP_WITH_CURSOR wasnt working

#

It wasnt true when I was swapping items

#

I just used a different less performant method

neon minnow
#

Hi i need some help

#

InventoryClickEvent is not starting

obtuse ferry
#

Did you register the event

neon minnow
#

i registered the class yes

young knoll
#

Is it annotated

undone axleBOT
neon minnow
#

Bukkit.getServer().pluginManager.registerEvents(inventoryCore() as Listener, this as Plugin)

#

So what?

#

Lmao

obtuse ferry
#

player.getInventory().remove(book); does not remove the book

neon minnow
#

If you are not going to help, dont mention it at all

#

Thanks.

ivory sleet
obtuse ferry
#

How can I remove the cursor item then

ivory sleet
#

🙂

tardy delta
#

is a double in java a DOUBLE in sql? i guess yea

young knoll
#

That still won’t work

#

Iirc there is a setItemOnCursor in inventory view

obtuse ferry
#

Thats what book is

#

Like you say its not in inventory

#

apparently player.setItemOnCursor(null); works

quaint mantle
#

how can i remove the empty bottle when someone drink a potion

young knoll
#

Maybe it is on player

#

Idk it’s somewhere

young shell
#

Whats the Equivalent to NBTTagCompount in 1.18.1

young knoll
#

You’ll have to check both hands

obtuse ferry
#

Thats cursed

trim creek
#

wow

young shell
#

Is there something like hasKey() in 1.18.1 on NBT

trim creek
#

0.5 attack is a good rate, I guess. 😆

ivory sleet
obtuse ferry
# obtuse ferry Thats cursed

I tried to replace the sword with the updated one with

e.getRawSlot()
player.getInventory().setItem(itemSlot, item);  // update the item
tardy delta
#

heh does anyone knows if a float in java is FLOAT or BIGINT in mysql?

obtuse ferry
ivory sleet
obtuse ferry
tardy delta
#

._.

#

sometimes im confused about float and long

obtuse ferry
#

long is an integer

#

Wait a minute

#

Ive been testing in creative

neon minnow
#

my ide is telling me to create a class when I want to use

PacketPlayOutAnimation()

Why? What to import so i can use

#

ty

obtuse ferry
#

I read somewhere that SWAP_WITH_CURSOR doesnt work in creative

raw ibex
young shell
#

Is there something like hasKey() in 1.18.1 on NBT

raw ibex
#

i'm asking

blazing scarab
tardy delta
raw ibex
#

ok

young shell
neon minnow
#

why this happen pls

blazing scarab
young shell
#

Yeah totally overlooked that

#

Thanks, I may apply for legal blindness lmao

tardy delta
#

whats that site?

vernal minnow
#

how can i disable player collision on a 1.18.1 server?

#

all i searched on the internet does not work

obtuse ferry
#

player.setItemOnCursor(null); also didnt work in creative

#

player.getInventory().setItem(itemSlot, item); // update the item for some reason puts the item in my hand?

neon minnow
#

Cant import net mc?

sleek turret
#

?paste

undone axleBOT
neon minnow
#

paste what

sleek turret
#

the error

neon minnow
#

Look

#

Unresolved reference: minecraft

#

cant find it

#

need import for PacketPlayOutAnimation()

sleek turret
#

weird

#

check your dependencies

trim creek
#

If I would use packets to set the player's displayname on the tab, and on their visible name (aka nametag), would I be able to make per-player scoreboards?

#

I mean, if I just simply use the team feature, the per-player scoreboard just dies

young shell
#

How can I reobfuscate the NMS dependencies when I do a Mvn package

#

Because I can't use the mojang-remapped ones

neon minnow
hasty prawn
#

Did you add spigot-api

#

Because thats wrong if you did

neon minnow
#

added spigot jar

sleek turret
#

im not exactly sure what the problem is, i dont use kotlin

neon minnow
#

i cannot import net.minecraft

#

im using Intellij

blazing scarab
#

1.8.8 cringe

neon minnow
#

nvm

#

Fixed

neon minnow
blazing scarab
#

😬

hasty prawn
#

Ah yes, be mean to the people who try to help you.

#

Brilliant plan

sleek turret
#

lmao

hasty prawn
#

Hope you don't need anymore help 😄

sleek turret
#

^^

neon minnow
#

Just making unnecessary comments

#

No one cares.

hasty prawn
#

Doesn't really matter, you're not showing that you're going to be someone fun to help by saying stuff like that.

blazing scarab
#

Using a supported software is always a better practice

hasty prawn
#

^

sleek turret
#

You also are just really rude with people trying to help, you give like tiny bits of information and then when we try to figure stuff out u just give us attitude

hybrid spoke
#

1.8 ftw

hasty prawn
hybrid spoke
#

will stay at 1.5.2 but thanks

sterile token
trim creek
#

Didn't had too many problems

grim ice
#

Same

#

never had problems with 1.8

neon minnow
#

yep

grim ice
#

newer versions are just more convenient ig

lapis widget
#

no just no

ivory sleet
#

yes just yes

blazing scarab
#

So you like sitting on trashy legacy api anf fucking with internals i guess

terse ore
#

How can I get WorldBorder getcenter()?

blazing scarab
#

Ill just do hideEntity when you'd have to send and listen to packets

lapis widget
#

The API of 1.9+ is more annoying to me

blazing scarab
#

Ill just use pdc when you'd have to mess with nbt

ivory sleet
#

its almost identical to 1.8

#

not many major changes

hasty prawn
#

How can you hate more features and bug fixes SadgeCry

blazing scarab
#

but pvp!!!!!!!

terse ore
#

How do I use WorldBorder#getCenter()

#

?

terse ore
#

ppl exagerate it

blazing scarab
terse ore
#

I like both pvps

lapis widget
#

1.9+ pvp is discusting

blazing scarab
#

Tbh, i'd even say 1.9 is better than 1.8

terse ore
#

yeah

ivory sleet
terse ore
#

I prefer 1.8 but being realistic 1.9 is more acurrated

#

Is like going to WW1 and start making people fly

neon minnow
#

1.8.8 is the most popular version ever

terse ore
#

by punching them

neon minnow
#

for servers

terse ore
#

people don't appreciate 1.9

#

it was one of the best updates

neon minnow
#

most support easy to use and also the highest amount of ppl playing mc are 1.8 easily put in viaversion and boom u can have a server with all version supported since 1.8

ivory sleet
terse ore
#

^^

lapis widget
#

can you proof that its not

hasty prawn
#

I can prove that it isn't! :D

ivory sleet
#

just look at bstats for instance lol

#

^

terse ore
hasty prawn
#

bstats

terse ore
#

ty <3

lapis widget
#

thats litterly the first thing I disable lol

trim creek
#

I have no problems with version

terse ore
#

bruh

neon minnow
#

all 1.8 servers disable bstats

trim creek
#

I really don't understand you guys

hasty prawn
trim creek
#

You are just hating ppl using 1.8

#

Because just its old

neon minnow
#

this

trim creek
#

It makes no sense

neon minnow
#

hypixel uses 1.8

ivory sleet
terse ore
neon minnow
#

mineplex uses 1.8

ivory sleet
#

they dont use 1.8 lol

#

they use 1.7

terse ore
#

💀

hasty prawn
#

Do they really Conclure? OMEGALUL

ivory sleet
#

but its whole different story when you maintain your own software

#

Dessie, they used to at least

#

for some of their servers

hasty prawn
#

thats pretty funny

terse ore
#

wth is yatopia and catserver

hasty prawn
#

Surely they've updated considering 1.7 isn't supported on them anymore

blazing scarab
#

Pretty sure, Hypixel uses 1.8 because of their gigantic legacy codebase. You have a great chanve to keep everything updated

terse ore
#

wait what

neon minnow
#

this guy really crying over someone who uses 1.8

terse ore
#

I am confused af rn

#

with the stats

neon minnow
#

its really not that bad

terse ore
#

we aren't saying it's bad

delicate lynx
hasty prawn
#

No one is crying, we're just telling you that it's not the best idea.

neon minnow
blazing scarab
#

I will not stop bullying you

ivory sleet
#

anyways stating that just 1.8 server owners are merely the ones who turn off bstats is bullshit

hasty prawn
#

^

terse ore
#

wait what

#

6 YEARS???

terse ore
#

the time flies wtf

delicate lynx
terse ore
#

I feel old with 16y xd

ivory sleet
#

I understand why people use 1.8, but the api is objectively worse

trim creek
delicate lynx
neon minnow
lapis widget
#

its phoenix who made it

#

I think

hasty prawn
ivory sleet
delicate lynx
#

1.8 server owners when they have to use an outdated plugin to get it to work

ivory sleet
#

its pretty funny that you can emulate pvp (w/o bh tho) and kb completely on any version but 1.8 to match 1.8

hasty prawn
#

Ikr

ivory sleet
#

all things considered, 1.8 users substantially neglect it sadly

hasty prawn
#

All 1.9+ features/bug fixes, or block hitting... very difficult decision really.

ivory sleet
#

yeah, what a true dilemma

wet breach
trim creek
#

This is true, but as I know, they don't really want to change

#

At this moment

neon minnow
wet breach
#

well they are not the majority so that is fine, but you can't use outdated software and then also want to complain when something isn't working

hasty prawn
neon minnow
#

that has nothing to do with a version.

hasty prawn
#

What even was the issue

neon minnow
ivory sleet
#

Anyways breh I’m enthusiastic towards that you use kotlin uwu

hasty prawn
#

No I know but what was wrong

brave sparrow
neon minnow
#

I just couldnt import it Cuz i didnt know how to but then i figured it out 😄

hasty prawn
#

Ah

wet breach
hasty prawn
ivory sleet
neon minnow
#

packetplayoutanimation

wet breach
#

between each version? Depends which versions you want to compare because packets are based on the protocol

brave sparrow
wet breach
#

sometimes the protocol between one version to another can be similar while other times significantly different

hasty prawn
brave sparrow
ivory sleet
#

oh nvm me then, fair

wet breach
brave sparrow
wet breach
#

but it makes more sense to use 1.8 due to the whole UUID thing 😛

brave sparrow
wet breach
#

I should say 1.8 makes an easier base to fork from

brave sparrow
# neon minnow Like?

Off the top of my head (not sure if spigot still doesn’t have this to be fair), I have a way to get all the drops from when a player breaks a block, and modify or clear it or anything else on the event

neon minnow
#

i got mineplex source code (1.6.4) from 2014 😂

brave sparrow
#

I believe we have the 1.7 hunger rate

wet breach
#

well what I was getting at with 1.7 was the fact that you would need to upgrade the protocol anyways

#

since UUID's came into play officially in 1.8

brave sparrow
#

Yeah 1.7->1.8 was a total pain

wet breach
#

as far as game mechanics go

#

yeah definitely can easily implement 1.7 in 1.8

brave sparrow
#

Lol

#

We used to maintain a nightmare spigot fork with all of the different versions supported

blazing scarab
#

Probably the old message

brave sparrow
#

But that was a crazy hassle

wet breach
neon minnow
#

import mineplex.core.common.util.Callback;
import mineplex.core.common.util.FileUtil;
import mineplex.core.common.util.MapUtil;
import nautilus.minecraft.core.utils.ZipUtil;
import net.minecraft.server.v1_6_R3.ChunkPreLoadEvent;

#

😂

brave sparrow
wet breach
#

wouldn't surprise me

#

but it would be nice if people stopped comparing hypixel or mineplex as a valid reason to continue using 1.8 or even 1.7

#

when both places are running their own forks which isn't quite the same thing

neon minnow
#

bro most successful mc servers support 1.8 - latest

wet breach
#

by now, you could probably say they have their own implementations where you couldn't tell it was spigot or some other base fork

brave sparrow
#

In all fairness I don’t have an issue with someone continuing to support 1.8, there are still servers running it and players playing it

brave sparrow
hasty prawn
#

There's nothing inherently wrong with supporting 1.8, you just shouldn't unless you really have to

wet breach
#

well if I do anything in relation to outdated software it wouldn't be to support the players

#

it would be more because certain versions are easier to work from in terms of backend

hasty prawn
#

I would only support them for a larger audience

brave sparrow
#

Very dependent on your target market and the needs in that market

hasty prawn
#

Yes

wet breach
#

for instance if you wanted a more optimal bungee mc server where everyone goes to first, 1.8 makes a lot more sense code wise to use because it already has a lot of things cut out, just need to implement updated protocol of whatever you are making use of instead of not using 😛

hasty prawn
#

Someone just needs to make a 1.8 Animations mods for latest, then maybe we wouldn't have to deal with this anymore Sadge

wet breach
#

lol

#

if that is all its going to take to have more people move to latest

#

then I should seek out this mod

#

and update it XD

hasty prawn
#

We have OrangeMarshall's 1.7 animations mod for Forge, only works for 1.8 though :(

#

So that helps us exactly not at all

wet breach
#

but yeah you could say my biggest gripe in terms of people using outdated software is people keep expecting to get some kind of support for it instead of just understanding for the most part you are on your own

#

and if there is some kind of bug, yeah it is not going to get patched XD

#

exceptions being I guess security related

hasty prawn
#

Should've only fixed the log4j issue in 1.18 and used that as a reason to get people to update

wet breach
#

wouldn't have bothered me

#

some people wouldn't like that but again goes back to if you are going to use outdated software then you accept all risks that come with it

#

all being literally anything and everything XD

hasty prawn
#

exactly KEKW

blazing scarab
#

yes

naive bolt
#

what should i replace is with

blazing scarab
#

pass the plugin in constructor

naive bolt
#

what

blazing scarab
#

in what context

#

where do you use this

naive bolt
#

commandManager.java

blazing scarab
#

in commandManager, pass the plugin in constructor.
https://www.w3schools.com/java/java_constructors.asp

#

so you do new CommandManager(plugin)

naive bolt
#

in where? main file?

ionic dagger
#

I’m looking at kody Simpsons spigot plug-in tutorials, would they still be useful?

#

They were posted 8 months ago

minor otter
hasty prawn
#

That or checking every few ticks

wet breach
#

this isn't inherently bad, however you should use Dependency Injection. But if your plugin isn't something that is designed to be depended on or you are not going to provide an API then really it doesn't make too much of a difference between getting the main class instance using a static or via constructor.

minor otter
#

I would rather not test every few ticks unless it was like every two or three because it could occur after the player clicks and do nothing

#

highly unlikely but possible

blazing scarab
wet breach
blazing scarab
#

ehh

wet breach
#

using a static for this isn't inherently bad mainly because the main class isn't going to magically disappear XD

blazing scarab
#

It isnt

#

But thats global state, still

wet breach
blazing scarab
#

why so

wet breach
#

what do you mean why so, name a plugin where you can't obtain its main class from another plugin?

blazing scarab
#

Its a regular entry like any other object

wet breach
#

main class of plugins are global anyways, therefore using a static for your main class reference really doesn't make all that much of a difference

#

the difference however is you shouldn't use the static reference for outside things to get the reference and instead should use DI for such things, but internally doesn't really matter much except in terms of design principles or if the class is designed to be used by other things other then your own plugin. Which case DI is the way to go. Also singletons are not in themselves bad either because sometimes a class needs to ensure that there is only ever one instance of it.

blazing scarab
#

That sounds pointless

#

Why woukd you ever had a class thst should keep only a single instance? That kills reusability

brave sparrow
#

JavaPlugin#getPlugin

#

The main plugin class will only ever have 1 instance

#

In general, there are plenty of valid use cases for a singleton pattern

blazing scarab
#

for example?

paper viper
#

i mean the main plugin class could be a singleton but id argue its better if you use DI

paper viper
#

for example

#

Storing a single GSON instance

#

or Unsafe

#

There are certain things where you should only have 1 instance of

#

but in the scope of plugin instances, id much prefer di