#help-development

1 messages · Page 1102 of 1

shadow night
#

I have encountered that issue before

river oracle
#

its definitely desync of some sort

eternal night
#

opening your own inventory wasn't the issue tho o.O

#

that has alwayas been fucked no?

river oracle
#

yeah no that's always been fucked

#

this issue started around 1.18.2 from what I found

tardy delta
#

inserting an itembuilder there would be so much beneficial

shadow night
#

Back when I was a server admin I think I had seen it a few times

river oracle
#

Yeah I think its the client not liking the fact a player has a player inventory open at all

hybrid turret
tardy delta
#

you know builder for items

#

instead of getting the itemmeta, applying stuff to it, setting it back and all that nonsense

shadow night
river oracle
#

but making a mirror inventory for API's sakes seems unstable at best. If someone else wanted to do it sure, but I wouldn't add that to CraftBukkit

shadow night
#

Yeah, maybe as an external library

hybrid turret
winged anvil
shadow night
#

I wonder if those desyncs are somehow related to the player inventory having an amount of slots that isn't divisible by 9, or do the crafting table slots count as slots too

tardy delta
hybrid turret
#

i mean yeah that would make it cleaner tbh, but wouldn't solve the problem

blazing ocean
tardy delta
#

still old code

hybrid turret
#

so it's basically something like the Gson-builder but for item stacks?

blazing ocean
#

that is NOT rad approved kotlin code

shadow night
tardy delta
#

am not using that code

hybrid turret
#

lmao

#

anyway, anyone got something here?

pseudo hazel
#

at com.github.shioku.servercore.gui.misc.OptionsGUI.createInventory(OptionsGUI.java:47) ~[?:?]

#

whats here

#

?code

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

blazing ocean
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

blazing ocean
#

bruh my internet

pseudo hazel
#

I already got it get owned

hybrid turret
#

well i put my code here but ig yea the line numbers are trashed ig lol

#

hold on

pseudo hazel
#

?paste

undone axleBOT
hybrid turret
#

oops i removed the copyright comment

blazing ocean
#

get sued

hybrid turret
#

line 35

hybrid turret
eternal oxide
#

yep, bad man

blazing ocean
#

sucks to be you

hybrid turret
#

Sadge

#

imma kermit now

pseudo hazel
#

copyright comments are a joke anyways

#

especially on plugins

#

anyways

#

how are you creating OptionsGUI

#

like how are you instantiating it

#

@hybrid turret

hybrid turret
pseudo hazel
#

whats the point

eternal oxide
#

always put them in code you upload to any repo

pseudo hazel
#

if you wanted you can just remove them

eternal oxide
#

you never know what the future holds

pseudo hazel
#

like what

hybrid turret
#
  private InventoryButton createPlayerButton(Player onlinePlayer) {
    return new InventoryButton()
      .creator(player -> {
        ItemStack item = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) item.getItemMeta();

        assert meta != null;

        meta.setDisplayName(onlinePlayer.getName());
        meta.setOwningPlayer(onlinePlayer);

        item.setItemMeta(meta);

        return item;
      })
      .consumer(event -> {
        Player player = (Player) event.getWhoClicked();

        if (!this.hasOptions) {
          Bukkit.dispatchCommand(player, this.getAction() + " " + onlinePlayer.getName());
          player.closeInventory();
          return;
        }

        System.out.println(this + " " + this.getAction() + " "); // for testing

        OptionsGUI optionsGUI = new OptionsGUI(this.getPlugin(), this.getAction(), this.getGuiManager(), onlinePlayer.getName(), 1);

        this.getGuiManager().openGUI(optionsGUI, player);
      });
  }
eternal oxide
#

like I said, you never know

hybrid turret
pseudo hazel
#

and whats this.getPlugin

eternal oxide
#

If you uploaded a bunch of code to github with no copyright and 10 years down teh road some company uses it in a product which nets millions.

hybrid turret
pseudo hazel
#

how would you know

#

there is no copyright

hybrid turret
#
@Getter(AccessLevel.PROTECTED)
@RequiredArgsConstructor
public abstract class PaginatedGUI extends InventoryGUI {

  private final ServerCore plugin;
...
}
eternal oxide
#

if there is no copyright on it you will have a very hard time filing a suit against the compant

pseudo hazel
#

i kinda forgor

hybrid turret
#

and this.getPlugin() does return something in PlayerListGUI fsr

#

but not in OptionsGUI

eternal oxide
#

depends on the license

hybrid turret
pseudo hazel
eternal oxide
#

there is but you have to prove its not free/OS

hybrid turret
eternal oxide
#

ah

#

okies

pseudo hazel
hybrid turret
#

PaginatedGUI is abstract

pseudo hazel
#

..

#

sorry I meant where do you create the implemented version of this class that isnt options gui

hybrid turret
#

oh yea hold on

#
public class AdminToolsGUI extends InventoryGUI {

  private static final int INVENTORY_SIZE = 2 * 9;

  private final ServerCore plugin;
  private final GUIManager guiManager;

  public AdminToolsGUI(ServerCore plugin) {
    this.plugin = plugin;
    this.guiManager = plugin.getGuiManager();
  }

  @Override
  protected Inventory createInventory() {
    return Bukkit.createInventory(null, INVENTORY_SIZE, "Admin-Tools");
  }

  @Override
  public void decorate(Player player) {
    this.addButton(0, createBanButton());
    this.addButton(1, createKickButton());
    this.addButton(2, createGlobalMuteButton());
    this.addButton(3, createDayButton());
    this.addButton(4, createNightButton());
    this.addButton(5, createPVPButton());
    this.addButton(6, createInvSeeButton());
    this.addButton(7, createRainButton());
    this.addButton(8, createKillButton());
    this.addButton(9, createCheckKeyButton());

    super.decorate(player);
  }

  private InventoryButton createBanButton() {
    return new InventoryButton()
      .creator(player -> createAdminButton(Material.NETHERITE_SWORD, "&4Ban", "Ban"))
      .consumer(event -> {
        Player player = (Player) event.getWhoClicked();

        PlayerListGUI playerListGUI = new PlayerListGUI(this.plugin, "ban", this.guiManager, 1, true);
        this.guiManager.openGUI(playerListGUI, player);
      });
  }
...
}
echo basalt
#

ew

hybrid turret
#

wha

echo basalt
#

hardcoded items woe

hybrid turret
#

rude? > :(

hybrid turret
echo basalt
#

At some point you'll need to adapt your system for configurability :)

pseudo hazel
#

you're a hardcoded item

hybrid turret
#

why is that?

echo basalt
#

Uh..

hybrid turret
#

so the admins can have their own funny icons?

pseudo hazel
#

maybe users wanna have a diamond sword instead

echo basalt
#

So admins can configure the name and lore of stuff

#

or the layout of the gui

hybrid turret
#

diamons sword is for /kick >:(

#

i mean

pseudo hazel
#

but like

hybrid turret
#

in germany we say to that: "Zukunfsmusik"

pseudo hazel
#

it doesnt really matter

hybrid turret
#

first of all i need to get it to work. the rest is for later lmao

blazing ocean
hybrid turret
#

"future music" (word for word). It's an expression of when you don't give a crap about something and let your future self handle it xD

pseudo hazel
#

okay and finally how do you create AdminToolsGUI

hybrid turret
#

u just wanna steal my stuff, huh? :J

#

jk

ornate mantle
#

anyone have code to make a BlockDisplay entity extend from one point to another? Matrix and vector calculations will make me kill someone

pseudo hazel
#

yeah

echo basalt
hybrid turret
#
@RequiredArgsConstructor
public class AdminToolsCmd implements CommandExecutor {

  private final ServerCore plugin;

  @Override
  public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) {
    if (!(sender instanceof Player player)) {
      sender.sendMessage(Errors.getConsoleError());
      return true;
    }

    if (args.length != 0) {
      sender.sendMessage(Errors.getSyntaxError(cmd));
      return true;
    }

    AdminToolsGUI adminToolsGUI = new AdminToolsGUI(plugin);
    this.plugin.getGuiManager().openGUI(adminToolsGUI, player);
    return true;
  }
}
pseudo hazel
#

I mean I already have my own stuff lmao

hybrid turret
echo basalt
#

gay...sex

ornate mantle
#

gay sex

echo basalt
#

lovely url

#

egay sex

pseudo hazel
#

and gay 🌈

#

amazing

blazing ocean
#

e gay sex

#

pseudo hazel
#

e gay u so sex

#

this url is tryna send a message

blazing ocean
#

😳

pseudo hazel
#

anyways

#

your plugin instance is not initialized here

hybrid turret
pseudo hazel
#

u forgot to DI it

young knoll
#

You’ve heard of eboys and egirls

remote swallow
#

egay

young knoll
#

Now get ready for egay

pseudo hazel
#

or

#

wait

#

it has the annotation thingy

#

what feature adds those again?

young knoll
#

Lombok?

hybrid turret
#

u mean @RequiredArgsConstructor?

pseudo hazel
#

yeah

hybrid turret
#

Lombok. it adds a constructor for all values that are private final... an not immediately assigned

pseudo hazel
#

ah right, i dont like it xD

#

anyways thats not the point

#

have you tried printing this.getPlugin() anywhere and see where it starts being null?

hybrid turret
pseudo hazel
#

yeah I dont because it hides a lot of stuff

hybrid turret
pseudo hazel
#

but people probably like it because it hides a lot of stuff

hybrid turret
#

looks cleaner rn and since i know what it does, i'm good with it

pseudo hazel
#

yeah

hybrid turret
#

kinda trashy for support tbh

#

you can see some sout stuff in my code as well already

pseudo hazel
#

I keep having to search for those things which doesnt help when looking for things that are actually forgotten in the implementation vs what lombok will just add anyways

hybrid turret
#

but tbh that's the wrong log

pseudo hazel
#

yeah

hybrid turret
pseudo hazel
#

you arent printing plugin

#

and you are using system.out

hybrid turret
#

yea wrong log

hybrid turret
#

just for a quick log?

pseudo hazel
#

well its fine for that I guess

#

as long as you use a normal logger for anything more permanent

hybrid turret
#

yea i do

#

i don't like sout

#

but i use it for stuff where i don't wanna give a shit about having plugin in the class or not

pseudo hazel
#

ah

#

maybe if you did use it you would know if it errored xD

#

which kinda defeats the point of logging this.plugin anyways lol

#

but in my plugin I just have static methods to log

hybrid turret
#
  private InventoryButton createPlayerButton(Player onlinePlayer) {
    return new InventoryButton()
      .creator(player -> {
        ItemStack item = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) item.getItemMeta();

        assert meta != null;

        meta.setDisplayName(onlinePlayer.getName());
        meta.setOwningPlayer(onlinePlayer);

        item.setItemMeta(meta);

        return item;
      })
      .consumer(event -> {
        Player player = (Player) event.getWhoClicked();

        if (!this.hasOptions) {
          Bukkit.dispatchCommand(player, this.getAction() + " " + onlinePlayer.getName());
          player.closeInventory();
          return;
        }

        System.out.println("Plugin right before instantiating OptionsGUI is: " + this.getPlugin());

        OptionsGUI optionsGUI = new OptionsGUI(this.getPlugin(), this.getAction(), this.getGuiManager(), onlinePlayer.getName(), 1);

        this.getGuiManager().openGUI(optionsGUI, player);
      });
  }
  @Override
  protected Inventory createInventory() {
    System.out.println("Here:" + this + " " + this.getAction()); // fixme: getAction is not null in PlayerListGUI:85 but it is here????
    System.out.println("Plugin in OptionsGUI is: " + this.getPlugin());
    return Bukkit.createInventory(
      null,
      this.plugin.getServerDataManager().get(0).getGuiOptionsMap().get(this.getAction()).size(),
      "Options"
    );
  }
[22:05:58] [Server thread/INFO]: Plugin right before instantiating OptionsGUI is: ServerCore v0.4.0
[22:05:58] [Server thread/INFO]: Here:com.github.shioku.servercore.gui.misc.OptionsGUI@79311af3 null
[22:05:58] [Server thread/INFO]: Plugin in OptionsGUI is: null
#

there's the logging

grave sparrow
#

Using NMS to spawn a custom entity, addFreshEntity is returning true but I can't see my entity, any ideas why? Here's the entity class itself:

public class CustomZombie extends net.minecraft.world.entity.monster.Zombie{
    public CustomZombie(Location loc) {
        super(EntityType.ZOMBIE, ((CraftWorld)loc.getWorld()).getHandle());
        //this.setCustomName(Component.literal("Test :3"));

        boolean spawned = ((CraftWorld)loc.getWorld()).getHandle().addFreshEntity(this, CreatureSpawnEvent.SpawnReason.COMMAND);

        loc.getWorld().getPlayers().forEach(player -> {
            player.sendMessage(spawned + "");
        });
    }
}```

I have another thats a shulker bullet but doing the same thing
pseudo hazel
#

yeah im reading the book your wrote

hybrid turret
#

oops sorry

#

mb

agile hollow
#

does someone know if it's possible to make a crops change only on the client side?

agile hollow
river oracle
pseudo hazel
#

so just make a getPlugin method and use that

#

instead of creating a new variable in each subclass

hybrid turret
#

uhmmmmmmmm i dont

#

i mean i do

#

but i only did that in OptionsGUI for testing purposes in case for some weird damn reason, that this is the issue

#

i originally used this.getPlugin in OptionsGUI as well

pseudo hazel
#

well you have one in AdminToolsGUI too

#

and do you have a plugin variable in paginatedGUI?

#

or wait i might be looking in the wong place

#

in any case, 1 variable with teh same value should be sufficient

hybrid turret
#

yea i have one in paginatedgui and in admintoolsgui

pseudo hazel
#

oh

#

well then my point stands

hybrid turret
#

bc admintoolsgui has no correlation with paginatedgui

pseudo hazel
#

right

#

but both are inventoryGUI right?

#

does inventoryGUI have a plugin variable too?

#

hmm doesnt look like from reading the code you sent

#

when does decorate get called?

tardy delta
#

aaaaa

hybrid turret
pseudo hazel
#

yeah thats where I got confuzed

tardy delta
#

@hybrid turret give me a tldr on the issue again and whats the code again

hybrid turret
pseudo hazel
#

do you have a plugin github repo?

hybrid turret
#

as much as i want to rn, i gotta work tomorrow and its 10:22 pm

hybrid turret
#

bc my server is in there

#

and redistributing that would be vewy illegull

pseudo hazel
#

oh

pseudo hazel
hybrid turret
#

the "normal" classes

#

either PlayerListGUI, OptionsGUI or AdminToolsGUI

#

PlayerListGUI > PaginatedGUI > InventoryGUI
same for OptionsGUI
AdminToolsGUI > InventoryGUI

#

this is the resource this is based upon

#

i gtg now

#

gnight yall

tardy delta
#

there is none

#

gnight

pseudo hazel
#

okay gn

tardy delta
#

*its not even 12pm 😳 *

pseudo hazel
#

some people have whats known as a day job

tardy delta
#

ye

agile hollow
#

can someone give me a guide on how to use packets because i haven't found anything so far

tardy delta
#

i mean i have 6 hours of sleep dunno how much they have

#

already at the station at 7:50 am

pseudo hazel
#

6 is on the low end

hybrid turret
pseudo hazel
#

no guide to using packets

#

atleast no good one

hybrid turret
#

Oh

pseudo hazel
#

well maybe if you worked at mojang

hybrid turret
#

If you got any ideas

tardy delta
#

thought you were in bed

hybrid turret
#

Jist tag me

#

Just*

#

Maybe i‘ll temporarily remove the server files and show u the repo

tardy delta
#

steaf, wjere is the code again?

#

discord doesnt really like scrolling, i always end up on the same place

hybrid turret
tardy delta
#

ahhhhhhhh

#

always fun

pseudo hazel
#

disc is ass when it comes to basic functions

#

atleast you can buy an animated picture in the shop, thankfully

tardy delta
#

reminds me i still need to work on my discord frontend

hybrid turret
#

Since i‘m on the phone rn i wont look it up but you can search from:shi0ku in the channel and might find it quicker

tardy delta
#

damn screen capture on wayland is crazy

#

totally does not look like how its supposed to be lol

#

buddy you tell us what doesnt work

hybrid turret
#

?nowoek

#

?nowork

#

?xyz

pseudo hazel
#

go to bed xD

#

?notworking

hybrid turret
#

No wait what

undone axleBOT
#

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

tardy delta
#

still not in bed

hybrid turret
#

AHHH

#

There it is

#

Msybe i should

#

My brain is full of java

pseudo hazel
#

my head is full of generics

tardy delta
#

give your gf a hug

pseudo hazel
#

it feels like im assembling the biggest generics puzzle I have ever made

hybrid turret
#

my head is full of cells

hybrid turret
#

will do man

#

anyway i leave now

#

cya

pseudo hazel
#

I have this cursed class and intellij says the cast is unchecked, I asked a similar question a bit ago but might as well see just in case; There is no way to do a checked cast with the generic stuff right?

#

or any suggestions how to do this better are also welcome

grim ice
#

your theme is cursed

pseudo hazel
#

ouch

#

find me a better one

#

please

#

I need it

#

what are you using

grim ice
#

:)

pseudo hazel
#

I said a better one

blazing ocean
#

catppuccin

grim ice
#

default is better

pseudo hazel
#

anyways looks like my code is perfect then

#

good

agile hollow
#

is there a way to direct a bee in acertain direction?

pseudo hazel
#

sadge

#

but do you know if it can work?

#

like the code

#

or is it a T.A.S. moment

tardy delta
#

wdym if it works, you wrote it

pseudo hazel
#

im writing it still

#

fresh from the brain

#

ill write tests for it

low field
#

hi, i tried creating a custom dimension but when i start the server, the console is spammed by [23:24:00 WARN]: Ignoring heightmap data for chunk [x, z], size does not match; expected: 52, got: 37

pseudo hazel
#

cuz its important that it does stuff that works haha

tardy delta
#

also it should be Class<? extends NodeSerializable>

rough drift
#

in fact

#

a way

#

it is called

#

Class<T>

tardy delta
#

Class<NodeSerializable> is NodeSerializable.class

#

or well ye the generic bound T

pseudo hazel
#

oh right

#

ideally I wanna construct a T ofcourse

#

but yeah

#

java 21 doesnt have new T() yet so

tardy delta
#

theoretically casting a Class<NodeS> to a Class<? extends NodeS> should work? ike?

rough drift
tardy delta
#

or the other way around

pseudo hazel
#

wait sorry where do I fill this in?

rough drift
#

NodeS extends Object of course, but iirc ? extends NodeS also allows NodeS

pseudo hazel
#

the Class<T> thing

ivory sleet
tardy delta
#

classType

rough drift
#

because ? itself extends Object and you can use Object inside of it

tardy delta
ivory sleet
#

TypeToken

rough drift
#

don't quote me though I'm tired

pseudo hazel
#

right, I now have Class<? extends NodeSerializer>

tardy delta
#

never touched those actually

pseudo hazel
#

I kinda forgot about ?

tardy delta
#

or never bothered to see how they work

ivory sleet
#

u can capture the type with an anonymous subtype

pseudo hazel
#

(renamed NodeSerializable to NodeSerializer)

tardy delta
#

realized smth like that yes

pseudo hazel
ivory sleet
#

TypeToken<X> x = new TypeToken<X>(){};

#

the type is captured in the type param

#

so u can get it

#

and check if its a concrete class for example

#

and then instantiate

pseudo hazel
#

oh

#

nice

#

maybe I should try and use that then

tardy delta
#

i mean does it use Class::getTypeParameters?

#

which asks filled in generic type to runtime

ivory sleet
#

its just the fact that its able to catch types in type params

#

ofc it doesnt look great once compiled

#

since u get a ton of anonymous classes

pseudo hazel
#

oh fuck I just realized my code wont work anyways

tardy delta
#

ill see tomorrow, off to bed, gn

pseudo hazel
#

this class rn only has one instance

#

so it cant be multiple classes at once xD

agile hollow
#

guys there is a way for make the bee attached to other stuff and not only poppy ?

pseudo hazel
#

iirc they go to all flowers?

agile hollow
sterile breach
#

hey, in my plugin I should to get some chunks to serialize them the problem is that I need to load/get 3x3 (9) chunks and it seem to make the server laging, may I retrieve the chunks in async?

fading beacon
#

do air bubbles trigger an event?

river oracle
#

SexyClientRenderEvent

#

no

mortal vortex
#

When a player hits a boat, the boat shakes. Is this something you can invoke?

echo basalt
ivory sleet
#

not rly

#

i mean ofc u cache the thing

sand spire
#

Hey, I want to create a world that loads every time the server starts with these attributes:

  • The world is void except for my prebuilt builds without block changes. Like a hub world
  • I want to avoid saving garbage data over time in the world file
  • I want to preload chunks when the server starts

I found the SlimeWorldManager plugin to avoid saving unnecessary data, but I think this is designed for worlds where blocks are modified. Would creating a new world file every restart be a good idea?

I’ve also had issues with void worlds getting corrupted over time, forcing me to delete them to avoid errors. Which wouldn't be a problem if I create a new world every restart but I still want to learn how to successfully create a world.

A tutorial link or recommended approach would be appreciated

sullen marlin
#

Just unzip a clean copy of the world and add a chunk ticket for the chunks you want to keep loaded

echo basalt
#

SWM supports read-only worlds. The idea is that you can have a mutable world and create copies of it

eternal oxide
#

I posted a void generator. Its very simple

torn shuttle
eternal oxide
#

lol

worldly ingot
#

I mean...

#

Magma be Magma KEKW

eternal oxide
#

I get 8 results 🙂

torn shuttle
#

mr choco

eternal oxide
#

Magma is broken

torn shuttle
#

you are so dum

worldly ingot
#

Still stuck in my head

torn shuttle
#

good

#

approve my premium plugin for a $5 fee

mortal vortex
#

Whats the name for the black particles that emit when you ignite a tnt or creeper?

sand spire
#

Thank you all I will try these out 👍

grim ice
#

im gonna use the frappe one

acoustic pendant
#

How do you guys do to add gifs in your plugins description? (what platform)

torn shuttle
#

I hacked choco's computer and infected his pc so he's now distributing my gifs

grim ice
torn shuttle
#

I'm about to drop a hot one

grim ice
#

☠️

torn shuttle
#

@worldly ingot I want to apologize for going for so long without dropping a super hot track for you, you put in hours every day into the Spigot project and I have lost sight of the sacrifices you do every day. Please take this fresh new track a my apology and thanks for all of your hard work.

worldly ingot
worldly ingot
#

Someone promote this guy

torn shuttle
#

and this, ladies and gents, is how you know you've made an impact within your lifetime

young knoll
#

Someone eat this guy

sly topaz
magic drift
#

im using Eclipse IDE how do i make my Plugin a Spigot plugin

sly topaz
#

actually that guide is kinda bad

#

it'd be better if it told you to use maven/gradle

#

and the maven guide for eclipse is empty lol

prime epoch
#

I have an issue i've been stuck on for way too long now. So i've been implenting logout villagers as in when the player logs out a villager is spawned for 30 seconds then it despawns or the player logs in. this works perfectly when a player is nearby but nowhere else. My question is how can i keep the chunk the villages in loaded?

young knoll
#

Add a ticket to keep in loaded

#

Chunk#addPluginChunkTicket

prime epoch
#

which hasn't seemed to work either

hybrid spoke
#

just give your villager cool particles, that should load it

prime epoch
#

acc i lie i think it worked perfectly

prime epoch
prime epoch
manic delta
#

How can I make a text display be on top of another? I want to make a text system that is under the player's name, but it doesn't work for me. I tried it like this.

slender elbow
#

why not just join the text by newlines into a single text display?

young knoll
#

I assure you it does

manic delta
#

i think you think using \n

manic delta
young knoll
#

line_width: Maximum line width used to split lines (note: new line can be also added with \n characters). Defaults to 200.

#

Plus I’ve used \n before

manic delta
lucid fog
#

how do i see the code mojang used for their commands?

vast ledge
#

You dont

lunar current
lucid fog
#

BUT I COULD WHEN I WAS MAKING A MOD

#

WHATS THE DIFFERENCE

#

im actually gonna flip out

vast ledge
#

That mojang doesn't release the code for there servers?

lucid fog
#

rn

#

no but

#

the normal commands like /summon

#

or /teleport

wind sorrel
#

I'm using AlessioDP's fork of libby to download dependencies at runtime (I know that Spigot now has a feature which solves this problem but that wouldn't work in Bukkit and other servers unrelated to Spigot). Someone has any idea on how to use this library? I can't find much detailed information on how to use it and some examples confuse me

magic drift
#

can anyone help

lucid fog
# magic drift

im 99% sure the plugin will still work you just havent downloaded the external library

#

(im new to makling plugins so this might not be true)

magic drift
#

Do i need a Command Handeler

prime epoch
# magic drift

it seems like you havent got the bukkit api either installed or configured with your ide. Which IDE are you using?

magic drift
#

eclipse

prime epoch
#

or if youre not the reading type im sure videos exist for eclipse but i would recommend giving intellij a try but its up to you

young knoll
#

You can see mojangs commands if you look at the decompiled server

#

Bukkits command system is quite different though

magic drift
#

i can Reinstall it if it helps

prime epoch
#

i mean are you able to use intellij instead? imo it just seems easier to get things working

magic drift
#

i have used Intellij before and Got no were

#

i can try again ig

#

But it costs money

prime epoch
magic drift
#

how

nova notch
magic drift
#

alr

stuck oar
#

is htere any like minecraft names that are skulls of mob heads>?

#

like all animals

#

i remember there being one

nova notch
#

i think it was MHF_x like MHF_Skeleton or whatever

stuck oar
#

thank you

lucid fog
#

imagine

#

cheap af

#

gives so much good stuff

#

LIKE ACCESS TO ALL JETBRAINS PRODUCTS WOHOO

nova notch
#

what does ultimate even do anyway

lucid fog
#

allow you to publish projects without getting sued

nova notch
#

isnt that only if youre making a profit tho?

lucid fog
#

yeah

#

wait no thats if you use the educational version

nova notch
#

huh

lucid fog
#

if you use the free version for when you have an isic id

#

you agree that you wont publish anything for commercial purposes

#

so its actually worse

nova notch
magic drift
#

I dont think i can do anything right

stuck oar
#

any1 know how i can make my own like levelup variable

#

a player variable cause each player will have one

sly topaz
stuck oar
#

It’s like a rankuo system

#

Rankup

sly topaz
stuck oar
#

I don’t

sly topaz
#

if you are sure you won't ever need it offline, then just use PDC

stuck oar
#

What’s a pdc

sly topaz
#

PersistentDataContainer, all entities have it

stuck oar
#

Alright thank you

sly topaz
# stuck oar Alright thank you
public static final LEVEL_KEY = NamespacedKey.fromString("level", MyPlugin.getInstance());

int currentLevel = player.getPersistentDataContainer().getOrDefault(LEVEL_KEY, PersistentDataType.INTEGER, 0); // The last parameter is a default value
player.getPersistentDataContainer().set(LEVEL_KEY, PersistentDataType.INTEGER, currentLevel + 1);
#

example usage

blazing robin
#

Hey guys how can I set items durability in 1.20.1?

    /** @deprecated */
    @Deprecated
    public void setDurability(short durability) {
        ItemMeta meta = this.getItemMeta();
        if (meta != null) {
            ((Damageable)meta).setDamage(durability);
            this.setItemMeta(meta);
        }

    }

this method is deprecated

blazing robin
summer scroll
summer scroll
# blazing robin oh, thank you
if (itemMeta instanceof Damageable damageable) {
  // Do your stuff
} 
```Don't forget to set the item meta after changing it.
blazing robin
#
  private void decrease(ItemStack itemStack) {
        ItemMeta itemMeta = itemStack.getItemMeta();
        if (itemMeta == null) return;
        if (itemMeta instanceof Damageable damageable) {
            damageable.setDamage(1.0);
        }
    }
#

like this?

blazing robin
#

you made my day! Im very appreciate

summer scroll
analog mantle
#

Is there a guide to uploading paid plugin to spigotmc? How is the author supposed to add in authentication for each paid copy?

summer scroll
#

I got my resource leaked a lot, at this point I'm just ignoring it, like there's no point.

analog mantle
#

what is it?

summer scroll
#

The people who used your leaked product are never your potential customers anyway, so just ignore them.

analog mantle
#

Well, someone who bought it leaked it, right?

summer scroll
#

So it's like an investment for them.

dawn flower
#

what is the fastest one-pair collection for contains() function?

#

this is what i tested so far

#

(for 1m elements)

analog mantle
#

use a parallel stream for collections with millions of objects

dawn flower
#

you got a point

analog mantle
dawn flower
#

parallelism just made it take way longer

analog mantle
#

that doesn't make any sense

summer scroll
#

I think HashSet is the fastest.

dawn flower
#

yeah

#

hashset is hella fast for contains

#

this is with contains()

analog mantle
#

holy cow

summer scroll
#

that's crazy

#

huge difference

agile anvil
#

Hashing is meant for that. For any other structure you basically need to look out the whole structure in order to know if the element is present. HashSet uses HashTables that makes the looking out O(1)

hybrid turret
#

mornin yall

#

if i set a new name for a player in their gameprofile, how do i reset it? to i need to cache the uuids and map them to the custom name?

#

since i'm at work i cant test anymore :(

sterile breach
#

but it probably better to map uuids

#

because for client world dont exist, in witch case exactly the client open load screen?

hybrid turret
#

i don't understand the last message but what i got from that is i should map it lol

agile anvil
#

Why would you want to give the GameProfile a new name ?

torn badge
#

The HashSet implementation basically uses a HashMap internally, and is as good as your hashes are

torn badge
#

The more hash collisions you have, the less efficient the hash collections are gonna be, in the worst case being O(n) for a lookup

torn badge
shadow night
#

The fact that it uses a hashmap internally, how is that supposed to work

sterile breach
#

HOw can I generate a void world properly?

torn badge
agile anvil
hybrid turret
#

and not only the chat name

keen charm
#

Hey

#

How can I run something before respawn & after respawn event?

#

Is there something like PreRespawn?

sterile breach
# agile anvil Create a new ChunkGenerator that just creates the chunk data and no blocks, then...

Like this? I'd like to send chunk packets to the customer, but in this world they don't apply

public class VoidGenerator extends ChunkGenerator {
    @Override
    public ChunkData generateChunkData(World world, Random random, int x, int z, BiomeGrid biome) {
        return createChunkData(world);
    }
}

// main class

    public void generateVoid() {
        VoidGenerator voidGenerator = new VoidGenerator();
        WorldCreator wc = new WorldCreator("void");
        wc.generator(voidGenerator);
        wc.createWorld();
    }
agile anvil
#

Aren't you trying to just create a void world?

sterile breach
#

it's just a packet that loads a chunk by providing blocks and other things

hybrid turret
hybrid turret
#

i for example use this to "revive" a player. using /revive adds the players inventory and the id and the death location to an object and if the object is not null the player's inventory is cleared on death, and when clicking respawn they're teleported back to the old location as if nothing happened

#

i never tested it tho, it might not work lmao

#

especially the Inventory part

sterile breach
halcyon hemlock
#

simd is fucking mad. 80% improvement????

grim hound
dawn flower
#

ok

#

good to know

grim hound
#

and a HashMap has a lot of space, gets an index from the inputted Object::hashCode and either knows exactly where something is or just has to iterate through a few (at most 3 elements, otherwise it creates another LinkedHashMap within itself)

#

while an ArrayList just checks every single element

dawn flower
#

a

#

so pretty much a hashmap / hashset is good for looking for stuff

shadow night
#

I think I once had a scenario in which a HashSet for some reason was slower than an ArrayList

#

I believe it was a simple for loop

dawn flower
#

lists are faster for insertions

crystal flax
#

Hi, TabCompleteEvent doesn't work for me because my commands are sorted by alphabet but what it's supposed to do is shown in the code. Can you help me? ``` @EventHandler (priority = EventPriority.HIGHEST)
public void onTabComplete(TabCompleteEvent event) {
// Überprüfe, ob der Sender ein Spieler ist
if (event.getSender() instanceof ProxiedPlayer) {
String cursor = event.getCursor().toLowerCase();
List<String> suggestions = new ArrayList<>();

        // Wenn der Cursor nur / enthält
        if (cursor.equals("/")) {
            // Befehle in der gewünschten Reihenfolge hinzufügen
            suggestions.add("/support");
            suggestions.add("/help");
            suggestions.add("/discord");
        } else if (cursor.startsWith("/")) {
            // Wenn der Cursor einen Befehl gefolgt von einem Leerzeichen enthält
            if (cursor.matches("^/\\w+\\s.*")) {
                for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
                    suggestions.add(player.getName());
                }
            }
        }

        // Lösche die aktuellen Vorschläge und füge die neuen hinzu
        event.getSuggestions().clear();
        event.getSuggestions().addAll(suggestions);
    }
}

}```plesse help

dawn flower
#

tab completions aren't sorted by how you sort them

#

because mojank loves us

rough drift
#

Quit message not appearing

grim hound
#

since ArrayLists just use an array, for loop traversal is much faster

grim hound
#

while a HashMap uses a Node table array

shadow night
#

At the end I ended up using a BiMap for that program lol

#

And it still isn't completely efficient

grim hound
#

oh guava

#

stuff

shadow night
#

Yee

#

A map in which both sides are keys

hybrid turret
#

it is only disallowed to have the server.jar in a public repo right?

shadow night
#

Or more like, you can get the key by the value and the value by tbe key

grim hound
#

so you just use two maps? xD

shadow night
#

Basically yeah

#

But it's way faster than when you iterate over the values

#

I was writing a little handler for mappings so it was the ideal thing to use

hybrid turret
#

makes no sense

#

wait

#

does the PluginEnableEvent get called after the onEnable method is done???

#

if so, is there any event that is called before it's enabled? :' )
i know it wouldn't make sense bc to register a listener the plugin has to be enabled :/

#

wait

#

i could instantiate the stuff in the event instead of in the onEnable

#

right?

#

yep worked apparently :D

pseudo hazel
#

onLoad maybe?

#

onLoad runs before onEnable

#

so it should be used for things that need to get done before its enabled

hybrid turret
#

mhh no bc i have to load the serverdata using an event

#

(bc of the way the data stuff is built)

#

i mean it's working fine apparently. I just used setters and getters to set the VaultManager

#

so that the loading happens before the event

crystal flax
karmic falcon
#

hi, im currently working on a mingame and i am facing a little problem with the death handling, currently when a player dies in the minigame world:
-inside the deathevent listener, i cancel the death message and calculate a custom one and send it to all players participating
-i call p.spigot().respawn
-i tp the player back to his original position ouside the minigame, and give him his inventory/xp/heart count/potion effects back

the thing is, everything works fine, except that once the player is tped and gets his items back, i still see a respawn menu where the button is kinda jittered and only works after a couple of seconds but after i press it i dont get tped or get a new inventory the player has the data he is supposed to have

humble tulip
karmic falcon
#

No 1.20

smoky anchor
#

Other way would be to never have the player respawn.
Listen to any damage event and if the health would drop below 0 do your custom logic and whatever and mainly cancel the event and heal the player.

karmic falcon
#

Ohhh that makes sense

#

Thnx!

grim ice
#

and you can call player death event yourself

#

so that other plugins dont bug out

sand spire
#

Hey I added an API library through maven, and I got access to the imports while coding, but for some reason when I compile it says cannot access 'import'.
Does someone know what could be causing this?

pseudo hazel
#

any more imformation?

#

is that literally the only thing it says?

pseudo hazel
#

did you restart the ide?

eternal oxide
#

show the compiler log

#

?paste

undone axleBOT
eternal oxide
#

we need to see the error

#

My bet its a runtime error about a missing dependency

sand spire
sand spire
eternal oxide
#

class file has wrong version 65.0, should be 61.0

#

your java is too old to compile

sand spire
#

oh damn xd

sand spire
# eternal oxide your java is too old to compile

Will changing this give me a new java or do I need to download something?

       <java.version>1.8</java.version>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>```
eternal oxide
#

configure your IDE to use teh correct java JDK

#

currently its using "C:\Program Files\Java\jdk-17\bin\java.exe"

#

Class file version 65 is Java 21

sand spire
#

Thank you I will try to find it

sand spire
grim hound
#

results in this

grim hound
stuck oar
young knoll
#

No

#

PDC is 1.14+

stuck oar
#

Oh

#

Is there any other way I can do that then

sly topaz
#

just store it on your own

young knoll
#

NMS or NBTAPI

sly topaz
#

or that too, but I'd just store it on my own rather than deal with NMS

young knoll
#

Define store it on my own

sly topaz
#

have a Map and write it to whatever flatfile format on server close

#

or whenever you feel it is necessary

young knoll
#

Ah

#

Yeah you can do that

#

Or a database

stuck oar
#

Im gonnna use a hashmap

stuck oar
#

i think my setver is freezing or something

#

my code doesnt work

#

but no errors show

smoky anchor
#
while (true) { ... }

?

#

You might have an infinite loop somewhere

stuck oar
#

no im just dumb

#

just didnt register the listener

#

thanks tho

#
    public void quit(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        PlayerLevelManager playerLevelManager = this.levelManagerHashMap.get(player.getUniqueId());

        if(this.levelManagerHashMap.containsKey(player.getUniqueId())) {
            this.getConfig().set("PlayerLevels." + player.getUniqueId() + ".level", playerLevelManager.getLevel());
            this.getConfig().set("PlayerLevels." + player.getUniqueId() + ".xp", playerLevelManager.getXp());
            this.saveConfig();


        }
    }``` 

anyone know why my level isnt saving?
orchid trout
#

what is getLevel()?

#

is it a string?

#

if not you need to serialize it

smoky anchor
#

Could it be UUID having - in it ?

lost matrix
smoky anchor
#

Speaking of the if block, do a null check over the playerLevelManager instead of containsKey

#

And probably don't forget to cleanup the hashmap when the player leaves ?

stuck oar
# orchid trout what is getLevel()?

public class PlayerLevelManager {

    private int level;
    private int xp;

    public PlayerLevelManager(int level, int xp) {
        this.level = level;
        this.xp = xp;
    }

    public int getLevel() { return level; }

    public void setLevel (int level) { this.level = level; }

    public int getXp() { return xp; }

    public void setXp(int xp) { this.xp = xp; }

}
stuck oar
smoky anchor
#

wait, you're doing player.getUUID()
that is an object that will be stringified

stuck oar
#

everything works fine but the level saving

#

thats all

#

so i think getUUID() is fine

smoky anchor
#

How does the save file look like

stuck oar
#
            this.getConfig().set("PlayerLevels." + player.getUniqueId() + ".level", playerLevelManager.getLevel());
            this.getConfig().set("PlayerLevels." + player.getUniqueId() + ".xp", playerLevelManager.getXp());
            this.saveConfig();
            this.levelManagerHashMap.remove(player.getUniqueId());
smoky anchor
#

saved* file

stuck oar
#

wherwe would i find that

#

it should just save to the config

smoky anchor
#

yes

stuck oar
#

nothing shows in the cfg

smoky anchor
#

nothing at all ?

stuck oar
#
Levels:
  1:
    xp: 500
  2:
    xp: 1000
  3:
    xp: 2000```
#

thats is

#

it

smoky anchor
#

Try saving with player username as a test

orchid trout
#

player.getUniqueId().toString()

stuck oar
#

does this replace the uh

smoky anchor
#

yes

stuck oar
#

getUUID

chrome beacon
#

It should already do that automatically

smoky anchor
#

replace player.getUniqueId()

stuck oar
#

ok

smoky anchor
orchid trout
stuck oar
#

there are a couple things unrelated to it

#

message too long

smoky anchor
orchid trout
#

?paste

undone axleBOT
stuck oar
smoky anchor
#

instead of the unique id use player name

stuck oar
#

its wrong i forgot a line

smoky anchor
#

I suspect the UUID having - being the culprit

stuck oar
#

so player.getName or whatv it is

smoky anchor
#

ye

chrome beacon
stuck oar
#

i cant

smoky anchor
#

AS A TEST

stuck oar
#

my things require a UUID

eternal oxide
#

uuid is fine

#

it can be used as a key

smoky anchor
#

Ah alright then I got no clue :D

stuck oar
#

thing is

eternal oxide
#

what exactly is not working?

stuck oar
#

i think the tut i watched

stuck oar
#

i think the tutorial didnt include a saving part

#

but i thought it did

eternal oxide
#

from the code you posted it looks to save an xp and level at login

stuck oar
#

in playerJoinEvent?

#

oh.

#

let me remove that one second

#

still doesnt save

eternal oxide
#

you only update teh config on player quit

smoky anchor
#

Line #80 is wrong
Should be !hasPlayedBefore no ?

stuck oar
#

oh it is aswell

smoky anchor
#

But that does not fix the not saving problem I guess.

stuck oar
#

it might hold on

#

yeah it did

#

thank yiu

#

uo

#

you

smoky anchor
#

huh

#

ke :D

humble tulip
#

need some math help

#

i need to simulate generating a random between (lowerbound, upperbound) but I need to do it many times and then sum them all up

#

I remember from stats class that I can use a normal approximation

eternal oxide
#

if you are doing a sum at the end just calculate teh single random

humble tulip
#

mean is obv the avg of upper and lower bounds

drowsy helm
#

Is that not effectively the same as one random

humble tulip
grim ice
#

it is, though

humble tulip
#

wait

#

FUCK it is

#

oh my god

drowsy helm
#

Lmao

humble tulip
#

i overthought it

#

wait no

#

1 dice roll 1-6 evenly distributed

#

2 dice rolls is 2-12 but not evenly distributed

#

since there's 1 way to get 2 and 12

#

but many more to get other values like 7

#

anyhow, so the mean will be the midpoint

grim ice
#

that's a special case

humble tulip
grim ice
#

it is

humble tulip
#

how?

#

essentially i wanna simulate n dice rolls

grim ice
humble tulip
#

mistake

drowsy helm
#

So you want a logarithmic random basically?

humble tulip
#

i just forgot my maths

humble tulip
# humble tulip

here if each mob has a prop% chance of dropping something, you can calculate how many mobs should drop something by doing the normal approximation to the binomial distribution

eternal oxide
#

Do you really need that precision though?

humble tulip
#

yes

#

it's not precision

#

its just accurateness

eternal oxide
#

but thats not going to be a percentage chance of a drop

grim ice
humble tulip
#

YES thats what it's called

#

ok

#

found it

#

ty @grim ice

grim ice
#

np

torn shuttle
karmic falcon
#

i tried it but aint working

karmic falcon
slender elbow
#

the game rule most certainly does work

karmic falcon
#

i still get the menu thing

#

i tried setting the game rule thing and calling the respawn and not calling it

#

both cases it didnt work

slender elbow
#

server and client versions?

weary zinc
#

hey guys is there any way to paste building adjust as around environment?

karmic falcon
slender elbow
#

then something is preventing the gamerule from changing because it certainly works on a clean server

#

or you have some absurd mod/client but yeah idk

karmic falcon
#

the thing is, i am setting the game rule only for the minigame world only

#

maybe thats the problem cuz he gets respawned in the main world ig

#

or does he respawn in the same world?

slender elbow
#

respawn point is global, you can change it either permanently or dynamically in the respawn event

#

but game rules should be per world I believe?

#

idk how that works exactly

karmic falcon
#

but the minigame world is different from the main world

#

and like maybe its cuz when the player dies he respawns in the main world?

magic drift
#

How do i make Code Run Everytime a Player Joins

karmic falcon
magic drift
karmic falcon
eternal oxide
#

PlayerJoinEvent

magic drift
quaint mantle
#

emm xd

karmic falcon
magic drift
#

im bad at coding

karmic falcon
#

its okay

#

we all been there

magic drift
#

first time codder

karmic falcon
#

ohhhh

eternal oxide
#

good try but you need a few pointers

karmic falcon
#

yee u cant just jump into plugin making

magic drift
#

well i started with a Few Skripts

eternal oxide
#

Plugins don;t use a main method

karmic falcon
#

maybe go learn some basics of java would take u around 2 weeks

eternal oxide
#

what IDE are you using?

karmic falcon
magic drift
#

alr

magic drift
#

intellij

karmic falcon
#

i mean if u really wanna write plugins u can but its always better to write scripts u actually know how they work

magic drift
#

Man i just want a Simple Player Welcoming Message

karmic falcon
eternal oxide
#

follow that tutorial, it will show you how

karmic falcon
#

u saw how he placed that method

eternal oxide
#

yes, so follow the tutorial, he can learn

magic drift
#

ima Just watch a yt video

karmic falcon
#

;-;

magic drift
quaint mantle
#

you could try idk

#

but Its better to take your time and go step by step

karmic falcon
#

even if u finish the video and fully understand what bro says

#

u needa actually use those concepts

#

maybe what Elgarls linked could help u start out

#

try it out

#

but first understand a lil bit of the syntax

#

how methods/variables/classes work

magic drift
#

well i have adhd and its harder for me to just read text rather then watch videos

karmic falcon
eternal oxide
#

get the tutorial plugin working. then you can add a welcome message to it easily

#

small steps will get you there

magic drift
eternal oxide
#

isn;t adhd becoming super focus on a thing?

quaint mantle
magic drift
#

its the morning

#

i dont want to do school basicly

quaint mantle
#

you will asume later that reading docs will be more usefull

#

but at some point we all start

karmic falcon
#

guys i say we chill on bro, he still doesnt know how basic stuff works the link ouwld be so confusing

orchid trout
#

so you want to learn java, but you dont want to put in the effort?

karmic falcon
magic drift
quaint mantle
magic drift
#

Everything Gave me errors

quaint mantle
#

send code

#

let's see

eternal oxide
#

yeah chatGPT is not good unless you give it very specific instructions

karmic falcon
orchid trout
void sigil
#

But I don't recommend it

quaint mantle
#

crackma relax xd

magic drift
#

Just a Small Insert

#

'''package com.example;

public class EnhancementChangerPlugin extends JavaPlugin implements CommandExecutor, Listener {

private final Map<UUID, Long> cooldowns = new HashMap<>();

@Override
public void onEnable() {
    // Register the command and event listener
    this.getCommand("enhancementchanger").setExecutor(this);
    Bukkit.getPluginManager().registerEvents(this, this);
}

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (command.getName().equalsIgnoreCase("enhancementchanger")) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can use this command.");
            return true;
        }

        Player player = (Player) sender;
        if (!player.hasPermission("operator")) {
            player.sendMessage("§3You aren't allowed to do this");
            return true;'''
void sigil
#

Because your gonna be in a loop of "fix this bug pls"

karmic falcon
#

see guys

#

he doesnt know how to put those chunks in their place

void sigil
#

Or leave it

eternal oxide
#

yeah GPT doesn;t understand that JavaPlugin already has a CommandExecutor

magic drift
void sigil
karmic falcon
orchid trout
#

did you add any dependencies?

quaint mantle
magic drift
#

btw how do you get it to show up like code inside of discord

orchid trout
void sigil
magic drift
#

So like this

void sigil
#

Yes

magic drift
#

ohhhh i see what key it is now

#

its under the squigally

orchid trout
#

learn java, but if you want to go straight to plugin development - dont ask for help here

void sigil
#

And the pom xml

keen charm
#

Hey

#

I'm getting this error: ```
[23:09:03] [Server thread/WARN]: java.lang.ClassCastException: class net.minecraft.world.effect.MobEffect cannot be cast to class net.minecraft.world.effect.MobEffectList (net.minecraft.world.effect.MobEffect and net.minecraft.world.effect.MobEffectList are in unnamed module of loader java.net.URLClassLoader @4f8e5cde)
[23:09:03] [Server thread/WARN]: at UltraHide-1.1.1-4.jar//dev.eymen.ultrahide.nms.NMS_v1_20_4.refreshSelf(NMS_v1_20_4.java:193)
[23:09:03] [Server thread/WARN]: at UltraHide-1.1.1-4.jar//dev.eymen.ultrahide.data.HidePlayer.hide(HidePlayer.java:85)
[23:09:03] [Server thread/WARN]: at UltraHide-1.1.1-4.jar//dev.eymen.ultrahide.commands.PlayerCommands.onHide(PlayerCommands.java:97)

#

This is the piece of code that gives error: ```java
connection.send(new ClientboundSetExperiencePacket(serverPlayer.experienceProgress, serverPlayer.totalExperience, serverPlayer.experienceLevel));
for (MobEffectInstance effect : serverPlayer.getActiveEffects()) {
connection.send(new ClientboundUpdateMobEffectPacket(serverPlayer.getId(), effect));
}

magic drift
#

New code

#


public class Main {

    public static void main(String[] args) {

        String name = "Hello";
        System.out.println(name.toUpperCase());
    }

    }```
#

am i doing better

eternal oxide
#

for java yes

#

for a plugin, no

void sigil
#

Not sure though

eternal oxide
#

try sending serverPlayer.getActiveEffects()

void sigil
magic drift
#

what do i name it

eternal oxide
#

class Main is correct for Java

keen charm
eternal oxide
#

not for a plugin though

keen charm
#

Btw this is for 1.20.4

eternal oxide
#

then look to see if there is a way to pass all effects to MobEffectList

#

possibly a static helper method or constructor

void sigil
magic drift
#

i am

void sigil
#

Which one

#

Like for plugin development

#

Not java

magic drift
hybrid turret
#

i can decide rn between a boolean in PlayerData (which is loaded when a player joins) and a Set<UUID> in ServerData (which is loaded when the plugin is enabled and is kept for the whole session)

downside for the first one is: i would have to get the EntrySet onJoin for a check. which of these is better or are they the same?

eternal oxide
#

I linked you a full plugin tutorial

magic drift
void sigil
magic drift
#

ima watch every one

magic drift
void sigil
#

Pretty fair

#

Gives some basic info

void sigil
magic drift
#

alr

tardy delta
grim ice
hybrid turret
grim ice
#

I believe it doesn't apply to things they don't find fun

magic drift
#

should i use the newest version of java

eternal oxide
#

or lazy

grim ice
#

not so fun fact: 1/3 clinically diagnosed adhd patients, in fact, do not suffer from adhd

magic drift
tardy delta
#

its alr

molten hearth
grim ice
magic drift
#

no

grim ice
#

or to simply make one or two plugins?

magic drift
#

i wanted to see how many errors it would make

grim ice
#

What do you mean?

magic drift
#

When i used it every line of code had a error

grim ice
#

why are you trying to code?

magic drift
#

to make Plugins

#

and also make money

#

for doing something i like

grim ice
#

???

molten hearth
#

he doesn't need to learn

#

he just does it