#help-development

1 messages · Page 672 of 1

icy beacon
#
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
tender shard
#

yeah I got the same, except that I use 3.1.0

icy beacon
#

ty

#

gonna bump that

tender shard
#

~/.gnupg/

icy beacon
#

that just seems to be my gpg installation folder?

remote swallow
#

user home

tender shard
remote swallow
#

do you actually have a key generated

icy beacon
#

oh my bad

remote swallow
icy beacon
#

this is all i have in .gnupg

remote swallow
#

open gitbash and run gpg --list-secret-keys --keyid-format=long

#

dont send a screenshot here also

icy beacon
#

it outputted nothing what the fuck 😭

remote swallow
#

did you uninstall gpg or somethin

icy beacon
#

i myself do not know what has happened

#

all i know is that it was working before my path was wiped, but i'm starting to think that something else happened in the meantime

#

wait

#

nvm

#

i had to do the command in cmd, not git bash

#

i do have a key

#

so the key is in the .kbx file?

remote swallow
#

idk where the key is actually stored

#

if you need it in armor theres a command for it

icy beacon
#

i'm trying to figure out how to couple it back to intellij

#

it's a different error now, i updated maven-gpg-plugin to 3.1.0

tender shard
#

yeah that happens to me too on windows (works fine on mac)

#

I just run maven outside of intellij

#

that works fine

icy beacon
#

😳

#

i'm not quite sure how exactly i'd do that because i have no idea where i can grab a maven executable

tender shard
#

same error in intellij

#

but from CLI it works

icy beacon
#

and overall this seems very hacky for a problem that started appearing out of the blue

tender shard
#

no clue why

icy beacon
#

oh

icy beacon
#

i have never had a maven executable on my pc xD ty one sec

half wyvern
#

Hello
Does anyone know why when I add a JDA dependency in maven, the plugin weighs 13 MB??

tender shard
#

because it includes JDA?

remote swallow
#

jda is huge

tender shard
#

you can use the shade plugin's minimizeJar option to get rid of classes you don't need

remote swallow
#

lowest you can get while shading it is 9mb

tender shard
#

you can also exclude the audio stuff if you don't need it manually

    <exclusions>
        <exclusion>
            <groupId>club.minnced</groupId>
            <artifactId>opus-java</artifactId>
        </exclusion>
    </exclusions>
half wyvern
#

But JDA makes a 3KB plugin suddenly weigh 13MB?

tender shard
#

well JDA is apparently 13 MB in size

#

as I said, use the minimizeJar option

minor garnet
#

some1 know how fix it?

north nova
#

just shade all maven central into ur project

#

dont have to bother with dependencies then

minor garnet
#

im getting a error when a launch: unrecognized option - Xincgc

icy beacon
#

new question, how do i specify a key for maven-gpg-plugin because it apparently lost it?

tender shard
half wyvern
tender shard
#

in the maven shade plugin's <configuration> add <minimizeJar>true

minor garnet
tender shard
#

just get rid of that option if you don't know what it's supposed to do

shadow night
icy beacon
tender shard
# half wyvern minimizeJar that I find in Intellij?
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <minimizeJar>true</minimizeJar> <!-- <---- this -->
            </configuration>
          </execution>
        </executions>
      </plugin>
#

and as said, exclude opus-java from the dependency

minor garnet
tender shard
#

no clue

minor garnet
#

nvm i found it

remote swallow
#

what is -Xingc meant to do

minor garnet
tender shard
#

he doesn't know

remote swallow
shadow night
#

Extra incredibly non-conventional garbage cleaner?

minor garnet
#

f*

ivory sleet
lyric marlin
#

Hello, please help, I paid for the cmi plugin on the site, but it shows that it is not paid, where will it go?

tender shard
#

also this is the wrong channel

icy beacon
lyric marlin
# tender shard wait

What is the approximate time to expect? the plugin was paid for earlier in the day

half wyvern
#

Thanks everyone for your help

tender shard
#

and as I said, this is the wrong channel

north nova
#

u shoulda just said min 1 min max 30 days

lyric marlin
tender shard
#

#general I guess

lyric marlin
quaint mantle
#

is there a better api to use for getting a uuid from a name and getting skin texture than mojangs? as i keep getting ratelimited which is understandable but i'm just wondering

tender shard
#

well how many requests are you doing?

carmine mica
#

the ratelimit was SUPER reduced yesterday

tender shard
#

don't you only ever have to query it once per user?

carmine mica
#

its like 11 requests and you get ratelimited

tender shard
#

it went from 600 / 10 minutes to 10 / 5 seconds

#

so IIRC you can actually do twice as many requests in the same amount of time, just not all at once

timid hedge
#

Can someone please help me
I am getting an error at if (args[0].equalsIgnoreCase("add")) {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            if (label.equalsIgnoreCase("bal")) {
                if (!(sender instanceof Player)) {
                    sender.sendMessage("Only players can do this");
                    return true;
                } else {
                    Player player = (Player) sender;
                    if(args.length == 0){
                        sender.sendMessage("You have " + formatNumAsMoney((float) Balance.get().getBalance(player)) + "§a$");
                    }
                    if (args[0].equalsIgnoreCase("add")) {
                        System.out.println("2");
                        if (sender.hasPermission("money.add")) {
                            System.out.println("3");
                            Player target = Bukkit.getPlayer(args[1]);
                            if (target != null) {
                                Balance.get().addBalance(target, Double.parseDouble(args[2]));
                                System.out.println("4");
                                return true;
                            }
                        }
                    } 

It says this

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at my.server.economy.commands.BalanceCommand.onCommand(BalanceCommand.java:25) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
hazy parrot
#

There are no args

#

And you are trying to access them

tender shard
#

^

#

check the length first

lilac dagger
timid hedge
#

How should i know that you have created one?

#

I dont event know who you are

lilac dagger
#

you now know

#

it is on github, you can check there too, if you want to learn

hazy parrot
#

shameless selfpromotion kekw

lilac dagger
#

cough worthit cough

opaque scarab
opaque scarab
ivory sleet
echo basalt
#

No need to advertise either

ivory sleet
#

^

opaque scarab
ivory sleet
timid hedge
#

Sorry if i just dumb rn but what is wrong with this i cant see the error

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

            Player player = (Player) sender;
            if (args.length == 0) {
                sender.sendMessage("You have " + formatNumAsMoney((float) Balance.get().getBalance(player)) + "§a$");
            }
            if (args[0].equalsIgnoreCase("add")) {
                System.out.println("2");
                if (sender.hasPermission("money.add")) {
                    System.out.println("3");
                    Player target = Bukkit.getPlayer(args[1]);
                    if (target != null) {
                        Balance.get().addBalance(target, Double.parseDouble(args[2]));
                        System.out.println("4");
                        return true;
                    }
                }
                
            }
        }
        return false;
    }
}

opaque scarab
undone axleBOT
#

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

echo basalt
#

mans forgot a return

opaque scarab
ivory sleet
#

This

timid hedge
#

?paste

undone axleBOT
ivory sleet
#

@quaint mantle ^

quaint mantle
tender shard
timid hedge
tender shard
#

did you not read that?

timid hedge
#

I was pasting this mean while

tender shard
#

we told you like half an hour ago

quaint mantle
#

it is strange though considering i get ratelimited sometimes and don't think i've ever surpassed 10/5 but eh, whatever

tender shard
#

don't access args[N] if the array's lengh is smaller than N+1

opaque scarab
echo basalt
#

man cant read

#

he just copypastes

#

It's fine maybe in a year you'll start understanding

ivory sleet
#

Understandable if you use the same command executor for multiple plugin commands

tender shard
echo basalt
#

yep

valid basin
#

When I try to compile my plugin I'm getting this error. With maven
cannot access net.kyori.adventure.text.Component

#

Does someone know why?

#

Using obliviateinvs

livid dove
# echo basalt he just copypastes

It does hurt a little because the guy from last night u walked in on us talking to. He started java literally last night, and within 2 hours the dude was doing critical thinking on what he was writing.

If the guys who copy pasted spent literally an hour learning the concepts, they'd be in this channel like 80% less xD

valid basin
tender shard
#

this is the spigot discord

echo basalt
#

I found it odd you were teaching binary to a complete beginner

ivory sleet
#

Its a bit hard to know with just that error message 😅

livid dove
echo basalt
#

I don't think I have the patience needed to become a teacher

ivory sleet
#

I mean the fact that we start from 0 and not 1 doesn’t have much to do with binary?

valid basin
# ivory sleet More context

Well it's weird, it drops that error and it brings me to my custom GUI server selector class. But nothing is red but the error is still dropped

        super(player, "hubselector", "Hub Selector", 3);
    }```
echo basalt
#

But I do have the patience needed for writing multi-platform minigame stuff

#

converting my minigamelib to minestom right now

livid dove
ivory sleet
#

I’d say its a really insignificant reason if any at all

livid dove
#

But it is a reason.

And from my experience, having a good story to go with a concept makes it so much easier to remember.

As said, by the time we finished I literally stood back and he went ham with no help needed

ivory sleet
#

Idk tbh how much of a reason it is tho. Yes sure having stories, anecdotes or other tales may help but that has nothing to do saying binary is a reason indiceables start at 0. But nonetheless if it helped him than who am I to judge PES_SadShrug

livid dove
#

Aye 🙂

ivory sleet
livid dove
#

He is a good kid though, I can see him being quite the developer in a few months

ivory sleet
#

Most people who come here are good and really interesting if you let your eyes not judge their inabilities too hard :>

livid dove
upper hazel
#

Is there such an event that checks that a player hit another player by throwing a trident?

timid hedge
#

Im trying to check if the args is a player but i dont know how to, i have this right now but it is not working. It sends this

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at my.server.economy.commands.BalanceCommand.onCommand(BalanceCommand.java:41) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
        ... 15 more
                    if (args[0].equalsIgnoreCase("add")) {
                        System.out.println("2");
                        if (sender.hasPermission("money.add")) {
                            System.out.println("3");
                        }
                        OfflinePlayer[] target = Bukkit.getOfflinePlayers();
                        if(args[1].equalsIgnoreCase(Arrays.toString(target))){
                            System.out.println("4");
                            return true;
                        }
                    } 
livid dove
lilac dagger
#

or getOfflinePlayer @timid hedge

livid dove
#

Get offline player is big and clever

#

And I stand by the naming convention is bullshit xD

lilac dagger
#

vault requires getoffline player

livid dove
#

It should be Player and OnlinePlayer : Change my mind

lilac dagger
#

so it depends if you wanna allow adding to offline players

timid hedge
lilac dagger
#

well what does it say?

#

it shows as deprecated but don't worry

#

you can use it

timid hedge
#

This isnt working Player target = Bukkit.getOfflinePlayers(); and i need to use OfflinePlayer[] target = Bukkit.getOfflinePlayers();

ivory sleet
quaint mantle
#

how would i change the nametag of the player (name above head). player.setPlayerListName() changes tab name and player.setDisplayName() changes chat name

kind hatch
#

IIRC, you have to mess with Scoreboard Teams to change that. Even then, you can only add prefixes and suffixes. You can't change the player name aside from color styling.

echo basalt
#

this will be fun

echo basalt
#

mhm I might want to make platform-independent events

#

fml

timid hedge
echo basalt
#

mans making 1.8 plugins as a beginner

timid hedge
#

Yeah, i dont think im going to use any other version

lilac dagger
#

wait a second

#

but mine uses 1.8.8

#

you sure you're not seeing it?

timid hedge
#

Can you try to send some of your code or a picture?

hazy parrot
#

There definetly is Bukkit.getOfflinePlayer in 1.8

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

lilac dagger
#

@timid hedge

#

args[0] being the name

timid hedge
remote swallow
#

i would recommend getting it from Bukkit.getOfflinePlayers().get and null checking to avoid querying the the mojang db

lilac dagger
#

that can take longer if you have a lot of users on your server

remote swallow
#

its 1.8

#

most people on 1.8 are on hypixl

livid dove
twilit basalt
#

Class FileConfiguration has method getDefaults(); , but this method is marked as nullable, how to make it not null?

remote swallow
#

null check it

twilit basalt
#

That does not change if it is null?

remote swallow
#

average intellij response

remote swallow
twilit basalt
#

...

#

but I am asking what should I do to make it not null

remote swallow
#

add defaults

subtle folio
grim hound
#

Does anyone have a custom MapFont class, to make like the text bold or just for fancy characters?

twilit basalt
grim hound
#

I'm aware of drawing an image, but I'm too lazy for now to cut all of the characters out by hand

steady rapids
#

Anyone who uses XMaterials here? I'm trying to check if a material is contained in a list of XMaterials but it seems to not work:
this is the list:

static{
        SKULLS.add(XMaterial.DRAGON_HEAD.parseMaterial());
        SKULLS.add(XMaterial.PLAYER_HEAD.parseMaterial());
        SKULLS.add(XMaterial.ZOMBIE_HEAD.parseMaterial());
        SKULLS.add(XMaterial.CREEPER_HEAD.parseMaterial());
        SKULLS.add(XMaterial.PIGLIN_HEAD.parseMaterial());
        SKULLS.add(XMaterial.SKELETON_SKULL.parseMaterial());
        SKULLS.add(XMaterial.WITHER_SKELETON_SKULL.parseMaterial());
}```
and then the check that fails to see my material as a skull:

   ``` public static boolean isSkull(final Block block){
        final Material blockMaterial = block.getType();
        if (SKULLS.contains(blockMaterial)){
            return true;
        }
        return false;
    }```
When I test it in 1.20 it works fine, but in older versions, the skulls seems to not be recognised as "skull"
tender shard
#

print out the contents of the list and see what it actually contains

upper hazel
#

what event to take to understand that the player threw an item from the right hand in the inventory

tender shard
#

threw? wdym?

upper hazel
#

Left

#

what event to take to understand that the player threw an item from his right hand using his inventory and mouse

#

left hand

remote swallow
#

right or left then

tender shard
#

i still don't understand

remote swallow
#

you say right then left

upper hazel
#

left

remote swallow
#

you cant drop from ur off hand

upper hazel
remote swallow
#

thats just it being in an offhand

upper hazel
#

i need know when player drop item in left

#

hand

remote swallow
#

its not dropped from the off hand

#

you have to tell if its from offhand by slot number

upper hazel
#

in short, how to understand that a certain item in the off hand is missing when the player does something in the inventory

remote swallow
#

listen to the inventory events

upper hazel
#

what is more specific

remote swallow
#

InventoryClickEvent InventoryDragEvent

upper hazel
#

i just give certain effects when the item is in off hand and need to remove them when it is not so

#

DEMM

#

someone uploaded
?

#

i hope not

plain plaza
#

I am confused on why this isn't working. Currently using 5.1.0 of protocollib.

    private void setInvisible(Player player) {
        try {
            PacketContainer metaDataPacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA);

            metaDataPacket.getIntegers().write(0, entityId);
            WrappedDataWatcher dataWatcher = new WrappedDataWatcher(metaDataPacket.getWatchableCollectionModifier().read(0));
            dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
            metaDataPacket.getWatchableCollectionModifier().writeSafely(0, dataWatcher.getWatchableObjects());
            
            ProtocolLibrary.getProtocolManager().sendServerPacket(player, metaDataPacket);
        } catch (Exception err) {
            err.printStackTrace();
        }
    }```

Here’s the error
```java
java.lang.ClassCastException: class net.minecraft.network.syncher.DataWatcher$Item cannot be cast to class net.minecraft.network.syncher.DataWatcher$b (net.minecraft.network.syncher.DataWatcher$Item and net.minecraft.network.syncher.DataWatcher$b are in unnamed module of loader java.net.URLClassLoader @5ce65a89)```

Seems to be throwing this error.
tender shard
twilit basalt
#

When I have a FileConfiguration of my own yaml file, should be reloading config done async?

carmine mica
tender shard
twilit basalt
tender shard
tender shard
#

to sort the list

remote swallow
#

that becomes not async

tender shard
#

no shit

#

that's the main method

#

to just print out everything

carmine mica
#

not really, you just add all the cfs to an array, return a cf that completes when the allOf completes

tender shard
carmine mica
#

right, so you do return CompletableFuture.allOf(cfs).thenApply(some lambda)

tender shard
#

hmm let's try

carmine mica
#

also, can you add to HashSet from multiple threads at once? I didn't think it was thread safe

tender shard
#

well there is no thenSupply

carmine mica
#

why do you need supply?

#

just use apply

tender shard
#

to return something?

carmine mica
#

yeha, that takes a function to return your list

tender shard
#

but apply feels weird to use, I dont need the parameter

carmine mica
#

the parameter is useless, its Void from the allOf

tender shard
#

I know, hence I don't want to use it lol

carmine mica
#

I mean that's what allOf is for

#

like, you can't not have a parameter

#

you could create a new CF and complete it inside a thenRun I suppose if you really didn't want an ignored param

#

and then return that other CF

tender shard
#

thx I now came up with this

    public @NotNull CompletableFuture<List<JavaInstallation>> findInstallationsAsync() {
        Set<JavaInstallation> installations = ConcurrentHashMap.newKeySet();

        return CompletableFuture.allOf(searchDirectories
                        .stream()
                        .filter(File::isDirectory)
                        .map(location -> CompletableFuture.runAsync(() -> installations
                                .addAll(new DirectoryCrawler(location, OperatingSystem.CURRENT).findInstallations())))
                        .toArray(CompletableFuture[]::new))
                .thenApply(Void -> installations.stream().sorted().collect(Collectors.toList()));

    }
carmine mica
#

yeah, way nicer than using the latch that you have to catch the intertupt exception and what not

wary topaz
#
ps.send(new ClientboundSetEquipmentPacket(npc.getBukkitEntity().getEntityId(), List.of(new Pair<>(EquipmentSlot.HAND, CraftItemStack.asNMSCopy(pickaxe)))))```

```md
Incompatible types. Found: 'java.util.List<com.mojang.datafixers.util.Pair<org.bukkit.inventory.EquipmentSlot,net.minecraft.world.item.ItemStack>>', required: 'java.util.List<com.mojang.datafixers.util.Pair<net.minecraft.world.entity.EquipmentSlot,net.minecraft.world.item.ItemStack>>'```
carmine mica
#

you are using the wrong EquipmentSlot, as the error lays out pretty clearly

#

also, isn't there API for changing equipment for an entity?

wary topaz
#

tysm man

#

I'm making an npc

sage patio
#

how

trim lake
remote swallow
#

you can ignore those

trim lake
#

Probably but its anoying xD

#

Btw. What is correct option tu pick? Package/install? I saw some tutorial where was install use, but someone told me is wrong

remote swallow
#

package

trim lake
#

So tutorial was wrong... thanks

fleet imp
#

how do i set an armor stand's helmet

flint coyote
#

Since an armorstand is an entity, you set it just like you would for a skeleton/zombie etc

near mason
#

Player.clearActivePotionEffects throw NoSuchMethodException?

remote swallow
#

do you have paper or spigot api in ur pom

near mason
#

paper

remote swallow
#

do you run paper or spigot

near mason
#

paper

remote swallow
#

update paper

near mason
#

plz dont whereami me

remote swallow
#

and

#

?whereami

near mason
#

how do i

remote swallow
#

download latest from their website

near mason
#

ok ty

sullen marlin
#

?kick @hamit

undone axleBOT
#

Member "@hamit" not found.

near mason
#

why

sullen marlin
#

?kick @near mason

undone axleBOT
#

Done. That felt good.

near mason
#

why did i got kicked?

wary topaz
#

woo hooo

remote swallow
#

update premium vanish

wary topaz
#

they update it every single day

upper hazel
#

who heard about the new restrictions in microsoft

#

now you not can use mincraft logotip

#

end e t c

opal carbon
#

what

remote swallow
#

it doesnt have subtitles

upper hazel
#

in short: you can not use everything related to minecraft in your projects

remote swallow
#

oh that eula change

upper hazel
#

logotips, game name

remote swallow
#

yeah i saw it a few days ago

fierce hawk
#

Hi, I am trying to add a heart to the player when they complete an advancement but this PlayerAdvancementDoneEvent also runs even if the player gets a crafting recipie unlocked. How do I change it so it only adds the heart when the player gets a real advancement such as [Stone Age]
I am using 1.20.1

@EventHandler
    public void onAdvancement(PlayerAdvancementDoneEvent event) {
        Player player = event.getPlayer();
        Advancement advancement = event.getAdvancement();
        Bukkit.getLogger().info("Heart Advancement Debug: " + advancement.getCriteria());
        if (!advancement.getCriteria().contains("has_the_recipe")) {
            AttributeInstance attribute = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
            double newHealth = attribute.getBaseValue() + 1;
            attribute.setBaseValue(newHealth);
        }
    }
carmine mica
#

Well they’re all “real” advancements.

#

You can filter out recipe advancements by checking the key for a prefix “recipe/” or “recipes/” depending on the version

sullen marlin
#

Is getCriteria showing what you expect? Otherwise yeah they all have a key starting with recipe or crafting or something

quiet ice
#

Yes - I'm necroing but whatever

fierce hawk
#

Yeah I believe get criteria and recipe/ sort of work. I noticed some inconsistency since when I crafted a crafting table, It was considered as a advancement and added a heart to my health.

#

You can see console messages here. All I did was get wood and a crafting table in a fresh new world:

outer river
#
public static List<Category> getAllowedCategories(Player player){
        List<Category> list = new ArrayList<>();
        
        for (Category category : getAllCategory()) {
            if (player.hasPermission(category.getPermission())) {
                list.add(category);
            }
        }
        return list;
    }

Hello, i'm searching for a way to add category in a list only if player has permission, but if the player is op, this return me all category avaible...
I though patch this by de-oping player if he is op then, op him again but i dont like this method, do you have a better solution pls ?

trim lake
rough ibex
#

didn't we already discuss this

#

also not even on topic

#

good job

sacred mountain
#

just found yet anotehr way to crash my client with my plugin

#

wonderful

#

error rendering item

#

great

slender elbow
outer river
#

because getEffectivePermissions does't seems to contain my perm even if i have it when i'm op

slender elbow
#

well it won't list every single permission to ever exist only because you are op

#

i am suggesting it because it doesn't list permissions you do not explicitly have

zinc lintel
#

can anyone help me with custom configs?

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!

zinc lintel
chrome beacon
#

Create a new file object and call mkdir or mkdirs

echo basalt
#

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

chrome beacon
#

?notworking

undone axleBOT
#

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

eternal oxide
#

?configs

undone axleBOT
zinc lintel
# echo basalt ?nocode

this is the code to create the folder:

        customDirectory = new File(getDataFolder(), "languages");
        if (!customDirectory.exists()) {
            customDirectory.mkdir();
        }
eternal oxide
#

change it to mkdirs()

zinc lintel
#

okey

wary topaz
#

whats the packet for when a player clicks on it

kindred sentinel
#

Is there a way to find the chunk in which the host loads the most?

sweet kiln
#

Hello, I am using ProtocolLib and I am spawning an entity, but I would like to make this entity lie down. How can I achieve this? It's a Zombie.

wary topaz
#

lie down?

#

I think there is a packet for when an entity lies down

sweet kiln
wary topaz
#

Dont relie on chat gpt

tribal quarry
sweet kiln
#

Im trying using bed packet

kindred sentinel
outer river
# slender elbow well it won't list every single permission to ever exist only because you are op

thx, i understood what you mean, finnally works with this code 🙂

public static List<Category> getAllowedCategories(Player player){
        List<Category> list = new ArrayList<>();
        List<String> permList = new ArrayList<>();
        
        
        for (PermissionAttachmentInfo perms : player.getEffectivePermissions()) {
            permList.add(perms.getPermission());
        }
        for (Category category : getAllCategory()) {
            if (permList.contains(category.getPermission())) {
                list.add(category);
                System.out.println(category.getName());
            }
        }
        return list;
    }
wary topaz
#

yea but dont relie on it

#

rely

sweet kiln
#

Im am Brazilian, and my english is not very good for this question

rough ibex
#

please do not use chatgpt

#

use it only if you know what you are doing and are aware of what it is and can do

kindred sentinel
#

Hmm yeah, ChatGPT can't make difficult plugins

wary topaz
#

I used it for plugin messaging cause I did not want to code a completeable future

tribal quarry
sweet kiln
#

Im used to translate text

tribal quarry
wary topaz
#

whats the full name

tribal quarry
wary topaz
#

no

#

nms

#

oh I forgot to mention I dont use protocollib

chrome beacon
#

If you're working with nms you need to specify version

#

And if you use mojmaps or not

wary topaz
#

latest

#

1.20.1

#

i use mojmap

#

s

#

remapped-mojang

tribal quarry
wary topaz
#

client?

tribal quarry
#

Search in your ide, I think that's it

#

Yea

zinc lintel
#

i got a problem.
i try to load a String from a custom config File but it gives me an error that said null
this is the code:
in the util:

    public static String getEnglishConfigItem(String key){
        return EnglishLanguageFile.getLanguageFile().getString(key);
    }

in the Main:

String EnglishRollMessage = EnglishLanguageUtils.getEnglishConfigItem("Roll");
getCommand("roll").setExecutor(new rollCommand(prefix, language, broadcast, EnglishRollMessage));

in the command:

    private final String language;
    private final boolean broadcast;
    private final String englishmessage;

    public rollCommand(String prefix, String language, boolean broadcast, String EnglishMessage){
        this.prefix = prefix;
        this.language = language;
        this.broadcast = broadcast;
        this.englishmessage = EnglishMessage;
    }
kindred sentinel
#

I use obfuscated version of NMS 🫠

remote swallow
#

why

kindred sentinel
#

Because.

wary topaz
#

ps.send(new Clientbound);

#

i cant find it

remote swallow
#

ServerboundInteractPacket it seems

chrome beacon
wary topaz
#

thanks

quaint mantle
kindred sentinel
#

💀💀💀

chrome beacon
#

Use a paste

#

?paste

undone axleBOT
kindred sentinel
# quaint mantle Imagine debugging it.

I really dont use NMS now, but i was trying to use it on second day of learning java&bukkit thats why i had some troubles (I still have that) with installing remapped version

quaint mantle
#

Just dont use nms

zinc lintel
kindred sentinel
#

I am not using it now

kindred sentinel
#

Sooo use obfuscated nms version is not very bad idea))

chrome beacon
chrome beacon
#

Not in the code you sent

remote swallow
#

you set stuff other than "Roll"

zinc lintel
chrome beacon
#

Well Roll is never set

zinc lintel
remote swallow
#

so why are you coming for help with Roll when you know it wont work

wary topaz
#
                    ps.send(new ServerboundInteractPacket(npc.getBukkitEntity().getEntityId(), plugin.menus.boxServerMenu(p.getPlayer())));```
```md

'ServerboundInteractPacket(net.minecraft.network.FriendlyByteBuf)' in 'net.minecraft.network.protocol.game.ServerboundInteractPacket' cannot be applied to '(int, void)'```

What is the correct way to do this?
drowsy helm
#

What is boxSetverMenu

#

You are passing a function

carmine mica
#

wait, you are trying to send a serverbound packet?

zinc lintel
chrome beacon
wary topaz
#

I want when the player interacts with the npc itopens that gui

remote swallow
#

it wont, you dont add Roll to the config, set Roll then come back

remote swallow
wary topaz
#

how?

drowsy helm
#

Use the entity interact packet

wary topaz
#

its nms though

remote swallow
#

packet events is the easier option

drowsy helm
#

Then just open a regular inventory

zinc lintel
chrome beacon
wary topaz
#

what is a packetevent

opal carbon
#

a library

remote swallow
#

made by resident retro

wary topaz
#

thankis

remote swallow
#

did the girl deny you

wary topaz
#

do I need to install their plugin?

remote swallow
opal carbon
wary topaz
#

could I have assistance with that

opal carbon
#

if you include it as part of your plugin you dont need to

wary topaz
#

where even is the maven

opal carbon
remote swallow
#

on jitpack

opal carbon
#

found this link on their github

wary topaz
#

ty

sage patio
#
public static String test(ItemStack item) {
        NBTItem nbt = new NBTItem(item);
        return nbt.getString("test");
    }

what this method returns if nbt does not contains test?

remote swallow
#

null probably

zinc lintel
#

nvm got it working

wary topaz
#

step 2 is not very clear

sage patio
#

thanks

remote swallow
wary topaz
#

not reall

#

y

chrome beacon
sage patio
#

also one more question, if someone clicks on an air in his inventory, getCurrentItem returns AIR or null?

remote swallow
#

could be either

sage patio
#

then i check for both, thanks

chrome beacon
#

Yeah check for both

#

Spigot API is very inconsistent when it comes to AIR or null

tender acorn
#

iirc, there's no air in inventory

#

should be null

#

correct me if wrong

sage patio
#

both are air lol

#

because he cannot pickup anything

carmine mica
kindred sentinel
#

It seems to me that I figured out how to get the supposed chunk with lag machines, but this is too wild and not reliable... Every 30 seconds compare TPS with TPS 30 seconds ago, and if TPS went down sharply then get all the chunks with players that entered in a new chunk in last 10 seconds

#

Or something like that

#

This is absolutely not reliable, however, this is the only thing I could think of

wary topaz
#
<pattern>com.github.retrooper.packetevents</pattern>
                                    <shadedPattern>me.lobbymanager.packetevents.api</shadedPattern>
                                    <pattern>io.github.retrooper.packetevents</pattern>
                                    <shadedPattern>me.lobbymanager.packetevents.impl</shadedPattern>
                                    <pattern>net.kyori</pattern>
                                    <shadedPattern>me.lobbymanager.packetevents.kyori</shadedPattern>

this took a while lol

#

so how do I use it lmfao

sweet kiln
remote swallow
chrome beacon
#

Probably not

wary topaz
#

no

#

@PacketHandler
public void onPlayerClickNPCPacket(ServerboundInteractPacket event) {

}
#

its that easy?

#

lmfaoo

#

wait do I have to register the event?

remote swallow
#

probably

wary topaz
#

omg this is just spigot

sweet kiln
#

It's my first time using Protocolib, so I absolutely know nothing. I even tried to spawn here, but it didn't work.

wary topaz
#

someone wanna help me register the event

#

while I go get some hot coco

#

haha

chrome beacon
#

Read the docs

remote swallow
#

probably PacketEvents.getAPI().getEventManager().registerListener(instance)

#

very much spoon

#

ill fork a potato

young knoll
#

🥄

#

Spoon feed bad

wary topaz
#
        PacketEvents.getAPI().getEventManager().registerListener(this);

Method 'onPlayerClickNPCPacket(net.minecraft.network.protocol.game.ServerboundInteractPacket)' is never used

young knoll
#

Yeah that’s just a warning

#

You probably would get the same thing with spigot events

wary topaz
#

you dont

young knoll
#

¯_(ツ)_/¯

wary topaz
#

@PacketHandler
public void onPlayerClickNPCPacket(ServerboundInteractPacket event) {

}
young knoll
#

The method is only being called reflectively so I doubt IntelliJ will find the link

flint coyote
# wary topaz you dont

you do. However after using the same annotation a bunch of times, IJ asks you whether you want to consider annotated methods as implicitly called. Same for variables

trim elk
near mason
#

İf i set item of snoeball to air will it disappear or it'll be invisible?

fleet imp
#

is there an event for scoreboard update

sweet kiln
young knoll
#

Define scoreboard update

fleet imp
#

someone triggers a criteria

young knoll
#

Most scoreboards are updated manually by a plugin

tribal quarry
young knoll
#

However the ones that reflect statistics can be detected with StatisticIncrementEvent

near mason
fleet imp
#

am I able to create my own listeners

young knoll
#

You mean your own events?

#

Yes

fleet imp
#

how

young knoll
#

Make a class that extends event

#

Give it the fields and stuff you want

#

And make sure it has both a static and non static getHandlerList method

livid dove
#

About to start work on a Logging plugin and was wondering for folk's input on my current interface structuring for the log data before I go any deeper into concrete stuff

#

Version with methods for context

slender elbow
#

Lookupable 👎
BeingAbleToBeLookedUpInADataSource 👍

livid dove
echo basalt
#

hm I wonder how fun it'd be to make a replay plugin

#

Like hypixel's atlas

vapid grove
livid dove
echo basalt
livid dove
#

I wanna make one now just on dang principle

young knoll
#

What

livid dove
# young knoll What

Imagine someone gets hit by an xray ping plugin, and it begins to auto record them from the moment it pings

echo basalt
#

maybe or maybe not

#

You know they have some pretty advanced wacky stuff when it comes to bot detection on skyblock right?

#

A dude once got banned for picking up a wooden axe dropped by a bot 2 weeks prior

livid dove
#

Oh i have no doubt.

I guese my point is that I dunno, id legit feel extremely guilty if I had a tool like that and didnt make it available to server owners

echo basalt
#

they're hypixel

#

They have NDAs and noncompetes for everything

#

And they're paid well enough for that kind of stuff

#

There's also a ton of core logic that hooks into their spigot fork

livid dove
#

Oh yeah no doubt fr.

But like I dunno I feel in development in general sharing of big break throughs that are not competing, but complimentary to the community as a whole is just good sportsmenship.

E.g: When Hinge did Video based face verification and then shared it with other dating apps by letting the company they contracted have sale rights

#

E.g: Imagine someone took Foila for paper tommorow and somehow made region borders just work (so no need for merging) so it ends up as true multithreading? Then imagine they made that proprietry NDA CIA mega National Treasure Davinci code secret shit?

It'd be incredibly bad etiquette imo

echo basalt
#

Well

#

Imagine someone's paying you to make a DRM software so that your game isn't crackable

#

And they're paying you a ton

#

Would you really license it out?

livid dove
# echo basalt Would you really license it out?

I respect the analogy but i'd argue as we are all just working within the same game / community, something like anti Xray isnt gonna hurt the bottom lines of any one server if spread out

echo basalt
#

Well

#

What if you had a magic folia fork made for 1.8 and your anti-xray is closely coupled with your fork?

#

Would you go out of your way, during work ours, to work on making a public version of it?

#

Hypixel isn't a FOSS company

livid dove
#

That is utterly fair

#

And i mean props for them showing some of the technical specs i guese

echo basalt
#

Yeah

#

Time to make my own version of it

#

for shits, giggles and github stars

livid dove
echo basalt
#

Eh might as well

#

Ideally I'd make this multi-platform but whatever

#

I might just make a crappy common module

livid dove
echo basalt
#

yeah every time I decide to do something multi-platform things nuke themselves

livid dove
#

You looked into abstract factory pattern?

echo basalt
#

Yuh

#

thing is there are some things that are hard to make multi-platform

#

Like I started making my minigamelib multi-platform so it supports minestom

#

but there's literally nothing I can do

#

Because all the bukkit events don't match minestom events

#

And I'd have to write so much multi-platform code that it's like 5x bigger than just rewriting the spigot base

livid dove
#

My advice? Make it all abstract. Like every aspect. Infact one sec lemme grab something

echo basalt
#

That's what I did for my skyblock core

#

Just look at this beauty

echo basalt
#

so many interfaces n abstract classes

young knoll
#

Hey epic you want to write code to save and load entire sections of world to a database

#

Kek

livid dove
#

Sometimes its not the ammount, but where they are.

E.g: Because of the highlighted classes, this plugin could be expanded to literally any skill based, item based, or entity based plugin api.

Because the Legend is an Empty SkillHolder (it will be populated with progression interface based methods in the not too distant future) it can be expanded to other entities, items, locations, god dang furniture if I wanted.

If you are gonna do multi platform projects, id highly suggest doing UML for at least the interfaces side of the project as it helps with the whole "have i actually designed this structure to be easily expanded to other platforms"

echo basalt
#

last time I used a uml generator it made a 25gb png

livid dove
#

Lmao

#

Use intelij's one

echo basalt
#

I might not have it

livid dove
#

It is on ultimate and shift ctrl alt u

echo basalt
#

Yeah I don't have ultimate for whatever reason

#

Can't bother reinstalling intellij

livid dove
#

God the extra functionality tho

echo basalt
#

I don't use it

livid dove
#

If ur going into the domain of multi platform software, I would learn some of them :L

#

Just imo foc

#

ofc

echo basalt
#

hmm how the fuck can I make this super simple

echo basalt
#

Oo there's a super hacky way of doing this that allows me to wrap entities

wary topaz
#

and yes its a spigot plugin

sweet kiln
#

How to send packet for "fake player" to sleep?

#

My code

livid dove
rough ibex
#

your pom is bad

#

what do you have

#

it also literally tells you the issue

#

read the error in full

quaint mantle
#

not much of a coder here 🤣

rough ibex
#

"Non-parsable POM"
"Expected but found"

copper lake
#

configuring it gives another error

quaint mantle
#

hey thats my friend

rough ibex
#

then fix that

#

show your POM

#

look at others

#

see what yours should be like

copper lake
#
<repositories>
    <!-- This adds the Spigot Maven repository to the build -->
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <!--This adds the Spigot API artifact to the build -->
    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.20.1-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>
</dependencies> ```
#

its the spigot one

rough ibex
#

is that all of it

copper lake
#

yes

rough ibex
#

what do you mean its the spigot one

#

where did you get it

copper lake
rough ibex
#

"In order to access the Spigot API using Maven, developers need to add both of the following to the pom.xml: 1) the Spigot Maven repository and 2) the Spigot API artifact. These additions are excerpted in the following code snippet:"

#

emphasis mine

copper lake
#

what is the spigot api artifact

orchid trout
#

how did you setup your maven project

#

did you just replace the default pom.xml

copper lake
copper lake
orchid trout
#

are you using intellij.

#

?

copper lake
#

not sure what that is

#

so no

orchid trout
#

what ide are you using

copper lake
#

eclipse

orchid trout
#

oh ok

#

click on new

#

new project

#

i think

#

then there should be a maven folder

#

and im going to find a tutorial

bitter rune
#

i understand how to do public booleans, ints, etc and save it to a file, but how do i save "Material SaveBlock = block.getType();" to a file?

orchid trout
#

how are you saving the primitives to a file?

bitter rune
#

that should be everything you need to do it yourself

orchid trout
#

Material#name()

#

put the string into the yml file

#

Material.valueof(String)

bitter rune
#

thanks

#

that actually helped i figured it out

copper lake
#

@orchid trout i did it and its the same error

copper lake
#

one sec let me blur my name

copper lake
#
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.masai</groupId>
  <artifactId>hibernatedaoapp</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <properties>
 <maven.compiler.source>1.8</maven.compiler.source>
 <maven.compiler.target>1.8</maven.compiler.target>
 </properties>
 <description> </description>
    <build>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                  <source>1.7</source>
                  <target>1.7</target>
              </configuration>
          </plugin>
      </plugins>
   </build>
      <repositories>
       <repository>
         <id>spigot-repo</id>
         <url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
       </repository>
   </repositories>
      <dependencies>
       <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.19.4</version><!--change this value depending on the version or use LATEST-->
           <type>jar</type>
           <scope>provided</scope>
       </dependency>
   </dependencies> ```
worldly ice
copper lake
worldly ice
#

very bottom

copper lake
#

ok

worldly ice
#

that seems like a project error

#

i dont use eclipse so i dont think i'll be able to help you with that

orchid trout
#

reload maven

copper lake
#

i can send you what it gave me in command prompt

orchid trout
#

right click project

#

maven

worldly ice
#

oh your version is not valid

copper lake
#

how do i set it to 1.19.4

worldly ice
#

it should be 1.19.4-R0.1-SNAPSHOT

copper lake
#

alright

orchid trout
#

3

copper lake
#

ok so i mvn clean installed, and it gave me a compiled jar only with the pom not the entire folder

worldly ice
#

what's your project structure?

#

it should look something similar to that

#

except replace com.datasiqn.arcadia with your own group and artifact

#

eclipse should've done that for you which is weird

worldly ice
#

why are you using both gradle and maven

#

a simple gradlew build should build the jar

rare rover
#

erm

#
public static @NotNull String colorizeHex(@NotNull String string) {
        Matcher matcher = HEX_PATTERN.matcher(string);
        while (matcher.find()) {
            final String hexString = matcher.group(1);
            string = string.replace("&#" + hexString, ChatColor.of(hexString) + "");
            matcher = HEX_PATTERN.matcher(string);
        }
        return colorize(string);
    }```
#

java.lang.IllegalArgumentException: Could not parse ChatColor FF0000

#

oh

#

i see why

copper lake
worldly ice
#

they are build tools used to compile jars

#

if you have one you don't need the other

#

i think eclipse should have a button to just compile

copper lake
#

i saw you need maven to compile on reddit

#

i didnt know i could do it wit gradle

rare rover
#

why tf is matcher.group(1); returning FF0000 but matcher.group(0); is returning &#FF0000

#

am i missing something

copper lake
worldly ice
#

based on what crackma said i assume you right click your project

#

and there should be a gradle tab

#

nope nvm

#

that is for reloading the project

#

there should be a tab somewhere called "Gradle Tasks"

#

right click the build one and run that task

copper lake
#

i dont see no gradle tasks

worldly ice
#

let me open eclipse rq

#

and see where it is

rare rover
worldly ice
#

ok nvm i guess my eclipse broke

#

try running gradlew build in the project's root directory @copper lake

worldly ice
#

paste your build.gradle

robust helm
#

help

worldly ice
#

also it seems that you didn't write that code

#

is there any reason why you are manually compiling?

robust helm
#

HELP

worldly ice
#

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

copper lake
#

It’s an open source GitHub

worldly ice
#

do they not provide already compiled jars?

#

can you send the link to the github?

copper lake
#

No

worldly ice
#

is it like a premiun resource then?

copper lake
worldly ice
#

ah it is a premiun resource

#

makes sense

robust helm
#

why does YamlConfiguraiton.getLocation() returns null?

worldly ice
#

ok so looks like that project uses nms @copper lake

#

which would require you to run build tools for each version it supports

echo basalt
#

or run a script that does it for you

worldly ice
#

yeah that works too

copper lake
#

so what should I do

worldly ice
#

?bt

undone axleBOT
worldly ice
#

this honestly seems like a lot of effort for a $7 plugin

copper lake
#

I tried doing the build tools but it just says unable to access

echo basalt
#

your status says otherwise

copper lake
grand raven
#

?paste

undone axleBOT
robust helm
copper lake
#

im gonna get on tomorrow

#

its 11 for me

echo basalt
#

solid 6am here

grand raven
#

Scoreboard Help

sterile breach
#

Hello, its possible to convert an arraylist (and his instances) with gson?

quaint mantle
#

in the ClientboundBlockDestructionPacket packet
what does id refer to?

worldly ice
#

the id of the entity that is destroying it

quaint mantle
#

ohh ty

worldly ice
#

which apparently can just be some random value

#

and doesn't actually need to be a valid id

sterile breach
karmic sapphire
karmic sapphire
#

This is a kinda cute vid ngl.

orchid trout
tender shard
#

you can also just use "install" in the maven tab

placid moss
#

his tps is higher than twenty 🤔

tender shard
#

and yet people claim spigot is poorly optimized 🥲

grizzled oasis
#

H,i am having some issues with this "Pathfinder" for my pets when i try to go up they just go and trying getting in up on me but not working so it goes from one corner to another or just sometimes by moving they bug totally (and the animation is laggy), I tried fixing them by myself but I just lost hope after the 10th try
https://paste.md-5.net/acajaceweb.cs

tall dragon
#

That doesnt rlly seem like a pathfinder

#

What exactly ru tryna do

grizzled oasis
#

Im doing an armorstand / pet following the player and im doing it with a runner, the armorstands follow the player around and it does nothing the armor stand on its own

#

no particles nothing

#

just following and watching

lyric meteor
#

nms to respawn the player?

grizzled oasis
tall dragon
#

Not sure thats generally done using teleports. It will probably look real snappy

grizzled oasis
#

yes it does

tall dragon
#

Most "pet" plugins do this with actual pathfindergoals i think. But if u go up a ladder for example i believe it will just teleport when u go too far

grizzled oasis
shell robin
#
    private Map<Player, Boolean> playersWithWaterAbility = new HashMap<>();

    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        ItemStack itemInHand = player.getInventory().getItemInMainHand();

        if (itemInHand != null && itemInHand.getItemMeta().getDisplayName().equals(ChatColor.AQUA+"Water Ability")) {
            if (!playersWithWaterAbility.containsKey(player)) {
                playersWithWaterAbility.put(player, true);

                player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, Integer.MAX_VALUE, 0, false, false));

                ItemStack glassHelmet = WaterAbilityItem.createWaterItem();
                player.getInventory().setHelmet(glassHelmet);

                player.getInventory().setItemInMainHand(null); // Remove from hand

                event.setCancelled(true); // Prevent default interaction
            } else {
                playersWithWaterAbility.remove(player);

                player.getInventory().setHelmet(null);
                event.setCancelled(true); 

            }
        }
    }```
How can I remove the effect when the player removes the item from their head
smoky anchor
shell robin
smoky anchor
grizzled oasis
sterile breach
#

hi, is retrieving all the contents of a redis cache a bad thing to be avoided (at a certain event)? or is it good?

upper hazel
#

I made a plugin to add attrebute to the player when he has a certain item in his left hand, but there are bugs. there is a chance that the effect will not be removed when quickly switching between hands. Tell me how to fix

young knoll
#

What attribute

#

Because if it’s an actual attribute you can apply it to an item

upper hazel
#

player attribute

young knoll
#

Yeah just apply it to the item directly

upper hazel
#

a?

young knoll
#

ItemMeta has methods for that

twilit basalt
#

when I addDefaults in for loop and when for loop end, I save config, why it does not show? If I am right, it should add paths with values there if they are not present?

upper hazel
#

give the same characteristics to the item???

young knoll
#

Yes

upper hazel
#

but how will it affect the player

young knoll
#

Put a default config in your jar and use saveDefaultConfig

young knoll
twilit basalt
#

According to MemoryConfiguration it should do

#

I am not using configuration from plugin

young knoll
#

Then add a default file to your jar and use saveResource

#

addDefaults just adds invisible default values that will be used if no value is defined

twilit basalt
#

Well... I guess I will have to do it harder way

#

as I already said, it is not configuration from plugin

young knoll
#

What is it then

twilit basalt
#

StaffProtect/addons/global_config.yml

young knoll
#

You can still saveResource that

twilit basalt
#

sadly not

#

it is not in any plugin

young knoll
#

Alright then you can use the internal stuff saveResource uses

twilit basalt
#

well I would like but I do not understand it :/

young knoll
#

It’s basically just Class.getResource

twilit basalt
#

It uses basically similar things although I added completable future and saving in reload config

upper hazel
#

does it happen automatically?

smoky anchor
#

yes

upper hazel
#

oh my god

#

you have to rewrite the whole plugin(

#

I have everything set to manual change

#

Is there anything in the documentation about this?

young knoll
#

What do you need to know

smoky anchor
young knoll
#

^

smoky anchor
#

So MC wiki might answer

grizzled oasis
#

Hi im trying using XParticle with the method

blackSun(plugin, 1, 1, 10, ParticleDisplay);

What is particle display and i need to use a new instance or there's something else?

upper hazel
#

or need update

young knoll
#

Not sure tbh

#

Try it and see

smoky anchor
#

I don't get what you mean by "process of finding an object in the left hand"
and needing an update
If you change the attribute of the item the player will obviously be affected by the change.

smoky anchor
upper hazel
#

I heard the phrase - mistakes make us stronger but damn these mistakes are so expensive

young knoll
sterile breach
#

hi, is retrieving all the contents of a redis cache a bad thing to be avoided (at a certain event)? or is it good?

young knoll
#

I would guess they would update immediately but idk

grizzled oasis
twilit basalt
#

Oh I see

young knoll
#

Check their documentation

#

Not sure many people here will know

twilit basalt
#

Particle display is from com.cryptomorin.xseries.particles package

grizzled oasis
#

docs is not updated

young knoll
#

This is why we don’t support legacy and modern versions together

#

:p

twilit basalt
#

from what I see in this class you can use either

ParticleDisplay.of(Particle);

or

ParticleDisplay.display(Location, Particle);
grizzled oasis
twilit basalt
#

I mean, I never heard of that plugin so I am just searching for some methods there, although better would be to make plugin on latest version

young knoll
#

Not even just latest

#

Pretty sure particle names have been unchanged for a long time

grizzled oasis
#

the fact im using 1.20.1

young knoll
#

1.13 maybe

grizzled oasis
#

the api is updated on last version not the wiki tho

young knoll
#

If you’re using 1.20 why not just use the spigot api

grizzled oasis
young knoll
#

What

twilit basalt
#

I did not understand it as well

sage patio
#

what does Caused by: java.lang.IllegalStateException: zip file closed means?

eternal oxide
#

?paste full stacktrace

undone axleBOT
young knoll
#

Generally happens after reloading

#

Or when replacing a plugin at runtime

sage patio
#

thanks

sage patio
#

its finally done

#

a community contributor of MTVehicles decided to care and add the methods i need to the api

#

(he updates the plugin always, the owner is dead D:)

young knoll
#

Rip owner

golden cargo
#

.

ocean hollow
#

is it possible to create an inventory with the title of Component?

#

i need to add font to title and use translate

young knoll
#

Yes and no

ocean hollow
#

how is that?

young knoll
#

Yes you can with NMS

#

Yes you can with the api once Chocos PR gets merged

#

No you can’t with the api right now

smoky anchor
#

Choco MD, please, merge faster.

young knoll
#

It’s up to md

onyx fjord
#

is it normal that glint dissapears when i rename an item with custom enchant?

young knoll
#

Is the enchant still present

#

I’m going to guess mc recognizes it’s not a proper enchantment and yeets it

onyx fjord
young knoll
#

Then ye

#

Mc yeets it

smoky anchor
#

I think that is spigot specific, it likes to delete "invalid" enchants
in vanilla, you can put close to anything into nbt and it will keep it

young knoll
#

It’s not just in NBT tho

#

It’s in the enchantment tag, which is managed by mc

#

Especially in the anvil gui

onyx fjord
#

am i doing something wrong or intellij has a glitch

#

im literally catching it?

#

oh i see

tender shard
#

just use getOrDefault instead of using a try/catch

onyx fjord
#

i gotta use the Integer class

tender shard
#
pdc.getOrDefault(getKey(), NO_LEVEL);
onyx fjord
#

oh thanks

#

didnt know thats a method

plain plaza
#

I am confused on why this isn't working. Currently using 5.1.0 of protocollib.
I am attempting to make an armorstand invisible

    private void setInvisible(Player player) {
        try {
            PacketContainer metaDataPacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA);

            metaDataPacket.getIntegers().write(0, entityId);
            WrappedDataWatcher dataWatcher = new WrappedDataWatcher(metaDataPacket.getWatchableCollectionModifier().read(0));
            dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
            metaDataPacket.getWatchableCollectionModifier().writeSafely(0, dataWatcher.getWatchableObjects());
            
            ProtocolLibrary.getProtocolManager().sendServerPacket(player, metaDataPacket);
        } catch (Exception err) {
            err.printStackTrace();
        }
    }```

Here’s the error
```java
java.lang.ClassCastException: class net.minecraft.network.syncher.DataWatcher$Item cannot be cast to class net.minecraft.network.syncher.DataWatcher$b (net.minecraft.network.syncher.DataWatcher$Item and net.minecraft.network.syncher.DataWatcher$b are in unnamed module of loader java.net.URLClassLoader @5ce65a89)```

Seems to be throwing this error.
tender shard
#

?paste the full stacktrace

undone axleBOT
echo basalt
#

After 1.19 they changed the format

#

You'll want a list of wrappeddatavalues and skip the watcher entirely

tender shard
#

that's what happens when people use protocollib instead of just constructing the packet normally

echo basalt
#

Nms changed

tender shard
#

yeah, using the constructor one can easily see that

plain plaza
upper hazel
#

suggest an idea, I'm making a plugin for spawning structures, but I need to somehow get (select) certain biomes and search out all their locations

bitter rune
#

learned how to convert primitives to strings so far, now i know how to save to config, just need to convert them to material and I figured it out

twin venture
#

what event is responsible for moving items from a menu to a player inventory?

#

i want to make it so , player cant drag . and drop item in player inventory if he has KitEditor menu open .

#

just wana the event name , using old version

misty current
#

does AsyncPlayerPreLoginEvent get called before the player session is verified?

twin venture
#

i dont want to stop items from being moved in the same inventory

misty current
#

also you might want to check for InventoryDragEvent too

twin venture
#

oky

misty current
twin venture
#

there is getInventory , and getView?

upper hazel
#

hey were i can get minecraft code in tlauncher?

twin venture
#

gonna use InventoryClickEvent

upper hazel
#

or this not exists

twin venture
#

it works , but 3/5 of the times it pass ,

eternal oxide
#

because you didn;t also check the drag event

#

If you click the mouse and accidentally move the mouse a single pixel it counts as a drag

twin venture
#

alright

clever lantern
#

how to make a listener so if player places a shulker box it drops random item from config, also the chance per item is in config

upper hazel
#

I am making my own utility and I want to make an optimized code, rate the quality
1/10

#

what to add

simple schooner
#

Bro coding in a 4gb 8 year old pc is unbearable

#

Like it freezes every 10 minutes

plain plaza
#

It’s a packet entity, the armor stand isn’t real so spigot doesn’t see it.

#

I did create my own PacketArmorStand class so it’s somewhat bareable for spigot to recognize and see.

tender shard
tender shard
#

i'd just use World#getHighestBlockAt

upper hazel
tender shard
#

yeah true

#

btw you can also just use Material#isAir() instead of checking VOID, CAVE and normal AIR

quaint mantle
#

is there a commandExecution event?

@EventHandler
    public void onReport(somethingidkcommanexecution event) {
}```
upper hazel
#

oh ok

#

this all?

#

or smth else

quaint mantle
#

hmm

#

like I want to send a message when a player executes a command

tender shard
#

yeah but that doesn't allow you to get the actual command

quaint mantle
#

ik I explain in the worst way possible

#
 public void onReport(asdasdiasuidaisdiasd event) {
        DiscordWebhook wh = new DiscordWebhook(url);
        String messgage = String.format(message, event.getPlayer().getDisplayName());
        wh.setContent(messgage);
        try {
            wh.execute();
        } catch (MalformedURLException e) {
            System.out.println("[MoreReports] Invalid webhook URL");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}```
#

something like this

#

so do I use PlayerCommandPreprocessevent?

tender shard
#

oh yeah if you just want to see which commands they entered, then the PlayerCommandPreProcessEvent is fine

quaint mantle
#

alright thanks man

fair charm
#

Hello, I have an issue with the stonecutter. I've added custom head crafts to the stonecutter, but they are not displaying in the correct order. The order in which I added them is "books", "mailbox", "beer", "cake", "test," but they are showing up in a random order. I'm wondering if it might be in alphabetical order. However, when I select the first head, which should be "books," it correctly crafts the "books" head. It's just displaying the wrong head in the selection menu. I've searched online, but I haven't found a similar issue. Does anyone have a solution?

https://i.stack.imgur.com/vtVlS.png

carmine mica
#

There is no solution. You cannot have multiple stonecutter recipes that output the same item type

#

It’s also not a vanilla bug because you can’t define recipes like that in vanilla

carmine mica
fair charm
carmine mica
#

Read the issue I linked

fair charm
#

I hadn't noticed, thank you.

carmine mica
#

The order is set by the client, and it’s based on the output item type

#

just the item type, not anything custom about it

#

So if there are recipes with the same output item type, the order is undefined

tender shard
#

stupid vanilla

carmine mica
#

I mean vanilla has no concept of custom recipes that output items with nbt. You can’t create them with datapacks

#

Until you can, this isn’t a vanilla issue.

tender shard
#

yeah but mojang probably knows that plugins / mods etc would add custom recipes

carmine mica
#

Which is why it’d be a “feature request” not a bug report

#

Mods can add them

#

They just have to fix the client side too

tender shard
#

client mods, yes