#help-development

1 messages · Page 950 of 1

grave vigil
#

It hurts the server when there are a lot of NBT items in the chest

tall dragon
#

u have got to be kidding me right?

#

did u read any of the thread i just sent?

vast ledge
rapid vigil
vast ledge
tall dragon
#

if u do it right. they are fine

vast ledge
#

Let everybody use there way

vital void
#

My point is there is more then one way to do something

vast ledge
#

Ain't yo problem

vital void
#

Dosent mean the other persons way is bad or wrong

grave vigil
tall dragon
#

yes it is bad

#

lmfao

vast ledge
#

I do agree with Shurikennnen tho, using the name is objectively bad

grave vigil
#

I think people should generally write scalable code, but beginners should be given the benefit of the doubt. I mentioned to him that there is a better way of doing it for that reason. If I was a beginner here, I would feel pretty overwhelmed.

vast ledge
#

Just make an arra or smth with the inventories in them

#

Array*

grave kayak
#

hello. how would I go about making a 1.20 plugin ive made compatable with 1.16 pixelmon ?

vast ledge
agile anvil
#

Pixelmon is a mod, not a plugin right?

vast ledge
#

I was boutta say

grave vigil
grave vigil
#

if you made the plugin, you should be able to rewrite it in 1.16

#

or just convert it

agile anvil
#

Doesn't even need to convert

#

Unless you use nms hardcoded

grave kayak
#

there is no hardcoded nms, its just a simple commands plugin

agile anvil
#

Then it is compatible

grave vigil
#

^

tall dragon
grave vigil
tall dragon
#

sure. yet again in my opinion you should know the languages fundementals before you dive into a library.

grave vigil
tall dragon
#

imagine going to an english comedy show before you know english

#

doesnt make much sense does it?

#

and i didnt say full understanding. i said fundementals

grave vigil
#

Honestly it's both

#

Even with a basic understanding of java, if spigot's your first library, you will still be a bit confused at some of the stuff. If someone doesn't know how to cancel inventory events, it's safe to assume they are fairly new to it. Therefore, give a simple solution, and inform them that there are better ways of doing it.

vast ledge
#

And why exactly are you fighting about this?

grave vigil
tall dragon
#

yea i dont think its fighting at all. we both just have a different perspective

#

and thats fine

grave vigil
#

mhm

vast ledge
#

That's true, while I agree with you on that you don't need to know alot of Java, everybody should have a base understanding before jumping into something like a library/api

grave vigil
#

at the end of the day we both gave the anwers we believed were correct, and that's the utility of support discords; he was given two different perspectives

agile anvil
#

This channel is for plugin development, please ask in #help-server

compact solstice
#

oh sorry

worthy star
#

hi, i have this code but for some reason it doesn't register the command

        List<CommandData> commands = new ArrayList<>();

        commands.add(Commands.slash("suggestions", "Post suggestions embed")
                .addOption(OptionType.CHANNEL, "channel", "The channel for the embed", true));

        event.getGuild().updateCommands().addCommands(commands).queue();```
#

i have the class registered but it doesn't work

#

no console errors

wet breach
#

You are correct there is a point you need to just make it and not fuss over some things but this does not excuse not learning the basics

worthy star
rapid vigil
#

just use a command library like ACF

tall dragon
worthy star
#

im using jda

tall dragon
#

not spigot

worthy star
#

i couldn't find a server for jda helping

rapid vigil
worthy star
#

help :)

tall dragon
#

well they defo have one

rapid vigil
#

lol i was gonna say

tall dragon
#

same lmfao

worthy star
#

thx

outer tendon
#

Would anyone be able to help me answer these questios? If so, I would appreciate it.

agile anvil
#

Can you do a short summary of the previous messages ? ><

#

I guess you're trying to make a Game, and multiple game features require a timer with different update frequencies?

sterile sapphire
#

My Minecraft Server keeps shutting down for no reason so I looked in the logs and this is what I found.

#

[23:37:35] [ServerMain/WARN]: COM exception querying Win32_Processor, which might not be on your system. Will not attempt to query it again. Error was -2147023781: A system shutdown is in progress.(HRESULT: 8007045b)

agile anvil
#

Is this the only line of error?

#

Can you please share the exact version of your build?

sterile sapphire
#

I have only just realised

agile anvil
#

Please share the logs

sterile sapphire
#
[23:37:35] [ServerMain/WARN]: COM exception querying Win32_Processor, which might not be on your system. Will not attempt to query it again. Error was -2147023781: A system shutdown is in progress.(HRESULT: 8007045b)
[23:37:35] [ServerMain/WARN]: COM exception querying Win32_VideoController, which might not be on your system. Will not attempt to query it again. Error was -2147023781: A system shutdown is in progress.(HRESULT: 8007045b)
[23:37:35] [ServerMain/WARN]: COM exception querying Win32_PhysicalMemory, which might not be on your system. Will not attempt to query it again. Error was -2147023781: A system shutdown is in progress.(HRESULT: 8007045b) ```
#

That’s the whole log

steel dirge
rapid vigil
#

since youre not developing a plugin

sterile sapphire
#

Oh okay sorry

#

I’ll take it there now

wind blaze
#

Does anyone know if it’s possible to add new mobs and items to old versions of Minecraft through mods

steel dirge
#

anything is possible with mods

wind blaze
#

Would it be was or very difficult tho. Since you would have to remodel everything etc. or is there a way to just copy in newer versions code etc somehow

worthy star
#

hi, why when i update my config.yml from the code it doesn't update in the plugin folder, i'll have to delete the folder then start server so it creates it again to update it

#

how can i fix that

wind blaze
shadow night
shadow night
worthy star
shadow night
worthy star
#

i want it to add the edits auto without deleting the plugin folder

steel dirge
#

edits as in... overriding the values there already? or adding values that dont exist in the config in the plugin folder

worthy star
#

adding values don't exist

steel dirge
#
if(!config.contains("foo.bar")){
    config.set("foo.bar", true);
    saveConfig();
}
worthy star
#

is there another way so i don't have to hardcode each one

steel dirge
#

you can compare each value in ur resource file in the plugin jar

shadow night
#

I have an idea on how this could be done, but I'm too lazy to explain

worthy star
#

:|

sand spire
#

Is it possible to give a block any blast resistance? or will this at least be possible in 1.21

keen valve
#

It gives the effects even if there is no block underneath however the messages are not and so I don't understand how to solve the control to have the effects only when there is the gold block underneath

shadow night
# shadow night I have an idea on how this could be done, but I'm too lazy to explain

Basically, you just save your current config to a Map<String, Object>, then delete the config, save the new default config, loop through all the values in the new config and if they exist in the old Map<String, Object>, set them to whatever it was. And to make sure you don't do this every server start, add a config-version field to your config to check whether the existing config is older than the one in jar. Dunno how good this is, but I would do it like that

steel dirge
sand spire
#

so it's not possible, thanks

steel dirge
#

it sure is

sand spire
#

I'm not looking to make a block indestructable, I'm specifically trying to give a block functionality of another block

sand spire
#

Would I also be able to give any block an inventory that works with a hopper underneath it using NMS?

steel dirge
#

can do that with the api

#

no nms needed with that

sand spire
#

oh cool I thought I had to wait for components update

#

how would i even do this tho

steel dirge
#

just use interact event, get block that clicked, block face down = hopper

#

open a inventory

sand spire
#

yeah i got that, how would I make the hopper suck the items out without having to update the inventory all the time cause the hopper already does it

steel dirge
#

hm, i think you would get the inventory of the hooper and add items to it and remove them from ur inventory

#

get the blockstate of the block (hopper) and cast it to Hopper

#

iirc u can call hopper.getInventory

sand spire
#

oh yeah I tried somethign like that but i got 100 dupes but I guess I gotta try harder if I can't just make a hopper take blocks and handle the updating from a custom inventory

#

but thanks for helping

lost matrix
steel dirge
#

i dont think that will work with custom inventories

sand spire
#

maybe this

#

thanks smile

steel dirge
#

since the inv isnt assigned to an emerald block or something lol

#

never mind!

lost matrix
#

Not 100% sure if this is fired when the hopper has no BlockInventoryHolders nearby in the first place.
But worth a try.

steel dirge
#

smile, ever work with protocollib?

lost matrix
#

Sure

steel dirge
#

any idea how i can assign a vector to a data watcher 💀

#

iv been going at it for 2 hours now xD

lost matrix
#

data watchers are old. They dont exist anymore.

steel dirge
#

even smth like this?

PacketContainer metaData = Holograms.plugin.protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
        metaData.getIntegers().write(0, entityId);

        List<WrappedDataValue> dataValues = List.of(
                // new WrappedDataValue(8, WrappedDataWatcher.Registry.get(Integer.class), 1),
                // new WrappedDataValue(9, WrappedDataWatcher.Registry.get(Integer.class), 1),
                // new WrappedDataValue(10, WrappedDataWatcher.Registry.get(Integer.class), 1),
                new WrappedDataValue(13, WrappedDataWatcher.Registry.getVectorSerializer(), new Vector3F(2,2,2)),
                new WrappedDataValue(15, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0),
                new WrappedDataValue(23, WrappedDataWatcher.Registry.getChatComponentSerializer(), WrappedChatComponent.fromText("test").getHandle())
        );

        metaData.getDataValueCollectionModifier().write(0, dataValues);

        Holograms.plugin.protocolManager.sendServerPacket(p, metaData);
lost matrix
#

No this is the up to date approach

steel dirge
#

getting a class cast exception however

lost matrix
#

Show it

#

brb

outer tendon
steel dirge
#

i even tried minecrafts vector class

#

standby

#
Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class com.comphenix.protocol.wrappers.Vector3F cannot be cast to class net.minecraft.core.Vector3f (com.comphenix.protocol.wrappers.Vector3F is in unnamed module of loader 'ProtocolLib.jar' @55bb4665; net.minecraft.core.Vector3f is in unnamed module of loader java.net.URLClassLoader @25f38edc)
lost matrix
steel dirge
#

ok this work, thank you

#

however the second i apply the scale (index 12) it just doesnt even show it

#

ill tweak around with it. thx tho

#

text display's ^^^

worthy star
#

whats the most effiecent way to fix placeholders of plugin? like
%placeholder% gets replaced with [value]

#

this but better

lost matrix
#

Do you want to do it yourself or use PlaceholderAPI for it?

worthy star
#

myself

#

my own placeholders for the plugin

lilac dagger
#

pick up all the placeholders

#

that is if you want to do it yourself

quaint mantle
#

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class MenuListener implements Listener {

    @EventHandler
    public void onClick(InventoryClickEvent e) {

       if (ChatColor.translateAlternateColorCodes('&', e.getView().getTitle()).equals(ChatColor.GOLD.toString() + ChatColor.BOLD + "Bet Area")
            && e.getCurrentItem() != null) {
           e.setCancelled(true);
           Player player = (Player) e.getWhoClicked();

           switch(e.getRawSlot()) {
               case 0:
                  break;
               case 34: // opens new gui

                   break;
               default:
                   return;

           }
           player.closeInventory();

       }




    }

}```
so i've made this code but for some reason the blocks in gui still are moveable can someone help me and sorry i was told to ask here hope its the right place
lost matrix
# worthy star myself

You represent the String you want to replace values in as a char[] and iterate it.
Create a new StringBuilder and append your characters one by one to it.
When you hit your placeholder token '%' then you start buffering everything that comes after it untill you hit another placeholder token '%'.
During this buffering your obvsly dont add the tokens and buffered characters to your StringBuilder.
The buffer is now your key, which can be looked up in a map.
The map contains Strings as keys and Function<Player, String> as values.
Alternatively you might also create your own interface instead of using Function.

steel dirge
hybrid turret
#

Is there a good tutorial on how to use NMS for game profiles and npcs?

lilac dagger
quaint mantle
steel dirge
#

check if the clicked inventory is the inventory object of the inventory you created

quaint mantle
#

ohhh okie

steel dirge
quaint mantle
#

alright thanks and another thing i couldn't find much about it but how can i make it so when i press the item it changes the gui i couldn't find much about it

steel dirge
#

u can either open another gui or reset the items

quaint mantle
#

how is that possible to open another one?

steel dirge
#

p.openInventory

quaint mantle
#

is there a tutorial you know of somewhere that can give me examples

steel dirge
#

that link i sent ya

drowsy helm
#

7smile7 has a good one iirc

quaint mantle
#

ohh the link right

steel dirge
hybrid turret
#

idek why, maybe i should just restart with implementing it lol

quaint mantle
#

oh thanks guys ^^

steel dirge
#

Np!

quaint mantle
#

i'll def make sure to ask when i need help

outer tendon
#

Is 7 still here?

hybrid turret
#

Oh right, one thing: i currently have my server inside my project folder.
I plan on making the plugin open source eventually tho.

I know there are some copyright problems with having servers on github, does this only refer to the .jar file needed to run the server?

lost matrix
#

Yes

hybrid turret
#

bc then i'll just .gitignore it

lost matrix
steel dirge
#

was gonna say, the wiki one is nice and simple

lost matrix
#

@ivory sleet stop changing your name. I almost thought this was you.

ivory sleet
#

lmao

#

but it was just aprils fools thingy thing :P

hybrid turret
#

i like your discord name 7, lmao

lost matrix
#

squint Kraut spotted

hybrid turret
#

uhmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

#

maybe

lost matrix
#

Anyways im out. I should be studying. Apparently i forgot how bayes theorem works PES2_SadGeRain

quaint mantle
#

well anyone here know well about economy plugin making?

steel dirge
#

can use the vaultAPI

#

lemme link

#

has some examples in there

quaint mantle
#

well i kinda made one but it doesn't seem to be able to see or make an account

#

for the player

steel dirge
#

using essentials? or trying to fully make ur own?

quaint mantle
#

actually my own i want to push myself to understand you know

#

should i send screenshots?

steel dirge
#

im gonna goto work but im sure the ppls here will help you

outer tendon
#

Oh I missed 7 again XD

ivory sleet
quaint mantle
#

well let me show you what i got so far

steel dirge
#

Kangarko made a decent video ab it

ivory sleet
#

well thats just vault but yea

quaint mantle
#

yeah followed him but had to like constantly update the code

steel dirge
#

id say make a test command in ur plugin. keep adding to it

#

tab complete all that

quaint mantle
#

well nvm i can't send screenshots

steel dirge
#

keep adding onto stuff that u have already

ivory sleet
#

I mean the basic problem is that u just encapsulate a double/long/BigDecimal/BigInteger per player

#

and then save and load that adequately

quaint mantle
#

well the issue is right now it says there is no account for the player

#

even though i watched the video a thousand times i am unsure what i did wrong

steel dirge
#

i never used vault. made my own so i cant tell ya what part of the api "makes a player account"

#

anyways work time adios!

quaint mantle
#

cya

ivory sleet
#

well for starters vault is just a middleman

#

but ye cya

quaint mantle
#

well idk if i can send it all of it as code should i?

hybrid turret
maiden olive
#

is it possible to send text to a users action bar in the bungee api

#

or would i need to send packets

ivory sleet
#

Well you can send action bar messages w Player.Spigot interface from spigot, which uses the bungee chat api if thats what you mean?

maiden olive
#

no like bungee pluhin

ivory sleet
#

Yea that should be possible

blazing ocean
#

paper does have it though

ivory sleet
#

ProxiedPlayer @maiden olive has that method iirc

sand spire
ivory sleet
#

I mean spigots way is just Player#spigot()#sendMessage()

blazing ocean
#

there's no Player#sendActionbar i thought

ivory sleet
#

Oh yeah

young knoll
#

Yeah idk why we never got a string version

#

¯_(ツ)_/¯

pliant topaz
#

So, I got this code:

        if (hasToolAbility(localizedName)) {
            List<ToolAbilities> toolAbilities = getTool(localizedName).getToolAbilities();
            for (ToolAbilities toolAbility : toolAbilities) {
                switch (toolAbility) {
                    case NONE:
                        player.sendMessage("[DEBUG] Broke block with tool (ability.none)");
                    case DEBUG:
                        player.sendMessage("[DEBUG] Broke block with tool (ability.debug)");
                }
            }
        }
    }```
Basically, everything functions, except for one thing, and that's going over all abilities the tool has. Even when the tool only has the ability 'DEBUG' (getToolAbilities also only returns ability 'DEBUG') the case 'NONE' still gets executed.
Anyone knows why this might happen?
maiden olive
#

thanks

tall dragon
young knoll
#

Today we learn about fall through

pliant topaz
#

totally overlooked that, thx guys 😂

#

had 3 other members of our team look at it and we all missed it i guess xd

hybrid turret
#

is it possible to simulate a player being on the server using nms?

scarlet gate
#

Is there a method to get the plugin folder as a File?

hybrid turret
#

JavaPlugin#getDataFolder

#

is what you mean, i'm guessing

scarlet gate
#

Sorry I was meaning the /plugins folder as opposed to the plugin specific folder

#

For context, I am trying to get the update folder but Bukkit#getUpdateFolder only gets the name of the folder itself

shadow night
hybrid turret
#

Well that would work in the same way then, no? I haven't tested that yet but you could do that using:

File pluginsFolder = new File(plugin.getDataFolder().getParent())

scarlet gate
#

Yeahh that's what I am currently doing

#

Just wanted to check whether there was a method I had overlooked

hybrid turret
#

LOL

blazing ocean
hybrid turret
hybrid turret
blazing ocean
#

probably not

hybrid turret
#

Sadge

blazing ocean
#

?xy

undone axleBOT
hybrid turret
#

fair enough.
my idea was to be able to test stuff that needs a player from the console in the case i'm at a machine without having minecraft installed/which it would be... unwise to install minecraft on

blazing ocean
#

nope

#

carpetmod

hybrid turret
#

tf is carpetmod

blazing ocean
#

fabric mod that can do that

#

it is fabric tho lol

hybrid turret
#

ah i get it

#

yeah no i won't be mixing spigot and mods. i had funky stuff happen when i made a spigot+modded server lmao

blazing ocean
#

yeah no don't do that

hybrid turret
#

lolll

#

but hey, i finally found out how to make use of game profiles so maybe i can finally finish my /nick command

#

ooooh, i should also be able to change the skin with that, no?

#

btw how exactly does the use of nms work for the end user?

is it no different from a non-nms plugin? since you have to like install the remapped server jar and stuff?

shadow night
#

no, the plugin should get obfuscated automatically if you setup everything correctly

tall dragon
#

when you compile it compiles it back to the obfuscated version

#

the only downside is that your code is depending a specific vesion

#

so either u need to make implementations for multiple versions or it will only work on the one version

shadow night
#

in some cases you can use reflection to make it multi-version compatible tho

tall dragon
#

ew reflection

shadow night
#

if it works ¯_(ツ)_/¯

valid basin
#

Guys I'm creating a horror game and I'm curious if it's possible to create screen shake effects and fog and a biome that's scary and dark af?

#

for 1.20.4

lost matrix
#

Sounds like you need core shaders for this

upper hazel
#

is it possible to listen for exceptions and collect them as statistics?

#

like matrix

vast ledge
#

Why would you?

upper hazel
#

for support etc

#

for what stats need use lol

vast ledge
#

And unless there your exceptions I don't think so

#

You can only catch them if you're running the code, then surround the throwing thing with try catch

upper hazel
#

this all?

#

I mean an exception that was not created by me

#

like java exeptions

vast ledge
#

You can catch those

upper hazel
#

but idk were this can be

vast ledge
#

If you're the one making them happens with your code

#

You can't catch exceptions from other plugins if that's what you're asking

upper hazel
#

I mean why would I do this when I can listen

vast ledge
#

How?

upper hazel
vast ledge
#

Afaik exceptions don't fire events

vast ledge
upper hazel
#

I wanted to make some kind of logs with errors, but service logs remotely

vast ledge
#

You can read the latest.log file, and upload the stacktraces to a DB, and add the timestamp thrown?

real ridge
#

Hello!! I am trying to compile someone elses code, and it cant find a lot of minecraft packages, and IDK how to add it. Compiling gives me cannot find symbol Any help is greatly appreceated

native gale
#

Does getPluginManager().getPlugin(this).disable() unload the plugin from memory completely?

real ridge
#
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.ChatFormatting;
``` cannot be found
chrome beacon
real ridge
lilac dagger
chrome beacon
#

(with remapping on if required)

real ridge
lilac dagger
#

?nms

chrome beacon
#

What version of nms does that plugin require

native gale
#

Okay, my problem: the plugin only does something on startup and then just wastes memory while doing absolutely nothing till the server restarts

native gale
#

I think I can probably optimize it by unloading it as soon as it is not needed

lilac dagger
#

a plugin that's empty doesn't consume much

chrome beacon
lilac dagger
#

unless it does more than the startup part

native gale
#

It actually allocates quite a much of memory while doing this startup thing, and I clean it via assigning all objects to null and make the garbage collector deal with it

chrome beacon
#

then it's fine

native gale
#

But I just had suspision that Spigot might have some build in way to unload the plugin

lilac dagger
#

it's nothing special ^

#

just clean up the plugin properly and let the garbage collector do its thing

tardy delta
#

im still wondering why the byte buf is friendly

#

like its not gonna hurt me?

clear elm
#

how can i do that if i click on an slot at my gui the guis closes and the chat opens i have to write smth in the chat wehen i wrote it the gui opens with the lore of the message

#

like at the excelent crates plugin if you know it

lilac dagger
chrome beacon
lilac dagger
#

send message to look in chat

#

and have a hashmap or something to mark the player so the next message he says will be handled by you

clear elm
#

okay ty

young knoll
#

Conversation API

valid basin
clear elm
#

whats the event when some1 send a message

lilac dagger
#

conversation api or via normal message?

young knoll
#

You can do a custom biome

clear elm
#

public void onmessage()

lilac dagger
#

if it's via normal message it's AsyncPlayerChatEvent

clear elm
young knoll
#

I think you can maybe change the fog distance by gaslighting the client about the render distance

lilac dagger
#

if you plan to modify something you might wanna use bukkit get scheduler runtask

clear elm
#

i have another question. i have this variabel how can i change it from other classes:


public class PublicVariablen {
    public static Boolean title;

    public static Boolean getTitle(){
        return title;
    }
}
valid basin
young knoll
#

yeah

valid basin
#

how tho

#

sky change packet?

young knoll
#

Hack the biome registry, insert a custom biome, set the area to that biome

lilac dagger
clear elm
#

what i have to use

chrome beacon
#

not static

clear elm
#

yes but what instat of static

valid basin
tall dragon
young knoll
#

Set it before they join

chrome beacon
young knoll
#

Or just use the fancy new packet for it

lilac dagger
#

learn the following: getter and setters, objects, method/constructor injection

lilac dagger
clear elm
lilac dagger
#

yeah

chrome beacon
#

and use boolean instead of Boolean

lilac dagger
#

and then have this somewhere in your main class

chrome beacon
#

or do you really need it to be nullable

lilac dagger
#

new publicVariablen();

#

and a setter

#

or if you don't need it in your main class have it in the needed common class

clear elm
#

i dont understand i have a normal class now:


public class PublicVariablen {
    public boolean title;

    public boolean getTitle(){
        return title;
    }
}

and want to change it from other classes the variable title how can i do it

#

im very new so sorry for the many questions

lilac dagger
#

public void setTitle(boolean title) {
this.title = title;
}

clear elm
#

okay

hybrid turret
full cargo
#

is there a reverse of Material.matchMaterial()? like to get the value that would be passed to matchMaterial from a material

tall dragon
#

Material#name()

#

would probably do

full cargo
#

thanks

tall dragon
#

not sure what exactly you dont understand about that

chrome beacon
#

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

tall dragon
#

if you go to the github repo the code will show it.

hybrid turret
#

that makes a lot of sense

#

thank you :D

#

why tf does InventoryOpenEvent#getPlayer return HumanEntity? lmaoooo

tall dragon
#

no idea

#

im fairly certain its always a Player so u can safely cast that

hybrid turret
#

yeah, i figured

#

What is the difference anyway?

#

What is a HumanEntity when it's NOT a Player?

tardy delta
#

npc?

tall dragon
#

;dddd

hybrid turret
#

wait

#

that means it's basically the same thing?

hybrid turret
tall dragon
#

pretty sure it could technically be an npc as well

#

but those arent ever gonna click in a menu

#

its documented as such at least

hybrid turret
#

i haven't done anything with npcs yet so idk but i thought of that

#

oh

#

okay LOL

#

i should learn to read

#

lmao

#

AnimalTamer as well, are there other things but players that can tame animals? lol

tall dragon
#

Yea HumanEntities, OfflinePlayer, Player

#

;D

full cargo
#

how would i store all item data (enchantments, name, lore, etc) into a string or something that can be stored in SQL and put back into an item later?

red trout
#

Hello Chat! I'm looking for an event that detects right-clicking on an interaction block. Does anyone know anything?

rapid vigil
#

you mean when a player right clicks on a block?

red trout
#

yea

chrome beacon
#

PlayerInteractEvent

rapid vigil
#

yea the action is RIGHT_CLICK_BLOCK

red trout
rapid vigil
#

whats your code

red trout
#
@EventHandler
fun onInteractionEvent(event: PlayerInteractEvent) {
    println(event)
}
chrome beacon
#

Did you forget to register the listener

rapid vigil
#

lol

red trout
#

wait i post you with video

#

here

#

this is try video

#

It detects hitting, but strangely it doesn't detect right-clicking.

chrome beacon
#

You're right clicking the entity not a block

#

You should use the PlayerInteractAtEntityEvent

red trout
#

oh i see

#

let's try this

red trout
#

thx Olivo!!

coral flower
#

I try to remove just Cobblestone and Deepslate on explosion but it removes all blpcks anyways

@EventHandler
  public void onEntityExplode(EntityExplodeEvent event) {
    List<Block> blocks = event.blockList();
    for (Block block : blocks) {
      // Check if the block is a certain type that you want to keep intact
      if (block.getType() != Material.COBBLESTONE && block.getType() != Material.DEEPSLATE) {
        // Remove the block from the list of affected blocks
        blocks.remove(block);
      }
    }
  }```
young knoll
#

Make sure to handle BlockExplodeEvent too

coral flower
#

the BlockExplodeEvent doesnt fire when I use tnt

glad prawn
coral flower
#

thx I'll try that. But shouldnt make a difference right?

glad prawn
#

yeah

red trout
#

help meee

#

how to implement spigot 1.20.1 nms ㅜㅇㅜ

steel dirge
red trout
#

using gradle

steel dirge
#

Well same thing. Add an import of ‘spigot’ instead of ‘spigot-api’

red trout
steel dirge
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>Version-goes-here</version>
</dependency>

red trout
#
plugins {
    id 'java'
    id 'org.jetbrains.kotlin.jvm'
    id 'io.freefair.lombok' version '8.3'
    id 'com.github.johnrengelman.shadow' version '8.1.1'
    id 'xyz.jpenilla.run-paper' version '2.1.0'
}

group = 'org.server'
version = '1.0-SNAPSHOT'

ConfigurableFileTree libs = fileTree(dir: 'libs', include: ['*.jar'])

repositories {
    mavenCentral()
    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
    maven {
        url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
    }
    maven {
        url = 'https://mvnrepository.com/artifact/org.projectlombok/lombok'
    }
    maven {
        url = 'https://repo.oraxen.com/releases'
    }
    maven {
        url = 'https://jitpack.io'
    }
    maven {
        url = 'https://papermc.io/repo/repository/maven-public/'
    }
    maven { url "https://repo.dmulloy2.net/repository/public/" }
}

runServer {
    minecraftVersion("1.20.1")
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
    //compileOnly 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT'

    compileOnly "net.kyori:adventure-platform-bukkit:4.3.2"
    compileOnly "net.kyori:adventure-text-minimessage:4.14.0"
    compileOnly 'com.google.code.gson:gson:2.10.1'
    compileOnly 'com.google.guava:guava:33.0.0-jre'
    compileOnly 'org.apache.commons:commons-lang3:3.14.0'

    compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.6.2-beta-r3-b'

    compileOnly 'org.projectlombok:lombok:1.18.28'
    annotationProcessor 'org.projectlombok:lombok:1.18.28'

    compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'

    compileOnly libs
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8'

    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release.set(targetJavaVersion)
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}
kotlin {
    jvmToolchain(17)
}

shadowJar {
    setArchiveClassifier("")
    mkdir("$projectDir/builds")
    doLast {
        copy {
            from archiveFile.get().asFile
            into file("$projectDir/builds")
            into file("/Users/hong-inseong/Desktop/Coding/server/Sleepground Skin Server/plugins")
        }
    }
}

java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}

project.tasks {
    copy {
        from libsDirectory
        into file("$projectDir/builds")
    }
    build {
        dependsOn shadowJar
    }
}
steel dirge
#

From spigot google search

red trout
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>Version-goes-here</version>
</dependency>

steel dirge
#

I don’t see spigot in there

#

I’m also on my phone but

#

U have spigot-api

red trout
#

yea

river oracle
steel dirge
#

Perfect

river oracle
#

You need to use Patrick rrmapper instead of the maven plugin tho

red trout
#

I already tried changing it, but it wasn't added to external libraries and there was a problem with the existing code not working.

river oracle
#

Read the guide above and switch everything into gradle and use the Patrick Chloe remapper

red trout
#

Oh I See

#

Thanks

#

i tryed that

#
Execution failed for task ':remap'.
> Could not resolve all files for configuration ':detachedConfiguration5'.
> Could not resolve org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT.
     Required by:
         project :
> Could not resolve org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT.
> Unable to load Maven meta-data from https://mvnrepository.com/artifact/org.projectlombok/lombok/org/spigotmc/minecraft-server/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml.
> Could not GET 'https://mvnrepository.com/artifact/org.projectlombok/lombok/org/spigotmc/minecraft-server/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml'. Received status code 403 from server: Forbidden

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 13s
1 actionable task: 1 executed
#

How..

sand spire
#

Can I save multiple things in the same PDC with the same key if the PersistentDataType is different?

chrome beacon
#

Use different keys

sand spire
#

aight

chrome beacon
#

It might be possible, but I don't see why you'd want that

#

You can always give it a try

blissful needle
#

oh damn, thx

#

I havent done much development since before then

chrome beacon
#

PDC is Spigot/Bukkit specific

#

so I don't expect you to know what it is

blissful needle
#

ye ik, I just came back since like 1.8

#

or 1.12

#

i think

#

thx tho

#

woah, this is genius.

vast raven
#

Why does the player I set swimming doesn't see himself swimming but other players do

chrome beacon
#

Because the game was never designed for that

vast raven
#

wdym

chrome beacon
#

Movement is done client side and thus it's hard to force the client state

#

so setSwimming won't work

vast raven
#

so actually I need to use a workaround

chrome beacon
#

Are you trying to force the player to crawl?

vast raven
#

it's GSit skid time..

chrome beacon
#

You'd need to place some invisible block above the player

#

That should force them to crawl

vast raven
#

so even removing it after the packet is sent should do it?

chrome beacon
#

?paste

undone axleBOT
vast raven
#

or like I need to keep sending packets of invisible block on the top of the player

chrome beacon
#

keep sending I believe

red trout
#

o i see

#

this is my gradle

vast raven
blissful needle
#

Quick question: Can i detect between the 3 different levels of achievements?

solemn meteor
#

How do I use inventoryclickevent for offhanding, like lets say I put my cursor at the top left most slot in my player inventory, and press F, how do I get both slots (or both items that changed positions)

cerulean scaffold
#

hey is there a page with more information on setting/replacing villager trades? ive tried to do it myself but the villager just has a lack of trades at all and shakes its head at me

scarlet gate
#

Does anyone know what the rate limit is for the spigot api (or the spiget api)?

proud badge
#

Hi, so in a CraftItemEvent, when I do event.getRecipe().getResult().getAmount() it returns the amount of one recipe, for example for torches, 4. However if I craft multiple things, such as 2 sticks and 2 coal at the same time (output: 8 torches) it still says 4. What could I use to get the correct number?

grim hound
#

My scheduler just

#

stopped working

#

never postComplete is executed

#

I guess it completed exceptionally?

grim hound
#

you're getting the recipe

#

now the actual crafted items

#

the recipe is constant

#

and will always return the same amount

proud badge
#

Ik, im asking how do I get the correct amount

proud badge
#

?

grim hound
#

there's two getters

proud badge
#

ok so getInventory().getResult()? Thanks I'll try it

grim hound
#

if it won't work use InventoryClickEvent

#

that's a sure-fire solution

mortal hare
#

?paste

undone axleBOT
silent slate
#

when right clicking air the Action.RIGHT_CLIC_AIR does not fire

#

why

#

im having a compass in my main hand

raw epoch
#

Hello!

do someone know how to get the display name of a Material ? Like Material.STONE -> "Stone" or Material.LAVA_BUCKET -> "Lava Bucket" ? 🙏

valid burrow
#

what you can do is

#

get the material, remove the underscore and place the capitals manually

#

iirc

ivory sleet
#

wow

#

no server boost

remote swallow
#

wow

#

no nitro

valid burrow
ivory sleet
#

hmm I see

valid burrow
#

paypal is buggin rn

remote swallow
#

cowoconcluwube are you about to gift

remote swallow
ivory sleet
#

im not that rich sadly

#

i could gift some cat ears i suppose

chrome beacon
remote swallow
#

cat ears

valid burrow
#

keeps asking me for my bank credentials on every purchase even though they are linked

#

and it worked for the last 2 years

#

and suddenly

#

no

#

you cant buy shit anymore

cinder abyss
#

Hello, does anyone know why it returns me "Please wait 0 seconds before using this ability" after 4 usages? I tried a lot of things but I don't find a way to fix that...
https://paste.md-5.net/aledaremem.java

sand spire
#

you can add 1 to the timeleft

#

so it says 1 when its 0.5

#

"Please wait " + (timeLeft.getSeconds()+1) + " seconds before using this ability!"

cinder abyss
bronze marlin
#

Hey Guys,

I wrote a GUI with an Exit Button as a barrier. My problem is that the barrier can be obtained by the player by pressing a number (so it gets in the hotbar) or by shift-clicking.

e.setCancelled(true);

if (slot == 18) {player.closeInventory();}

I already cancelled the event before and it works on all other items in the GUI but when i want to close it i can get the item. Any ideas?

Sincerely,
Nykolos

sullen marlin
#

They're both part of InventoryClickEvent, so make sure you're not doing any filtering of that event

#

You can always debug your event code to see why it's not getting where you want it to (and confirm it is being called)

bronze marlin
#

Everything is in an onInventoryClick method and everything in this method works perfectly exept the barrier

real ridge
#

Does anyone know what is wrong with

FriendlyByteBuf buffer = new FriendlyByteBuf(Unpooled.copiedBuffer(message));

it gives me the following error

[14:49:42 WARN]: [Female-Gender-Mod-Plugin] Plugin Female-Gender-Mod-Plugin v1.1 generated an exception whilst handling plugin message
java.lang.NoClassDefFoundError: net/minecraft/network/FriendlyByteBuf
    at dbrighthd.wildfiregendermodplugin.GenderPlugin.onPluginMessageReceived(GenderPlugin.java:48) ~[FGM-Plugin-test.jar:?]
    at org.bukkit.plugin.messaging.StandardMessenger.dispatchIncomingMessage(StandardMessenger.java:455) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.server.network.ServerCommonPacketListenerImpl.handleCustomPayload(ServerCommonPacketListenerImpl.java:183) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.handle(ServerboundCustomPayloadPacket.java:46) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:12) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:54) ~[?:?]
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1498) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
    at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1475) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1398) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
    at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1376) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.4.jar:git-Purpur-2165]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.network.FriendlyByteBuf
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:199) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:166) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
    ... 19 more
sullen marlin
#

?whereami

bronze marlin
#

how?

real ridge
# sullen marlin ?whereami

updated error:

16:24:05 WARN]: [Female-Gender-Mod-Plugin] Plugin Female-Gender-Mod-Plugin v1.1 generated an exception whilst handling plugin message
java.lang.NoSuchMethodError: 'net.kyori.adventure.text.Component org.bukkit.entity.Player.displayName()'
    at dbrighthd.wildfiregendermodplugin.GenderPlugin.onPluginMessageReceived(GenderPlugin.java:45) ~[?:?]
    at org.bukkit.plugin.messaging.StandardMessenger.dispatchIncomingMessage(StandardMessenger.java:455) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.server.network.ServerCommonPacketListenerImpl.a(ServerCommonPacketListenerImpl.java:138) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:46) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:33) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:156) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1191) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:130) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.bl(MinecraftServer.java:1170) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1163) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.bu(SourceFile:115) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.w_(MinecraftServer.java:1146) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1060) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]
bronze marlin
#

There isn't a method called displayName() do you mean getDisplayName()?

#

In the Player class

real ridge
sullen marlin
#

?fork

undone axleBOT
#

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

real ridge
#

for the pom.xml

bronze marlin
real ridge
bronze marlin
#

👍

real ridge
#

there we go

#

now I have a spigot error

#
[16:33:33 WARN]: [Female-Gender-Mod-Plugin] Plugin Female-Gender-Mod-Plugin v1.1 generated an exception whilst handling plugin message
java.lang.NoClassDefFoundError: net/minecraft/network/FriendlyByteBuf
    at dbrighthd.wildfiregendermodplugin.GenderPlugin.onPluginMessageReceived(GenderPlugin.java:48) ~[?:?]
    at org.bukkit.plugin.messaging.StandardMessenger.dispatchIncomingMessage(StandardMessenger.java:455) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.server.network.ServerCommonPacketListenerImpl.a(ServerCommonPacketListenerImpl.java:138) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:46) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:33) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:156) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1191) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:130) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.bl(MinecraftServer.java:1170) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1163) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.bu(SourceFile:115) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.w_(MinecraftServer.java:1146) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1060) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.network.FriendlyByteBuf
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:160) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:112) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
    ... 19 more
bronze marlin
#

FriendlyByteBuff is a class in the Forge libary

#

And he can't find it on a spigot server

remote swallow
#

friendly byte buf is an mojmap class name

#

you arent remapping

real ridge
#

and updated the maven to fit

worthy star
#

how can i make an api for my plugin? so i can use it in other plugins coding

olive lance
#

has anybody ever run into this

bronze marlin
#

The website doesnt have a certification

#

Ur site?

olive lance
#

its aserver for card access, but i updated the firmware and now i cant skip the cert warning

#

used to could proceed

bronze marlin
worthy star
#

yea that i mean

#

so i put dependency and stuff

#

in pom.xml

hazy parrot
#

if so, you have to add your authority as trusted one

bronze marlin
#

I cant drop it

#

But shift klick and pressing a number moves it into my inventory

#
e.setCancelled(true);
if (e.getRawSlot() == 18) {e.getWhoClicked().closeInventory();}
#

Doesn't work like it should

marble eagle
#

does anyone happen to know an alternative for the player.openBook method for 1.8.8 spigot?

real ridge
#

Okay... it seems to be working sometimes, and other times, it gives errors

fossil lily
#

Does spectate target not work correctly?

When I have the player spectate the armor stand, nothing happens. When I remove the entity, the player gets teleported to where it last was. Any ideas?

#

Looks like this issue

bronze marlin
worldly ice
#

close the inventory a tick after you cancel

bronze marlin
#

But when u use a autoclicker

#

Not 100% safe

worldly ice
#

it should be, i don't know why it wouldn't

remote swallow
#

if you can click quicker than 1 tick

#

thats a wild auto clicker

worldly ice
#

real

remote swallow
#

minecraft probably wont even support that

bronze marlin
#

But how can i implement this?

remote swallow
#

?scheduling

undone axleBOT
brave lynx
#

Does anyone have an idea on how I can check when a player's fishing hook hits water?

quaint mantle
#

Does the EntityKnockbackByEntity event detect minecarts?

#

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class MenuListener implements Listener {

    @EventHandler
    public void onClick(InventoryClickEvent e) {

       if (ChatColor.translateAlternateColorCodes('&', e.getView().getTitle()).equals(ChatColor.GOLD.toString() + ChatColor.BOLD + "Bet Area")
            && e.getCurrentItem() != null) {
           e.setCancelled(true);
           Player player = (Player) e.getWhoClicked();

           switch(e.getRawSlot()) {
               case 0:
                  break;
               case 34: // opens new gui

                   break;
               default:
                   return;

           }
           player.closeInventory();

       }




    }

}```
can someone help figure out why my blocks still move around in the gui despite me cancelling that
brave lynx
#

are you in creative?

quaint mantle
#

let me check uhh yes why?

brave lynx
#

try it in survival

quaint mantle
#

can i make it be unable to move in creative as well?

quaint mantle
real ridge
#

nvm... the error is back

[17:29:50 WARN]: [Female-Gender-Mod-Plugin] Plugin Female-Gender-Mod-Plugin v1.1 generated an exception whilst handling plugin message
java.lang.NoClassDefFoundError: net/minecraft/network/FriendlyByteBuf
    at dbrighthd.wildfiregendermodplugin.GenderPlugin.onPluginMessageReceived(GenderPlugin.java:48) ~[?:?]
    at org.bukkit.plugin.messaging.StandardMessenger.dispatchIncomingMessage(StandardMessenger.java:455) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.server.network.ServerCommonPacketListenerImpl.a(ServerCommonPacketListenerImpl.java:138) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:46) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket.a(ServerboundCustomPayloadPacket.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:33) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:156) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1191) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:130) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.bl(MinecraftServer.java:1170) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1163) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:139) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.w_(MinecraftServer.java:1147) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1060) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4077-Spigot-e9ec548-dfaa89b]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.network.FriendlyByteBuf
    ... 19 more
lilac dagger
#

make sure to follow ?nms closely

real ridge
#

?nms

native ruin
#

Is there a way to stop horses from bucking randomly?

real ridge
#

i copy-pasted

lilac dagger
#

make sure you use the correct jar then

#

i think there's a foo-remapped.jar

#

don't use that

#

it should be foo.jar

real ridge
#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>dbrighthd</groupId>
  <artifactId>Female-Gender-Mod-Plugin</artifactId>
  <version>1.1</version>
  <packaging>jar</packaging>

  <name>Female-Gender-Mod-Plugin</name>

  <properties>
    <java.version>21</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.md-5</groupId>
        <artifactId>specialsource-maven-plugin</artifactId>
        <version>1.2.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>remap</goal>
            </goals>
              <id>remap-obf</id>
              <configuration>
                <srgIn>org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                <reverse>true</reverse>
                <remappedDependencies>org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                <remappedArtifactAttached>true</remappedArtifactAttached>
                <remappedClassifierName>remapped-obf</remappedClassifierName>
              </configuration>
          </execution>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>remap</goal>
            </goals>
            <id>remap-spigot</id>
            <configuration>
              <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
              <srgIn>org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
              <remappedDependencies>org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
            </configuration>
          </execution>
      </executions>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>

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

  <dependencies>
      <dependency>
          <groupId>io.netty</groupId>
          <artifactId>netty-all</artifactId>
          <version>4.1.107.Final</version>
          <scope>compile</scope>
      </dependency>
      <dependency>
          <groupId>net.md-5</groupId>
          <artifactId>SpecialSource</artifactId>
          <version>1.11.3</version>
      </dependency>
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot</artifactId>
          <version>1.20.4-R0.1-SNAPSHOT</version>
          <scope>provided</scope>
          <classifier>remapped-mojang</classifier>
      </dependency>
  </dependencies>
</project>
remote swallow
#

you dont need a special source dependency

quaint mantle
#

i did but i can't fix it

#

should i show the command section?

real ridge
#

(check pom.xml above)

lilac dagger
#

looks fine

#

<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.5</version>

#

i've upgraded my version

real ridge
lilac dagger
#

maybe consider checking which jar you're taking with you from target

#

upgrade this

#

delete compiler plugin

#

and use

#

to set your version

quaint mantle
#

question uhh is maven shade plugin supposed be giving me errors

lilac dagger
#

can i see the errors?

quaint mantle
#

its too big i will sendd it short formats

remote swallow
#

?im

quaint mantle
#
  - META-INF/maven/com.google.errorprone/error_prone_annotations/pom.xml
FactionsUUID-1.6.9.5-U0.6.39-b341.jar, NuVotifier-2.7.3.jar, SimpleClans-2.19.3-SNAPSHOT-418.jar define 2 overlapping resources: 
  - META-INF/maven/com.google.code.gson/gson/pom.properties
  - META-INF/maven/com.google.code.gson/gson/pom.xml
SimpleClans-2.19.3-SNAPSHOT-418.jar, mcMMO-2.1.231.jar define 48 overlapping resources: 
  - META-INF/maven/co.aikar/acf-bukkit/pom.properties
  - META-INF/maven/co.aikar/acf-bukkit/pom.xml
  - META-INF/maven/co.aikar/acf-core/pom.properties
  - META-INF/maven/co.aikar/acf-core/pom.xml
  - META-INF/maven/co.aikar/locales/pom.properties
  - META-INF/maven/co.aikar/locales/pom.xml
  - acf-core_bg.properties
  - acf-core_cs.properties
  - acf-core_de.properties
  - acf-core_en.properties
  - 38 more...```
lilac dagger
#

i don't see any problems here

quaint mantle
#
  - META-INF/maven/co.aikar/minecraft-timings/pom.properties
  - META-INF/maven/co.aikar/minecraft-timings/pom.xml
  - META-INF/maven/net.jodah/expiringmap/pom.properties
  - META-INF/maven/net.jodah/expiringmap/pom.xml
MultiverseCore-4.3.12.jar, WorldEdit-7.3.0.jar, WorldGuard-7.0.9.jar define 1 overlapping resource: 
  - defaults/config.yml
MultiverseCore-4.3.12.jar, MythicMobs-5.6.1.jar define 25 overlapping classes: 
  - org.intellij.lang.annotations.Flow
  - org.intellij.lang.annotations.Identifier
  - org.intellij.lang.annotations.JdkConstants
  - org.intellij.lang.annotations.JdkConstants$AdjustableOrientation
  - org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis
  - org.intellij.lang.annotations.JdkConstants$CalendarMonth
  - org.intellij.lang.annotations.JdkConstants$CursorType
  - org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment
  - org.intellij.lang.annotations.JdkConstants$FontStyle
  - org.intellij.lang.annotations.JdkConstants$HorizontalAlignment
  - 15 more...
MythicMobs-5.6.1.jar, WorldGuard-7.0.9.jar define 1 overlapping resource: 
  - META-INF/README.txt
MythicMobs-5.6.1.jar, Vault-1.7.3.jar define 2 overlapping resources: 
  - META-INF/maven/org.bstats/bstats-bukkit/pom.properties
  - META-INF/maven/org.bstats/bstats-bukkit/pom.xml```
remote swallow
#

?paste

undone axleBOT
lilac dagger
#

oh overlapping

quaint mantle
#

overlapping?

lilac dagger
#

meaning you're shading plugins with conflicting resources

remote swallow
#

you can pretty much ignore those

lilac dagger
#

are you sure you want to shade in vault and mythic mobs?

#

you might wanna go through dependencies and use <scope> provided

#

on them

#

so they're not included into your jar

quaint mantle
#

well vault is now somewhat working better i can finally have an account i am just trying to find out why the gui i made still is able to messed with

lilac dagger
#

i don't understand what you mean, do you mean players can modify the slot items?

quaint mantle
#

yeah

#

even though they shouldn't be able too

lilac dagger
#

you need to cancel on inventory click event

quaint mantle
#

isn't this the command

           e.setCancelled(true);```
lilac dagger
#

yes

quaint mantle
#

still doesn't work

lilac dagger
#

but it looks like you're having a condition above

quaint mantle
#

with it

lilac dagger
#

that will most likely be the problem

remote swallow
#

?paste the full listener

undone axleBOT
quaint mantle
#

oh okie

lilac dagger
#

use a print by the set cancelled to see if it even reaches there

#

and one at the beginning

quaint mantle
lilac dagger
#

different prints so you know if the event even is called

remote swallow
#

dont identify inventories by the title

lilac dagger
#

^

remote swallow
lilac dagger
#

have an inventory reference that you can check by

#

and this ChatColor.translateAlternateColorCodes('&', e.getView().getTitle())

#

doesn't event do a thing

#

it should be already colored, meaning it uses the mojang symbol

quaint mantle
#

its saying altchatcolor

remote swallow
#

it is already translated

remote swallow
quaint mantle
#

i am ready it just taking me a while to fully understand it ^^

ember dew
#

Simple question, can't find an answer somehow
What's the method or event I can cancel for when a spawned chicken egg spawns a baby chicken

lilac dagger
#

EntitySpawnEvent

quaint mantle
#

does the EntityKnockbackByEntity event detect minecarts?

undone axleBOT
lilac dagger
real ridge
ember dew
#

Does the key persist from the egg onto the chicken

lilac dagger
real ridge
ember dew
lilac dagger
#

i see this event PlayerEggThrowEvent

ember dew
#

Yeah, but that's player thrown

lilac dagger
#

maybe there's an EntityEggThrowEvent

ember dew
#

Not that I see

lilac dagger
#

how do you get the jar file?

#

do a clean and then a package and get the jar with the shortest name

quaint mantle
lilac dagger
#

sad

quaint mantle
#

i might just have to use the VehicleMoveEvent to detect knockback i guess

lilac dagger
#

sounds like it yea

real ridge
remote swallow
#

intellij artifact is not maven

real ridge
lilac dagger
#

^^

remote swallow
#

if you want to use maven you have to compile with maven

#

right side of your screen is either an M or maven tab

real ridge
remote swallow
#

no it doesnt

lilac dagger
remote swallow
#

open it, open lifecylces then find package

lilac dagger
#

then go into your main project

#

and you'll have something like this

#

no artifacts needed

real ridge
#

Ah! Now I have errors

#

what does Unsupported class file major version 65 mean?

lilac dagger
#

wrong java version

#

maybe it's because of the properties i gave you

#

replace 17 with that placeholder from compiler plugin you had @real ridge

remote swallow
#

trying to just java 21 on a lower version of java

lilac dagger
#

${java.version}

remote swallow
#

show the full error message

lilac dagger
#

i thought you kept the properties from my previous help attempt

real ridge
remote swallow
#

?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 you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

remote swallow
#

or preferablly

#

?paste

undone axleBOT
remote swallow
#

the first one has all we needed

#

im gonna take a wild guess and say special source doesnt support java 21 yet

real ridge
#

fuck :D

#

let me download 17 now

remote swallow
#

?java17

undone axleBOT
real ridge
#

jdk, rihgt?

#

brb... restarting PC now

junior cradle
#

Why does theplayer.setCooldown() not work on the chorus ?

real ridge
#

back... going to test now

#

that broke everything xD

#

nvm... wrong project

lilac dagger
#

More details please

drowsy cosmos
#

Noob question here. Would it be advisable to throw exceptions on say, BlockBreakEvent handler, or other events, commands, etc? Would Spigot still output the exception details?

@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
  try {
    this.someProcess();
    this.otherProcess();
  } catch (SomeException exception) {
    this.handleSomeException();
  } catch (OtherException exception) {
    throw new OtherException(exception); // Is this advisable? Would Spigot still output the exception details?
  }
}
lilac dagger
#

Use Thread.printstacktrace instead

#

I'm sure paper/spigot output this

drowsy cosmos
#

I didn't realize I didn't edit the Paper to Spigot haha. Wanted to check what are the thought process here too.

#

Thanks, i'll check Thread.printstacktrace!

lilac dagger
#

It'll catch it, add it's own message and print the error

#

So it's better to have control and use thread print

eternal oxide
#

You shoudl only throw exceptions if you want some other plugin/app to handle them, or to stop execution due to an error.

drowsy helm
#

nah throwing wouldnt be good practice

eternal oxide
#

controlling flow through exceptions is poor design

drowsy helm
#

unless you have some global error handler like in spring, you're just throwing an error that will never be handled

hollow reef
#

hm when I get chunks via code (and generate them) they wont get unloaded, so its an increasing memory heap, why is that? or what can I do to prevent it

drowsy cosmos
#

Alright, I guess I'm on the right track then.. I only throw when I want to interrupt or stop the "process". Other times, I'd just handle the exceptions gracefully.

drowsy helm
#

you should be coding in a way that handles all edgecases, rather than throwing an exception

real ridge
#

and compiling in java 17 fixed it all -_-

lilac dagger
drowsy helm
#

shouldnt be the case

#

you can manually unload them iirc

drowsy cosmos
hollow reef
eternal oxide
glass breach
#

hey fellas. What would be the best way to sort ammo per gun per player? I'm thinking of a HashMap, but I wanted to hear your thoughts...

drowsy helm
#

I cant see much scenarios where throwing would be beneficial

drowsy cosmos
drowsy helm
drowsy cosmos
#

I see. Alright, thanks for the thoughts. Really helpful!

glass breach
hollow reef
#

okay nevermind I don't get the chunk flood anymore, but is it normal that getting a chunk takes like 150ms when not generated?

inner mulch
#

i assume its generating

#

when you get it

hollow reef
#

yeah but does this take so long?

#

like 150ms feels very long

inner mulch
#

depends on the machine i guess?

hollow reef
#

hm, how many generation threads are used per default?

flint coyote
#

I can't guarantee this is correct but since everything is done sync I'd assume it is a single thread, the main thread. Chunks are loaded after each other

sullen marlin
#

No it's Async but each chunk can only use one thread

keen valve
quaint mantle
#

anybody know how i can cancel a minecarts knockback?

quaint mantle
#

well after trying 10+ methods for some reason i can't make the items not be moved by player in the gui

echo basalt
#

Did you cancel both the drag and click events?

quaint mantle
echo basalt
#

?gui

echo basalt
#

Make them proper

quaint mantle
#

so then my handler doesn't work

quaint mantle
#

so i've been seeing people use .getTitle for the guis is there an alternative to it cause i don't have it in 1.20 making

chrome beacon
#

I hope you're not planning on detecting inventories by their name

chrome beacon
young knoll
#

Don’t pull a vulkan

quaint mantle
chrome beacon
#

yes

quaint mantle
#

why is that

#

sorry i am not too good with gui making yet

chrome beacon
#

I can rename a chest for example

#

and cause all kinds of bugs

quaint mantle
#

that does make sense

chrome beacon
#

As Coll mention Vulkan anticheat for example had that problem

#

allowing people to gain op just by renaming chests

quaint mantle
#

its just i've been on this gui thing for a day now and i can't figure out how to do it right

quaint mantle
#

i am reading it

brave lynx
#

whats the event that gets used when you switch from item A to item B in your hotbar?

echo basalt
#

the offhand swap or the number key?

brave lynx
#

number key

echo basalt
#

PlayerHeldItemEvent something like that

brave lynx
#

thats so dumb

#

why didnt they make it PlayerChangedMainHandItem

#

since it alr exists

echo basalt
#

Because this was before main hand and offhands were a thing

#

If you want to get the slot at any point it's PlayerInventory#getHeldItemSlot

trim lake
#

How can I detect if player is trying to pickup item from ground with full inventory? EntityPickupItemEvent is not called in that case

glad prawn
#

boolean isInventoryFull = e.getPlayer().getInventory().firstEmpty() == -1

trim lake
#

That not helpfull at all, Im listening to EntityPickupItemEvent and its not called.

glad prawn
#

It has

trim lake
#

Nop

#

at least for me... I put sout in listener and is nothing in console if I walk true items on the ground

glad prawn
#

I don't think players can pick it up when inventory is full, so 🤷‍♂️

trim lake
#

Probably I can listen to move event or check every tick if there si some dropen item need player, but trying to find better way

echo basalt
#

rip it's paper only

#

PlayerAttemptPickupItemEvent

wet breach
#

One of these days people will learn how to use the search on the javadocs

trim lake
echo basalt
#

as I said it's paper only

trim lake
#

I relized now

wet breach
#

Listen for item spawn or drop events. Track the location of the item until it dies then just have to listen for player move event compare locations

#

Just make sure you dont use floats for the location

chrome beacon
#

or use getNearbyEntities

trim lake
wet breach
#

Because the odds the float from item matches player is basically 0

#

So use whole numbers aka ints

trim lake
#

yeah, thats true

trim lake
# chrome beacon or use getNearbyEntities

I was thinking about this and just look for nearby items and just pick them up and ofc remove entity from the ground. What is default range player can pickup an item?

wet breach
#

Its like 3 blocks

#

Nvm

#

Its less

#

1 block or less

#

Or if you intersect with the collision box of the item. But i dont think we have large item entities so doubt you will have to worry about it bein larger then a block lol

trim lake
#

so I will probably listen to PlayerMovmentEvent and just look for items nearby with getNearbyEntities, that will be probably best 🤔

chrome beacon
#

I'd rather have a scheduler run every tick

#

Players can pickup items without moving

trim lake
#

or that, I dont think saving all items droped is need

trim lake
wet breach
#

Wasnt there some kind of performance issue with getnearbyentities if you used it excessivley?

chrome beacon
#

🤷‍♂️

wet breach
#

Pretty sure someone here found out about something with it. All well guess we find out again at some point

trim lake
#

but there is lot of entities drooped in the world anyway so... it will be kinda big list as well and should maybe be hungry for performance as well

#

or am I wrong?

wet breach
#

Unless you running into the millions you shouldnt really have an issue. Major concern if anything is CME's

#

That is adding and removing from a list at the same time

trim lake
#

but I will still need to find out if the entity is exiting or not? or just schedule task for removing entity from list after Item#getPickupDelay will hit 0

#

Im stupid...

#

ItemDespawnEvent I can use this to remove it from list

wet breach
#

Doesnt get called if item is picked up

trim lake
#

I will listend to pickup event as well

wet breach
#

That is for if the world kills it because it lived too long

trim lake
#

Wounder if clearlagg kills it or some plugin like that if will be called or not

wet breach
#

Possibly not. Just use a concurrent hash map and a task

#

Every so often check the uuid if it still exists in the world

#

Listen for chunk unload and load events so you can record as needed since unloaded chunks cause entities to not exist

trim lake
#

yeah, probably best... just use hashmap<UUID, Entity> and one hashmap<Location, Entity> to pickup with full inv

wet breach
#

Concurrent hash map

#

So you dont have to worry about cme

unborn breach
#

can any one pls help me i have downloaded the graves plugin. the plugin is in my server but the grave thing doesnt work for me

trim lake
wet breach
#

You will be adding, removing, and reading from that hashmap constantly and so it would be a hassle to code your methods in such a way to not cause concurrent modification exception. Therefore easier to use an object designed to handle that and not worry about all that extra code lol

trim lake
#

thats why I want only task to removing the non existing entities lol or I didn´t get it what u mean

wet breach
trim lake
#

So I need to listen to pickup and movent event and not despawn event (that will be removed with task)? So not valid items will be removed with listener what will check (probably every tick) if entity still exist? That´s what are u trying to say?

#

wait... if player will be closed to entity and I will pick that up with move event I need to cancel pickup event or just prevent that to not be called as well

wet breach
#

Thought you were just concerned if they couldnt pick the item up

flint coyote
twin venture
#

hi , uh i have a question i saw a nice feature on a pvp server , where when 2 player's are in pvp , it will spawn with packets only for this 2 player's a wall of glass blocks , it will block access to lobby or spawn

#

how would this works , and what packets i should use?

#

and when they are out of pvp , it will despwan the blocks ofc

#

i want to do it efficent as possible , how i should spawn the blocks? async , sync? i mean with packets?

chrome beacon
trim lake
twin venture
chrome beacon
#

internally yes

#

now you might need to do some world checks sync if you only want to replace air

trim lake
brave lynx
#

What event gets called when a zombie attacks a player?

brave lynx
wet breach
#

Use instanceof to check if entity is a player. If it is cast entity to player

#

Or use the api methods to get a player object using entities uuid

brave lynx
#

so getEntity() gets the damagee?

wet breach
#

Should yes

#

Wouldnt make sense for getdamager and getentity to get the same entity with no way to obtain the entity that was damaged

brave lynx
#

If so, how do i do that because its not working for me atm

flint coyote
#

For skeletons the attacker will be a projectile (the arrow), you'll have to get the shooter from the projectile in order to get the actual skeleton

#

And yes you should be able to simply cast as long as you check for either the EntityType or the class before (instanceof).
What have you tried? What's "not working"?

#
@EventHandler
    public void onEntityDamage(EntityDamageByEntityEvent event) {
        if (event.getDamager().getType() == EntityType.ZOMBIE && event.getEntity().getType() == EntityType.PLAYER) {
            Zombie zombie = (Zombie) event.getDamager();
            zombie.setCanBreakDoors(true); // example on what to do with the zombie
        }
    }

something along those lines should work, obviously you should split the if statement if you wanna differ between skeletons and zombies and only want to consider players.

red trout
#

?nms

tired star
#

so anyone got any hacks for printing cool ascii image in console? mine doesnt line up correctly :D

echo basalt
#

uH

#

Aren't there space characters with different widths?

#

Yeah

tired star
#

i only know tab and space

#

i was just wondering if there was some "easier" way to do this than line-by-line and tweaking based on print

edgy goblet
#

minecraft font isn't monospaced

tired star
#

guess im rip in pieces then with my cool ascii art :D

edgy goblet
#

hmm

#

look at the MinecraftFont and MapFont classes

#

you might be able to use the data from there to line up your characters

tall dragon
tired star
#

thanks for suggestions! i'll defo check these

worthy star
#

how can i make a library for my plugin so i can use its classes from other codes

hybrid turret
#

omg i finally fully understand the 7's modern approach to inventory guis. (eh okay fine almost. i'll have to read up on Consumer<T> and Function<T, R> LOL)

#

yay

worthy star
#

it says event can only be triggered synchronously

lilac dagger
#

If you want a jar, just make the library and use its maven description as a dependency