#help-development

1 messages · Page 775 of 1

carmine mica
#

but there are a lot of less-than-ideal API design choices about the bungee chat component library imo.

#

adventure is a better one

pastel axle
#

I just needed something simple to add a clickable element. Don't really care what I use, my main plugin still uses FancyMessage

sterile breach
#

Hello, I think is not possible to register subbcommand using plugin.yml how to do ? (whithout acf or another framework)

wet breach
#

only the main command needs to be registered, everything below it is technically just arguments for the main one, how you treat those arguments is up to you

sterile breach
#

yes, but it still exists? (although we can use arguments) but is there a way to define a subcommand with spigot?

wet breach
#

not sure what you mean by define

sterile breach
#

register subcommand

wet breach
#

I already said you can't

sterile breach
#

so with ctf the annotation @subcommand not create subccommand? (just add (if arg)?)

wet breach
#

all a subcommand is, is just an argument of the main command it derives from

#
/ess give player item

Alright, in this example, ess is the main command, give is the subcommand. It is technically an argument of the main command ess just in code we don't treat it that way.

#

you can alias /ess give to /give instead as well

#

and it appears its a main command, but still isn't

sterile breach
#

so subcommand for server or client doesn't exist it's just a command arg?

wet breach
#

wouldn't be a subcommand otherwise if it wasn't under some other command

#

the handy thing about them is that they don't require being registered since they are not main commands

#

and its handy in code to not have to register it either 🙂

sterile breach
#

okay, because with worldedit I had tried to modify the permissions of simple commands by doing getcommand("brush").setpermission("blabla") but it didn't work I was told I had to do get command on a brush subcommand

wet breach
#

permissions on sub commands can be set in plugin.yml but the plugin has to support it as well

sterile breach
#

so its possible to set subcommands permissions?

wet breach
#

yes

sterile breach
#

do you have a small example with that?

wet breach
#

as you can see, my defunct plugin here makes use of sub commands and permission for said sub commands. And you can set the default perms of those sub commands in the plugin.yml. However, for the defaults to work in plugin.yml the plugin actually has to check for such perms for the usage of those subcommands

echo basalt
#

Tell em

wet breach
#

if the plugin didn't do that, the perms are meaningless

sterile breach
#

but permissions aren't really defined on the subcommand, I mean it's in the command's exection logic that it checks the perm so when I do getcommand("x").setPermission("a") shouldn't all this be added by but permissions aren't really defined on the subcommand, I mean it's in the command's exection logic that it checks the perm so when I do getcommand("x").setPermission("a") shouldn't it be added on top of all that??

echo basalt
#

I really don't like relying on bukkit's command permission system

#

Just write your own checks and take ownership of code flow

wet breach
#

by the mere fact that the plugin uses it in its command logic, is the reason the perm works and you are able to set it in the plugin.yml. The built in permission system is very basic. Plugin.ymls can grant perms with it, and the system will assign it to everyone however it doesn't do anything beyond that and you would have to check within logic for said permission. The checking of the permission is where it makes it work.

#

if the plugin doesn't care about permissions on the subcommands and only the main command, then the only permission that would work for the plugin is the main one, since the plugin isn't going to check for perms on the sub command

wet breach
#

but I don't make use of that system beyond this either lol

#

Also its not like there is a lot of commands either for the players

#

just like 2 and the rest are for ops really

sterile breach
#

yes, so a plugin with no "main" permission but with permissions checked in the execution logic, adding a permission to the command as you would in the plugin.yml should block the command call if the executor doesn't have permission? so why does it call the cmd even if I don't have the required permission?

wet breach
#

because the command logic has to block the request by checking if you have the permission or not, the built in permission system doesn't do this itself

#

the built in permission system, just tracks if someone does or doesn't have permission, but it doesn't enforce anything itself

sterile breach
#

if I call a command for which I don't have the perm, it won't call the execution logic, will it?

echo basalt
#

Which is why I find it useless

#

Just give up on command#setPermission

#

Check the logic on your handler

wet breach
sterile breach
#

but defining a no permission message on the command in plugin.yml doesn't help either?

wet breach
#

the way plugins make use of that, is by returning false on a command, again because some logic failed in this case would have to be a permission check failed

sterile breach
#

i'm doing this to 'cleanly' remove the 'tab completion' command from the client i'm trying to remove permission for cmds world edit but no work

#

ah okay is return false

wet breach
#

yeah onCommand is a boolean

sterile breach
#

yes i knwo

wet breach
#

if it returns true, the command was sucessful even if nothing happened, if its false the system assumes you don't have permission to use it

#

and therefore returns the message you referred to 🙂

#

however most people just return true, and return their own messages within the logic

#

instead

#

mainly because the message that gets displayed when you return false could be misleading and isn't dynamic either

#

like someone could have permission, but the failure is because they typed something wrong for example

sterile breach
#

commands:
letest:
permission: ok
permission-message: no ok

public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    System.out.println("ok");
        return false;
}

it should return no ok?

#

and permission in plugin.yml allows the server to know if it is sending the command in completion to the player, but by doing setpermission on worldedit the command was still sent oddly

wet breach
#

idk about sending the command in completion, tab completion isn't handled by the permission system rather its handled by brigadier

#

haven't look at the specifics with brigadier and don't remember if permissions affect what it sends, but if I recall brigadier sends completions regardless of perms

sterile breach
#

only sends commands for which the player has the perm (apart from worledit)

wet breach
#

well, as I said I don't really remember the specifics since I generally don't concern myself with tab completions

#

I can only tell you about the basic permission system in the server which it really is very basic lol

sterile breach
#

ok, I understand, and return false should therefore display a message in my case?

wet breach
#

the way your code is setup it should print ok and your permission message

#

since you don't have anything to block the printing

sterile breach
#

it should but I don't get the message (just print ok)

wet breach
#

maybe because your permission would technically be incorrect?

#

should be letest.ok or just letest

sterile breach
#

name: letest
version: '${project.version}'
main: fr.dylors.test.Test
api-version: '1.20'
commands:
letest:
permission: letest.ok
permission-message: no ok

probably not that

modern ridge
#

on old ver it show death and dirt screen

#

that i don’t want

twin venture
#

hi , iam having weird error i could not slove it yestrday it was too late ..

so for some reason only the first user who joins the server is being loadded

#

this is what i use :

#

what iam doing wrong?

chilly hearth
#

um

twin venture
#

yeah

#

it was working like weeks ago , but now it just stoped working with no error or anything 😦

chilly hearth
#

public class HealthEvent implements Listener {

    @EventHandler
    public void OnBossDamage(EntityDamageEvent e){

           Entity boss = e.getEntity();
           if(boss instanceof WitherSkeleton witherSkeleton){

               if(witherSkeleton.getScoreboardTags().contains("a")){
                   witherSkeleton.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither Skeleton" + ChatColor.WHITE + "| " + ChatColor.RED +"❤ " + Math.round(witherSkeleton.getHealth()));



               }



           }else if(boss instanceof Zombie zombie){


               if(zombie.getScoreboardTags().contains("b")){

                   zombie.setCustomName(ChatColor.DARK_RED + "" + ChatColor.BOLD + "Reaper Zombie" + ChatColor.WHITE + "| " + ChatColor.RED +"❤ " + Math.round(zombie.getHealth()));


               }



           } else if (boss instanceof Ravager ravager) {

               Bukkit.broadcastMessage("a");

               if(ravager.getScoreboardTags().contains("c")){

                   ravager.setCustomName(ChatColor.RED+ "" + ChatColor.BOLD + "Chaos Ravager" + ChatColor.WHITE + "| " + ChatColor.RED +"❤ " + Math.round(ravager.getHealth()));


               }




           }else if(boss instanceof Spider spider){

               if(spider.getScoreboardTags().contains("d")){

                   spider.setCustomName(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "Exotic Spider" + ChatColor.WHITE + "| " + ChatColor.RED +"❤ " + Math.round(spider.getHealth()));



               }


           }else if(boss instanceof Husk husk){


               if (husk.getScoreboardTags().contains("e")){

                   husk.setCustomName(ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Feral Husk" + ChatColor.WHITE + "| " + ChatColor.RED + "❤ " + Math.round(husk.getHealth()));

               }



           }


         }


    }


``` all other are working expect of the husk 😦
twin venture
#

ok i figured it out , it was because hickariCp for some reason :p

glad prawn
#

check the Husk inside the Zombie will works ig

undone axleBOT
grim hound
#

From what I can see, Map#put would've done the job

timid hedge
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

timid hedge
#

Does anyone know where i get the .json file for mcp? i have seen a toturial but there isnt a download and i dont know where i should get it
Here is how it looks: https://prnt.sc/RgFjmlPTz4BQ

chrome beacon
#

You still haven't answered me. Why are you using MCP

#

There is no reason to

timid hedge
#

What should i else use?

chrome beacon
#

What are you trying to do

timid hedge
#

Just trying to make my own launcher client or what its called

chrome beacon
#

Had a feeling that was the case...

#

Just use a modloader like Fabric or Forge

fossil flax
#

is there a way to use bungeecord command in a npc?

twin venture
upper hazel
#

I want to create a “custom block” with the same minecraft generation logic. Is it a good option to start by inheriting some real class from the bukkit api so that the class is responsible for the “block”

grim hound
grim ice
#

Hey, do you guys have an idea of how would I get an npc and spawn it?

#

the npc is made by a mod

#

(CustomNPCs)

#

and i want to get the npc itself with spigot, and spawn it

#

I think that should be possible

#

since the npc is just an entity? or

chrome beacon
eternal oxide
#

You can;t issue bungee commands from Spigot. You must use PMC

#

?pmc

grim ice
#

if i was on 1.18 I would use structures

#

but im on 1.12

chrome beacon
#

You'd have to ask whatever hybrid server you're using

#

They implement things differently and are not supported here

grim ice
#

its Mohist

#

so its just spigot and forge

grim ice
#

but eitherway

#

mohistmc's server is dead

onyx fjord
chrome beacon
#

Spigot doesn't support mods

#

So they have to implement things differently to force it to work

grim ice
#

but its prob just internal stuff

#

that i dont need to care about

chrome beacon
#

You really do need to care about that though

#

since you're trying to mess with a modded entity

grim ice
#

the way custom npcs does it

#

is similar to spigot

#

cant i just like

#

get the entity instance and somehow spawn it

#

i think custom npcs handles the rest

#

when it notices one of its npcs are spawned

dry hazel
#

and that entity may or may not break bukkit api contracts

chrome beacon
#

How you'd get the instance depends entirely on what the hybrid has done to make it run

#

or if you're planning on using nms that'll be even more pain

grim ice
#

feels like its worth it since im being paid 1.5 grand

chrome beacon
#

Just make a mod

#

That'll be so much easier

grim ice
#

yeah

#

but forge 1.12

#

has 0 support

chrome beacon
#

Hybrid also has 0 support

grim ice
#

😭

chrome beacon
#

maybe there's a reason you're getting paid so much :p

grim ice
#

yeah 💀

rotund ravine
#

Gl

grim ice
#

tbh even if i make a mod

#

ill need to see how customnpcs makes the npcs

#

right

chrome beacon
#

yes

grim ice
#

or maybe i can use customnpcs as a sort of library

#

or something?

rotund ravine
#

Probably

grim ice
#

and just take the npc right from it

#

and there isnt a github for it

#

Amazing

#

oh wait

#

:O

chrome beacon
#

Reading decompiled code

grim ice
#

most of my payment will go to the therapist 💀

fossil flax
#

someone know why this code is not working?

@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent e) {
Player p = e.getPlayer();

    p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 1, true, false));
    p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, Integer.MAX_VALUE, 1, true, false));
    p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1, true, false));
}

i have the same code for the onPlayerJoin event and that one is working

icy beacon
#

Does anybody know what will happen if you cancel an event with a delay? I presume that it will just not be cancelled but who knows lol

#

I will test it later anyway but would be good to know in advance

eternal oxide
#

you can;t delay canceling

icy beacon
#

What if I change any other event values with a delay, like maybe the damage or smth?

#

Is that possible at all?

eternal oxide
#

you can;t delay anything in an event

icy beacon
#

Ok makes sense, just wanted to make sure

#

Tyty

eternal oxide
#

if you want to make any change to an event you do it when it fires or not at all

icy beacon
#

Yeah

rotund ravine
rotund ravine
eternal oxide
#

Sounds good to me 🙂

icy beacon
#

In real life

rotund ravine
#

I know ahaha

#

It will def delay the event tho

icy beacon
#

Oh true

#

I'll use it then

rotund ravine
#

Ur welcome

icy beacon
#

Ty!!

hybrid spoke
#

just fork spigot

eternal oxide
#

for daily events just Thread.sleep in the onEnable for 24 hours 🙂

icy beacon
hybrid spoke
icy beacon
#

😮

#

That works

hybrid spoke
#

then the server accidentally crashes

icy beacon
#

Can I also inject spyware on their personal computers?

hybrid spoke
#

and voila its in

eternal oxide
hybrid spoke
icy beacon
#

Oh ok then

icy beacon
hybrid spoke
#

nice try but im more of a dog person

icy beacon
#

I will send you dog photos then, what's the biggie

hybrid spoke
#

i dont want photos of yourself

icy beacon
#

Damn dawg

soft shuttle
#

hi does anyone know how to change the player limit using code with bungee?

chrome beacon
soft shuttle
#

Lmao... ty

#

im stupid

meager wolf
twin venture
#

hi , i am having really really reallllllllllllllllly weird problem , all commands are notworking

#

nothings hppanes

#

tried everything even debugged it

#

but nothing show

rotund ravine
#

Nice

icy beacon
#

"Not working" as in doing nothing or showing up as nonexistent (red)? Does your plugin start up? Did you register your commands? Did they work before you introduced some changes? Are there any errors?

#

Please share more information than "not working"

rotund ravine
#

Does the console allow you to run em

twin venture
#

yes it should

#

ik the codes looks messy , but it was working before idk what happend all commands stoped working

icy beacon
#

After you run a command, do other commands work? (like /tps)

twin venture
#

yes

#

all other commands works

icy beacon
#

Well first of all this code is already super error prone

#

Each of these lines can throw an exception

twin venture
#

what about play

#

its the same thing

icy beacon
#

CommandSender is not necessarily an instance of Player

#

Do you do an instance check?

twin venture
#

it should send an error

#

atleast

#

but nothing is happening

#

:((((((((

icy beacon
#

Did you register your commands? You sure?

twin venture
#

yes ofc i did

icy beacon
#

Double check your onenable

twin venture
#

admins commands was down , but i channged it to bukkit way of registering command just to test it out

#

and its still the same problem

#

it just broke like 30 minutes ago no warrning nothing

#

well i know why probbly xD

rotund ravine
#

Huh

#

What is this command class

icy beacon
twin venture
#

uhhh ik what's wrong

icy beacon
twin venture
#

i didn't set any value in the settings file for the lobby-location

#

that why itwasn't registeringanything ..

icy beacon
#

Nice

twin venture
#

yeah 30 minutes wasted

rotund ravine
#

Imagine

icy beacon
# twin venture

how did you not see the debug message you left for yourself

#

Gg

twin venture
rotund ravine
#

I feel like

twin venture
#

for some reason

rotund ravine
#

You should use the logger

#

Also don’t not register commands cause of that. Make the commands give some sort of feedback i guess

icy beacon
upper hazel
#

Does anyone have a separate article about event bugs?

#

it would be very useful

chrome beacon
#

Event bugs?

upper hazel
#

yes

#

Currently I know that inventoryClick needs to be canceled along with InventoryDrag and that it’s better not to use playerInteract again

rotund ravine
#

What

#

What’s with playerinteract

topaz cape
#

i use playerinteract just fine

#

never had a problem with it

glad prawn
#

what

topaz cape
#

player interact is not for inventory

#

its for clicking items your hand

#

not understanding the event is not the same as "bugs"

icy beacon
lost matrix
#

Could you elaborate?

#

Nvm with that pfp. Dont bother.

#

Im not. Nothing against palestine. But the person on your picture is a hamas member i assume?

gaunt sonnet
#

Hello everyone, my friend creates custom models, but how can I interact with them in code, how can I do that on the server?

shadow night
#

Tf is isis

rotund ravine
shadow night
#

Young

icy beacon
#

Nothing good

shadow night
#

Okay

lost matrix
gaunt sonnet
lost matrix
#

The simple solution would be to use something like ItemsAdder for items and ModelEngine for complex models.
But both plugins are premium. A custom solution is possible but will take some tinkering to get right.

young knoll
#

Flashbacks to getting animations right

gaunt sonnet
lost matrix
young knoll
#

Tbf the ai isn’t that bad

#

You can just hijack vanilla ai

lost matrix
#

Myeah but making the animations work like you want to, can be quite difficult.
And making sure your custom brain or goals arent just thrown out the window when
minectaft loads the chunk again is real pain.

young knoll
#

We do a little registry hacking

#

I got the ai down fine, never got the animations to not implode

lost matrix
#

Exactly. And then at some point you bump into frozen shenanigans

young knoll
#

Don’t worry I have a method for that

#

Heh

lost matrix
#

-.-

icy beacon
#

In what version was Entity#isInWater() added? I can see it was added on this date but I'm not sure about the version

lost matrix
icy beacon
#

Thx

#

Is there any way to show all the files that were there when a commit was done?

#

That'd make it easier

#

It's apparently this commit but I don't know how to see the rest of the files

lost matrix
#

Uhm you can probably do some gitery to roll back to a certain commit.
Just make a branch and try a rollback to this exact commit.

icy beacon
#

Hmm

gaunt sonnet
#

How do I program a scoreboard that updates constantly without flickering

river oracle
icy beacon
#

bcddb7542af9e1e7db07d46495d94e69d0d1cd8b

eternal night
#

literally just git checkout ?

icy beacon
#

Is there any way to do this directly on the website because I really don't wanna go cli mode just to see the version that a commit dates back to

river oracle
#

stash can't resolve that revision 🥲

lost matrix
river oracle
river oracle
#

wtf how did it resolve for you

#

it said the commit didn'te xist for me kms

#

oh cuz its fucking bukkit

eternal night
#

were you on craftbukkit ?

#

yeee

river oracle
#

I was looking at cb

river oracle
#

1.16.4 ZBLL

icy beacon
#

I was trying to put the hash into the branch field but it wasn't showing up

#

Guess it's done with url params lol

#

Thanks Y2K_ and lynxplay 🙂

quaint mantle
#

i have code:java @EventHandler public void modesAction(InventoryClickEvent e) { Player p = (Player) e.getWhoClicked(); if (e.getView().getTitle().equalsIgnoreCase(ChatColor.GRAY + "Wybór trybu")) { ItemStack currentItem = e.getCurrentItem(); if (currentItem != null && currentItem.hasItemMeta()) { ItemMeta itemMeta = currentItem.getItemMeta(); if (itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals("Survival")) { p.sendMessage(ChatColor.YELLOW + "Łączenie z trybem Survival..."); } } } }

#

and i would to make connection to another bungeecord server

#

in this event

icy beacon
#

Plz do not compare inventories by title

quaint mantle
#

and i don't know why

quaint mantle
icy beacon
#

I do not remember exactly why but generally it's a bad practice

#

?guis

undone axleBOT
icy beacon
#

Wrong link

#

Smile plz send your article

lost matrix
lost matrix
quaint mantle
#

yes

icy beacon
#

Send a message via PMC

#

?pmc

lost matrix
quaint mantle
#

?

#

but i need to connect player who clicked item

#

to another server

lost matrix
#

This explains how to communicate between Bukkit and Bungeecord

lost matrix
quaint mantle
#

ok,thanks

acoustic stag
#

how to prevent block from being destroyed if there are banners attached to it (standing on top or hanging from the side)?

icy beacon
#

In BlockBreakEvent check the adjacent blocks and see

acoustic stag
#

yeah but how do i check if the adjacent banner is attached to the broken block

quaint mantle
#

i wrote new code and i have an error

lost matrix
# quaint mantle i wrote new code and i have an error
p.sendPluginMessage((Plugin) this, "BungeeCord", out.toByteArray());

You cant cast your compassClick.class to Plugin because its not a Plugin class.
Get an instance of your JavaPlugin class and pass it to this method instead.

quaint mantle
#

ok

#
@EventHandler
    public void modesAction(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        if (e.getView().getTitle().equalsIgnoreCase(ChatColor.GRAY + "Wybór trybu")) {
            ItemStack currentItem = e.getCurrentItem();
            if (currentItem != null && currentItem.hasItemMeta()) {
                ItemMeta itemMeta = currentItem.getItemMeta();
                if (itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals("Survival")) {
                    p.sendMessage(ChatColor.YELLOW + "Łączenie z trybem Survival...");
                    ByteArrayDataOutput out = ByteStreams.newDataOutput();
                    out.writeUTF("Connect");
                    out.writeUTF("survival");
                    Spawn pluginInstance = Spawn.getInstance();
                    p.sendPluginMessage(pluginInstance, "BungeeCord", out.toByteArray());

                }
            }
        }
    }```
#

and i get error

#

spawn code : ```java
package pl.playgroundhc.spawn;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import pl.playgroundhc.spawn.actions.compassClick;
import pl.playgroundhc.spawn.events.joinEvent;

public final class Spawn extends JavaPlugin {
private static Spawn instance;

@Override
public void onEnable() {
    instance = this;
    getServer().getPluginManager().registerEvents(new joinEvent(),this);
    getServer().getPluginManager().registerEvents(new compassClick(),this);
}

@Override
public void onDisable() {
    // Plugin shutdown logic
}
public static Spawn getInstance() {
    return instance;
}

}

lost matrix
#

Alright, we just need the error now 🙂

quaint mantle
#

here

lost matrix
# quaint mantle https://pastebin.com/yWtbw2dc

You forgot to register the BungeeCord channel for your plugin

  @Override
  public void onEnable() {
    this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    ...
  }
quaint mantle
#

ok

#

thanks

zealous osprey
#

Ehh, why isn't this working?
I swear I did something like this before

young knoll
#

Pretty sure you can do that

#

But not on older java versions

zealous osprey
#

Im on 17

lost matrix
#

You cant auto unbox like that. short[] != Short[]

young knoll
#

Ah right

#

Primatives :c

zealous osprey
#

So it would need too be Short[]::new instead of short[]::new

#

thx, it worked

#

ah yes, when you miss a "(", "!" or even just write a letter in capital, isntead of lowercase :)

young knoll
#

To be fair, short and Short are quite differnt :p

zealous osprey
#

One is shorter than the other, I get it

young knoll
#

Exactly!

glad prawn
#

lol

acoustic stag
#

how to get a banner's color and pattern?

young knoll
#

Pretty sure that in the state

#

So Block.getState and cast

acoustic stag
#

ohh alright thanks

young knoll
#

Me

icy beacon
#

Why is it so smol in 1.20 😭

#

Gives bedrock vibes

young knoll
#

What is your gui scale

icy beacon
#

2

#

Always has been

young knoll
#

¯_(ツ)_/¯

#

I don't think mine is any smaller

icy beacon
#

Yeah it looks awkward but it's fine lol

lost matrix
icy beacon
#

xD

#

Nah it's not like stupidly small

river oracle
#

Registry 😆 REGISTRIES. Maximum customization

icy beacon
#

And I love all the other GUIs at scale 2

river oracle
#

O

#

I'm pretty sure I use GUI Scale 2

icy beacon
river oracle
#

Its not too small and its not too big

young knoll
#

:p

river oracle
# young knoll Okay mojang

I always try to make everything in my plugins as customizable as possible. So right now I only have 3 registries, but it might be more before I finish

young knoll
#

Yeah I do that too these days

#

My message system and config system help a lot

river oracle
#

I need a generator-formation registry still which takes in a 3d array of materials and block data from a json config

#

and can read it into a structure

#

I was thinking about using WE schematics for this though instead

young knoll
#

I wish you could run the WE api without WE on the server

#

Sadge

slender elbow
#

provides

#

still needs some setup tho

river oracle
#

same with some other Utilities. like my spacial utilities whic just do stuff with the world and aren't reliant on my project

young knoll
#

Thankfully remaking WEs schematic system isn't too hard

#

Does require NMS tho

river oracle
#

that's all it does

icy beacon
#

Wtf

[20:09:09 INFO]: Event type org.bukkit.event.entity.EntityDamageEvent
[20:09:09 INFO]: Expected type com.roughlyunderscore.events.PlayerGotHurtEvent
plugin.server.pluginManager.registerEvent(holder.eventType, object: Listener {}, EventPriority.NORMAL, { _, event ->
  println("Event type " + event.javaClass.name)
  println("Expected type " + holder.eventType.name)
}
@EventHandler
  fun onPlayerGotHurt(event: EntityDamageEvent) {
    if (event.entity !is Player) return

    val playerGotHurtEvent = PlayerGotHurtEvent(event.entity as Player, event.cause, event.damage)
    playerGotHurtEvent.isCancelled = event.isCancelled
    println("Got hurt event called")
    Bukkit.getPluginManager().callEvent(playerGotHurtEvent)
  }
river oracle
#

it just interfaces with NMS and provides me API

icy beacon
#

So I'm registering a listener for my own event that extends EntityDamageEvent

#

And somehow it gets called every time EntityDamageEvent occurs

#

Instead of only being called when my event is called

lost matrix
#

Thats how events work. EntityDamageByEntityEvent will also be passed to EntityDamageEvent listeners

icy beacon
#

No I'm listening to my PlayerGotHurtEvent

river oracle
icy beacon
#

Why is the listener getting called when EntityDamageEvent is called

#

It'd make sense if it was the opposite

#

But this does not make sense

young knoll
#

How is that possible

river oracle
young knoll
#

But like

river oracle
#

its a symptom of a problem I don't quite understand

young knoll
#

EntityDamageEvent cannot be cast to PlayerGotHurtEvent

lost matrix
zealous osprey
#

Time for some bit fun :)
Does anyone know an easy (and preferably fast) way too find out how many "1"s are in a given number?

eg.: 248 -> 0000000011111000 -> 5

icy beacon
young knoll
#

Yes

icy beacon
young knoll
#

All PlayerGotHurtEvents are EntityDamageEvents

#

But not all EntityDamageEvents are PlayerGotHurtEvents

river oracle
young knoll
#

Yeah you should have a static and non static handler method

icy beacon
#

Yeah I thought EntityDamageEvent didn't need handlers haha

#

Does every event need them?

young knoll
#

Afaik yes

icy beacon
#

I thought it was only for those that are very abstract like PlayerEvent

river oracle
#

yes

lost matrix
young knoll
#

If you want it to be listenable

icy beacon
#

Holy shit

river oracle
#

no every event needs a handler list

rotund ravine
zealous osprey
icy beacon
lost matrix
zealous osprey
#

<3

young knoll
#

O wait maybe not

river oracle
young knoll
#

I thought children events needed a handler list but I appear to be wrong

river oracle
#

every event should have one

river oracle
#

what

icy beacon
#

Yeah

#

That's what I'm saying

zealous osprey
icy beacon
#

I'm pretty sure you only need handler lists when the event you extend is not listenable by itself

#

Like PlayerEvent

young knoll
#

Probably

icy beacon
#

But if you're extending a listenable event you don't need one

#

Ok so if I'm listening to event B, which extends event A, the listener should not be called when event A happens, correct?

slender elbow
#

if event B doesn't have a handler list but A does, it should

zealous osprey
young knoll
#

Afaik parent event listeners will still catch their child events, but not the other way around

slender elbow
#

Either B needs to have its own handler list or the eventexecutor perform an instanceof before invoking the listener

icy beacon
#

In which case I do not understand why it's not lol

young knoll
#

¯_(ツ)_/¯

#

Give it it's own handler list I guess

icy beacon
#

Maybe I'm misusing PluginManager#registerEvent?

rotund ravine
#

Just use a handerlist for ur own event 💪🏻

rotund ravine
icy beacon
slender elbow
rotund ravine
#

Makes sense if it’s applikable that it will run when its parent runs

slender elbow
#

so the executor will be invoked for B as well as A

#

if B has its own list, then the executor won't run for A

rotund ravine
#

Smart

#

When are you getting a colored name emily

slender elbow
#

it's a horrible system imo, but it's older than some of the members of this discord so what gives

icy beacon
#

White is also a color

young knoll
#

Technically it's a shade

icy beacon
#

🤓

young knoll
#

I mean the system could be redone without breaking changes

#

But it works well enough so no one has bothered

rotund ravine
young knoll
#

Maybe I'll add redo event system to my list

#

kek

icy beacon
rotund ravine
young knoll
#

Well yeah ofc

rotund ravine
#

Oh wait u already said that

river oracle
#

it wouldn't be hard to keep legacy support with events

#

I mean the API itself is pretty malleable

slender elbow
#

yeah but you'd still need to support existing events from plugins with a handler list, so like, the system would need to stay

slender elbow
rotund ravine
#

Only on some servers

icy beacon
#

Y2K_ if you would like to gift me nitro I would not reject the gift 😳

young knoll
#

I don't think anyone would :p

icy beacon
#

xD

river oracle
#

frost gvae me nitro, I wouldn't ever buy it for myself

young knoll
#

REject it

rotund ravine
#

Pay me 15$ and i’ll buy u nitto

#

Nitro

young knoll
#

Idk maybe some people really don't want nitro

icy beacon
rotund ravine
#

Discord gives me free nitro a lot

#

This month was free from them

icy beacon
rotund ravine
#

Ahaha bots

tall dragon
#

lmfao

river oracle
#

bots xD

tall dragon
#

rip

#

ahahhaha

young knoll
#

Yeah bots always grab those

river oracle
#

you always DM

young knoll
#

rip

rotund ravine
#

Grats to the bot

celest notch
#

How do you change the displayed player amount with spigot

icy beacon
#

Though thanks for the offer haha

young knoll
#

One I have a stable source of income I will buy Nitro

#

Discord has done a lot for me

rotund ravine
young knoll
#

In new versions you can do it without the event

river oracle
#

which is a huge win

young knoll
rotund ravine
#

Coll

young knoll
#

me

rotund ravine
#

Read his question

young knoll
#

ah

#

Displayed amount

#

shh

#

setOnlinePlayers when

celest notch
young knoll
#

Nah

rotund ravine
#

?jd-s

undone axleBOT
young knoll
#

You'll need the event for it

icy beacon
#

I'm pretty sure it's not possible though

rotund ravine
rotund ravine
young knoll
#

Actually

river oracle
#

@young knoll review my brand new PR CH_BlobTrashParty

icy beacon
#

I think I had a convo here

young knoll
#

The event seems to only have a getter, not a setter

icy beacon
#

Where I tried to change the amount of the players

#

But it just was not possible

#

Read what Choco said

young knoll
#

Mmh maybe we can PR that :p

celest notch
young knoll
#

Yeah you are gonna need packets

#

Or some reflection magic

celest notch
#

im using nms already what is the packet i need to use

young knoll
#

You would need a packet listener

icy beacon
#

And packets might help

river oracle
#

something like PacketEvents would work nicely here

icy beacon
#

xD

young knoll
#

PacketEvents, Protocollib, or netty

river oracle
icy beacon
rotund ravine
river oracle
#

using reflection probably easiest

river oracle
icy beacon
#

Because from what Choco has told me it was not

river oracle
#

who knows

icy beacon
#

I tried

#

xD

young knoll
river oracle
#

ahh

#

then packets it is

icy beacon
#

Yeah

young knoll
#

That's the packet, it's in json format so you'll have to handle that

#

Gson should work

icy beacon
#

And this is the allegedly working code with ProtocolLib

young knoll
#

Looks reasonable

river oracle
#

Stardew Valley is such a relaxing games

young knoll
#

I think it's only one game

#

But yes

river oracle
#

I wish my first language wasn't english so I would have an execuse for being so bad at it

zealous osprey
#

Quick question, hopefully...
Does a short, which is 16bits, take up the same space as a long or is storing 4 shorts the same as storing a long?

rotund ravine
#

Context?

river oracle
icy beacon
#

Is the static getHandlerList required for an event, or is overriding getHandlers enough?

#

Why are there 2 anyway

icy beacon
#

Sooo it's required?

river oracle
#

yeah

icy beacon
#

Welp

zealous osprey
#

I'm currently storing an array of 16 shorts, cause it is more convenient than storing 4 longs in an array.
However, I will be storing like up to 800 - 2000 of those 16 short arrays.
So I was wondering if it is more effective too store 800 arrays of 4 longs each.

river oracle
#

just ignore Intelij it can scope

icy beacon
#

That's the thing

rotund ravine
#

?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.

river oracle
#

that is not something that should happen

icy beacon
#

Use Kotlin

#

That's what I did

rotund ravine
#

Ahh

river oracle
#

oof

rotund ravine
#

.@JVMStatic

icy beacon
#

Yeah ik

river oracle
#

why is it in a copmanion object? could that be the issue

icy beacon
#

Because static values can only be stored in objects

#

One sec I think I have an idea

river oracle
#

why isn't your event an object

icy beacon
#

Objects can't have constructors

river oracle
#

what Kotlin Jank

icy beacon
#

Object is basically a static class

rotund ravine
icy beacon
#

Ik

#

Had I named the variable handlerList then I'd understand its complaints

#

Ok I solved the problem

rotund ravine
#

z.@JVMField no getters

icy beacon
#

I just had to extend a class that didn't already have handlers

rotund ravine
#

Ah k

icy beacon
#

Oh wait that can be done?

#

I still have 4 events that I haven't converted

#

Let's see

rotund ravine
#

Idk, been a while. Usually everything works after a second or two of tinkering

icy beacon
pine sandal
#

But using ProtocolLib is probably the safer route.

rotund ravine
icy beacon
rotund ravine
#

Oh well

icy beacon
#

I'll just keep extending classes with no default handlers

#

Yeah it compiles like this, though now I gotta see whether it helped my problem

zealous osprey
wet breach
river oracle
icy beacon
#

But kotlin kinda fucks around

wet breach
#

oh using kotlin

icy beacon
#

😄

river oracle
wet breach
#

if you are making a custom event that doesn't exist

#

just extend Event

#

if you are wanting to add a more specific custom event, just extend off the one that you want to use

ivory sleet
#

conor yes

#

If you plan on using them all

#

Then use a long array, or bitset maybe

#

which is a long arr lol

river oracle
#

what is the advantage of a long array vs a short array

icy beacon
# wet breach just extend Event

I mean my events were not too niche like PlayerShootBowEvent (just extends EntityShootBowEvent), but when adding handlers to them, a clash was happening because Kotlin automatically adds getters, so I had to extend Event in every case, because the clash was happening due to the fact that the class I was extending already had handlers

#

Ok adding handlers actually helped resolve my problem yay

lost matrix
#

Average HandlerList shenanigans

wet breach
icy beacon
#

😄

icy beacon
# wet breach typically would just override the handlers

That's what I did. I just didn't have my own handlers before and extended EDBEE, but the problem arised when I tried to listen to my own event - firing EDBEE would also fire my listener. So I just extended Event and added handlers

ivory sleet
icy beacon
#

To abstract myself completely from potentially clashing with an event ever again

ivory sleet
#

Ans things are stored in multiples of 32 bit iirc

#

where you’d use 2 cells for longs and doubles i believe

#

So it may be worthwhile if you know you’re going to use it all

river oracle
wet breach
ivory sleet
#

but its a negligible optimization

lost matrix
ivory sleet
river oracle
#

ahhh

zealous osprey
ivory sleet
lost matrix
#

I assumed he knows the exact amount of arrays beforehand. If not then this is not viable.

ivory sleet
#

Yeah, as smile said, if its binary or not may also dictate your end choice

wet breach
#

Seems I didn't need to impart my knowledge on that lol. Conclube and 7smile7 seem to have it handled 🙂

river oracle
#

infinite super reactions so dumb lol but I love it

wet breach
#

lol

zealous osprey
# lost matrix You can also just store all shorts in one consecutive short array. It really dep...

I'll give a bit more context:

I'm currently trying to implement a greedy meshing algorithm and too make it faster and easier for me, I've stripped away the whole idea of Block.class and am rather just storing an array of shorts, eg short[16] to represent a 16x16 area, ie a "slice" of a chunk.
Since a chunk, in 1.19+, goes from -64 too 319, ie 384 "slices" high, I need too store 6.144 arrays of 16 shorts.
As @ivory sleet pointed out, things are stored in multiples of 32. So I thaugt, that maybe I'd be using up 6.144 memmory addresses too store my data, while only using half of their capacity.
If so, I might change my array type from short too either int or long.

Very important however is, that I'm doing a lot of bitwise operations too work with my bitmap/field, so short is most convenient rn.

lost matrix
#

So the short contains the relative X and Z coordinates of blocks in your chunk. Im not 100% sold on grouping them in one array per Y coordinate.
What are you meshing out? In my head there is information missing in this structure.

zealous osprey
wet breach
#

one for the y, the other for x,z bitmask

zealous osprey
#

You mean something like boolean[][]?
But that would make dealing with the bitwise operators annoying, wouldn't it?

zealous osprey
lost matrix
#

Ah ok i understand this now.
So 1 represents a solid block and 0 is a passable block like air.
A chunk slice from above is

0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1
.
.
.
1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1

so 16x16 bits, either 1 or 0

zealous osprey
quaint mantle
#

Boolean is 0x01 or 0x00 anyways.

young knoll
#

What about bitset

wet breach
lost matrix
#

boolean and byte arrays would both be less memory efficient on the first glance.
If not optimized then a boolean occupies 32 bit in the beginning

zealous osprey
ivory sleet
#

maybe int idr :>

young knoll
#

Yes

lost matrix
#

I think the most memory efficient structure would be a long[] or int[]

ivory sleet
#

Yeah it is

rotund ravine
#

Imagine being efficient

ionic dagger
#

is developing for 1.16.5/17 different than developing for 1.20

lost matrix
#

Well probably long as it can utilize 64bit platform intrinsics

wet breach
young knoll
#

It's a long[]

ivory sleet
young knoll
#

Idk how a single integer would work for something that can have arbitrary size

chrome beacon
lost matrix
chrome beacon
#

^

gaunt sonnet
#

Does anyone know anything about custom tecturepacks? I can't get the server to load it

ionic dagger
#

so a 1.16.5 plugin would work on a 1.20 server?

zealous osprey
# rotund ravine Imagine being efficient

Well, if you have 384 * 16 * 16 = 98.304 things to store... maybe even multiple of them at the same time... yeah.
It would be 98.304 * 5 ~= 500k bits, ie 500 kBits, 62kB.
Actually... that's nothing XD

pine sandal
#

^ I would disagree, I have had to update my plugin almost every update because of issues with the chest intrerface changing.

gaunt sonnet
#

Does anyone know anything about custom tecturepacks? I can't get the server to load it

lost matrix
ionic dagger
#

whats nms

chrome beacon
#

net minecraft server, it refers to Mojangs code which isn't part of the Spigot API

ionic dagger
#

oh cool

#

thank you

pine sandal
#

Still have to update my addon for 1.20 (I am a bit lazy) since the scheduler changes between 1.18 and 1.20 (didn't update for 1.19) seem to have broken it.

lost matrix
young knoll
#

scheduler changes?

pine sandal
#

Yea, I was using the older scheduler system back when I wrote it in 1.17 somehow it stopped working properly in 1.20. (Or something with Item lore changed not 100% sure.)

zealous osprey
young knoll
#

I don't think we changed anything with the scheduler

pine sandal
#

Well I know it got a new interface to scheduling stuff thru

lost matrix
young knoll
#

no?

gaunt sonnet
wet breach
young knoll
#

Ah

#

Yeah probably

lost matrix
#

Hm, nah not today. Tinkering with resourcepacks is kinda boring.

gaunt sonnet
chrome beacon
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

pine sandal
#

This was Craftbukkit, I have been using scheduleSyncRepeatingTask got all this new BukkitTask stuff that got added sometime after I originally wrote my plugin. Probably the Item Lore related stuff that broke tho.

ionic dagger
#

trying to make a 1.17 plugin with java16, but intellij wont let me select java16 it unless i go 8.2.0-SNAPSHOT or earlier. is this okay?

wet breach
#

because BukkitTasks have been around for a long time

chrome beacon
#

^^

lost matrix
pine sandal
#

Well I wrote this in 1.17 when you had to use just a Runnable.

chrome beacon
#

That hasn't changed

wet breach
#

1.17 had BukkitTasks

lost matrix
#

Both BukkitRunnable and java Runnable could be used for ages when scheduling tasks

lost matrix
golden turret
#

I have this. What would be a name for the opposite of it?

crimson blaze
#

hi guys
someone can help me with the animation?
with the plugin tab?
i want to do animation with the name too
but i do only the role
how i do with the name?

chrome beacon
#

Spamming that in every channel isn't going to get you an answer faster

river oracle
#

I hear it makes people want to help you less

analog wave
#

Can you tell me the name of someone who is suitable for 1.16.5? I want it to say 'that bitch mentioned you' on the screen when I write the name of someone suitable for 1.16.5.

quaint mantle
chrome beacon
analog wave
#

Ok

quaint mantle
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

analog wave
#

?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 usernames, global display names, and server...
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.

upper hazel
#

i can get data from dataContainer in item in another plugin?

#

i was try but

#

this return null

chrome beacon
#

You should be able to do that

#

Show your code

#

?paste

undone axleBOT
upper hazel
eternal night
#

NamespacedKey.fromString("pickaxe") ?

upper hazel
#

oh this not correct?

remote swallow
#

you need the plugins name or id too

eternal night
#

Well, you should think of a common namespace yea

remote swallow
#

pluginname:pickaxe

eternal night
#

^

remote swallow
#

or as lynx said use a common namespace that would relate to both

upper hazel
#

wdym

#

i always need register kay in plugin for use

#

how do this common

remote swallow
#

if you have a item plugin you could make them both have the parent key as xyzitems

remote swallow
upper hazel
#

ok

#

i will try

rotund ravine
#

?selfrole

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?selfrole <selfrole>
Add or remove a selfrole from yourself.

Server admins must have configured the role as user settable.
NOTE: The role is case sensitive!

**__Subcommands:__**

list Lists all available selfroles.

onyx fjord
#

Problem with gradle submodule as used dependency by other module

left pine
#

Hello, I have a question, how can I put and establish an item with a .yml file?

fair gate
#

Store the item in the config and then use getItemStack(path) to retrieve it

#

hi I'm working on a plugin that adds souls to the game. Souls can have different types that are registered using Souls.registerSoulType(SoulType soulType) e.g. if I have created LostSoulType then I can use Souls.registerSoulType(new LostSoulType()), and these types can be retrieved using Souls.getSoulTypes().
SoulType is an interface with some methods like spawn(Player) or getSkinData().

Now the problem is that for any soul, I want to get a different instance for each player that I spawn it for. Now this is not possible using my implementation because I will have to change SoulType to Class<SoulType> and then instantiate that class using reflection, which is not ideal.

I can think of one solution, but I'm not sure if it's ideal; I can create a two interfaces called SoulType and SoulEntity. Then I can make SoulType#spawn(Player player) return a SoulEntity, which can be used as the "soul instance" I mentioned earlier.

So my question is very basic; Is there a better approach to doing this?

left pine
fair gate
quaint mantle
#

Or you can use just ConfigurationSection#set(key, itemstack) ConfigurationSection#getItemStack(key)

fair gate
quaint mantle
#

Basically converts item stack to binary and serialize it to a string

fair gate
#

Huh!

chrome beacon
fair gate
rotund ravine
#

Well

#

It’s an easy way to convert it to a string which can be stored most places

#

Obviously you could also store it as binary if ur storage solution allows that

left pine
rotund ravine
#

I mostly use base64 when i don’t want the user to edit the item after it has been saved

quaint mantle
#

base64 for just storing

fair gate
#

How to store using base 64?

rotund ravine
#

Do you need it?

quaint mantle
#

Google: "How to convert itemstack to base64 string spigot"

slender elbow
#

you can store an ItemStack as-is in bukkit configuration

rotund ravine
worldly ingot
remote swallow
#

im not saying to avoid deprecation but to make the key from a common parent, so instead of using chocobot:yes then having to use the plugin name you use staffbots:yes

worldly ingot
#

NamespacedKeys are ideally plugin namespaced

remote swallow
#

but what if 2 plugins need to access them

rotund ravine
#

Why

remote swallow
#

idfk

worldly ingot
#

Yeah I'm not sure how that matters :p

remote swallow
#

yeah probably true

rotund ravine
#

Plugin1 - API
Plguin2 - uses API

#

If they both need them, they’re probably doing smth along the same lines and it’d be annoying to repeat in plugin 2 so just have plugin 1 expose some methods for use

left pine
remote swallow
#

store that data from the key

rotund ravine
#

You can save them under the same key’ish, like item.slot and item.data. It’s a bit hard to say without seeing exactly what ur trying to make

remote swallow
#

if its invs could also do something like invtype.slotnum

quaint mantle
rotund ravine
#

Sure

fair gate
rotund ravine
#

Ladt part sounds fine

pine sandal
#

Is it bad that I want to write an addon that lets you place chunkloaders that run on fuel xD

rotund ravine
#

No

#

Seems fine

pine sandal
#

Sounds easy to write as well.

quaint mantle
scenic onyx
#

how i can add a tnt in head (visible) of player like tnt tag

rotund ravine
scenic onyx
rotund ravine
#

Quite literally what i said

golden turret
#

how would be a good way to use the same CompletableFuture if I am trying to access the database 2 times with the same key?

rotund ravine
#

?xy

undone axleBOT
scenic onyx
#

so?

rotund ravine
scenic onyx
rotund ravine
#

Yes

scenic onyx
#

ah ok

#

tnx

golden turret
rotund ravine
#

No

quaint mantle
#

Nope you do 2 tasks

rotund ravine
#

Please think of another proper reason.

#

Just cache the result if it does not change

hazy parrot
#

Cf is instance of task that will be finished in future (or is finished) , it can't be "reinitiated"

golden turret
#

I need to use the same CompletableFuture because I have a code that is fetching the database with the same key 2 times with a small delay between it

#

and it is creating 2 objects

rotund ravine
#

Caching

#

Is a thing

scenic onyx
#

how i can remove item on helmet, this go?

#

or give error

rotund ravine
#

Sure

quaint mantle
#

You need to cache it yourself.

rotund ravine
#

This is really an xy problem, you think ur solution is the correct one and is trying to figure out how to do it. Whilst we’re telling you it’s not.

wet breach
#

with mysql's cache function, no matter how many things that need it, it is basically instantly available without doing a requery on that end

rotund ravine
#

That’s cheating

wet breach
#

lol

naive loom
#

Is there an event for when a player receives an item in their inventory?

#

By any means*

tall dragon
#

no

shadow night
#

I once made one

rotund ravine
#

There’s a few

tall dragon
#

theres a few events you would need to listen for yea

rotund ravine
#

But

#

Like other plugins adding stuff etc

#

No

shadow night
#

I made an universal one

#

It listened to all the pickup kinda events

naive loom
#

you'd only need to listen to pickup events, and inventory move events right?

vocal cloud
#

Gotta make an external lib called XtraEvents or something lol. Add a tonne of useless stuff

shadow night
#

I can send you one of my own events

south mason
#

How can I run a website on Spring from a plugin in Minecraft

wet breach
pine sandal
#

You would probably need to start up a new thread on the server I to run your Spring webserver (no idea how to use spring, only touched it once for a class in college like 5 years ago)

lost matrix
subtle folio
#

spring boot and a spigot plugin in the same project !!?

#

i’ve seen it all now

acoustic stag
#

i want to save banner color & pattern to json but my code doesn't work:

Gson gson = new GsonBuilder()
            .setPrettyPrinting()
            .excludeFieldsWithoutExposeAnnotation()
            .registerTypeAdapter(Banner.class, new BannerSerializer())
            .create();
private void saveFlags() {
    Bukkit.getLogger().info("saving flags");
    String flagsJson = gson.toJson(flags); // HashMap<String, Banner> String is banner's faction
    try {
        File file = new File(getDataFolder().getAbsolutePath() + "/flags.json");
        if (!file.getParentFile().exists())
            file.getParentFile().mkdirs();
        if (!file.exists())
            file.createNewFile();
        FileWriter fileWriter = new FileWriter(file);
        fileWriter.write(flagsJson);
        fileWriter.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
import com.google.gson.*;
import org.bukkit.Bukkit;
import org.bukkit.block.Banner;
import org.bukkit.block.banner.Pattern;

import java.lang.reflect.Type;

public class BannerSerializer implements JsonSerializer<Banner> {
    @Override
    public JsonElement serialize(Banner banner, Type type, JsonSerializationContext jsonSerializationContext) {
        Bukkit.getLogger().info("serializing banner");
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("color", banner.getBaseColor().name());
        JsonArray jsonPatterns = new JsonArray();
        for (Pattern i : banner.getPatterns()) {
            jsonPatterns.add((JsonElement) i.serialize());
        }
        jsonObject.add("patterns", jsonPatterns);
        return jsonObject;
    }
}

the serializer never gets called. how can i save the banners to json? or is there a simpler way? (i'm new to plugin development and java in general)

rotund ravine
#

Why to json?

acoustic stag
#

i want to save the banner patterns for each faction, json seemed like a good solution

chrome beacon
#

Could just use yaml

#

?configs

undone axleBOT
acoustic stag
#

ok i'll try yaml, thanks

hexed crown
#

Weird question. So I got this mc server that has the server resource pack built into the mc client so when you connect to the server it doesn't take time to apply it and load. Does anyone know by chance how to set that up?

chrome beacon
#

That would just be the regular way to do resource packs

#

The client caches the server resourcepacks so as long as you provide the correct hash it won't redownload it

#

It would ofc need to apply and load

hexed crown
#

That's the part I am referring to, they have it set up so it is always applied to your client

chrome beacon
#

If you want to avoid apply and load then you need to tell the users to download the resource pack and apply it themselves

#

or make a mod that forcibly loads it

slate tinsel
#

What should I do to shoot an arrow with the real force of the arrow wave because the one I'm picking up right now feels like it's lower because the arrow doesn't go as far as a regular bow

chrome beacon
#

or use the one without a vector

#

If the one without a vector doesn't match the speed you want then you can always capture the velocity vector of an arrow and use that

slate tinsel
#

okey 🙂

hexed crown
chrome beacon
#

That would require your users to download a mod

hexed crown
#

That's fine I plan to make a modpack for the server

chrome beacon
#

Then you could just put the resource pack directly in to the resource pack folder

slender elbow
#

isn't that what the hash is for?

hexed crown
#

I tried putting it in the resource pack folder but it still applies the server resource pack and gives you that loading screen

chrome beacon
shadow night
#

you can't just replace 2k texture in a few miliseconds

slender elbow
#

sure

chrome beacon
hexed crown
#

This is the example I mean, I'm currently in the main menu and the server resouce pack is applied

hushed spindle
#

shot in the dark but does anyone happen to know the velocity function applied on an item when its fished up out of the water

chrome beacon
#

Taken from 1.20.1 Mojmapped

hushed spindle
#

oh sick thanks man

chrome beacon
#

"this" would refer to the Hook

short shale
#

Does anyone know the cause of this error in NMS versions above 1.17?

#

it's not just with the package net.minecraft.EnumChatFormat.

sterile token
chrome beacon
short shale
#

how can i fix it?

chrome beacon
#

Update your imports

hushed spindle
#

or is g used elsewhere

chrome beacon
#

it's not

#

probably a decompiler artifact

chrome beacon
#

?nms

crimson blaze
#

hi guys
someone can help me with the animation?
with the plugin tab?
i want to do animation with the name too
but i do only the role
how i do with the name?

chrome beacon
#

Again this is not the correct channel

shadow night
#

what

shadow night
chrome beacon
#

Yeah

grim hound
#

Is there a way to monitor all of the packets the server sends?

shadow night
chrome beacon
short shale
chrome beacon
grim hound
#

and I need to monitor all

shadow night
#

nms?

grim hound
shadow night
#

does nms even allow that

grim hound
chrome beacon
#

Just save yourself the trouble and use PacketEvents or ProtocolLib

grim hound
chrome beacon
#

There's no need to reinvent the wheel

chrome beacon
#

Why not

grim hound
#

I have my reasons

shadow night
#

interesting reasons you got

grim hound
#

If they can do it

#

that so can I

chrome beacon
#

You can ofc