#help-development

1 messages ยท Page 383 of 1

hazy parrot
#

well, user error

#

docs would say that permissions are like restful.count.<number>

smoky oak
#

cant you go to a void world and just list all events

#

and it might just be entityinteraceevent

ornate mantle
#

what would you call a drop chance of between 60% to 20%

hazy parrot
#

what

smoky oak
#

wide error margin

mighty pier
#

imagine using randomly generated numbers

#

so cringe

small hawk
#

Is someone here that is minecraft Sounds master, i have a sound on video, but i don't know how it's called in MC. i know it's neither server or dev help but if anybody has wide knowledge about it, please DM me

frank kettle
#

did webhooks change the way they work?

#

for some reason when im sending webhooks from server, its updating previous messages sent

#

๐Ÿค”

#

i know this aint spigot or bungee itself, but just curious if anyone also noticed if doing something alike.

late sonnet
frank kettle
#

yeah its updating previous messages details for some reason, in this case the author name

#

and no error on console ๐Ÿค”

late sonnet
frank kettle
#

the author of all the webhooks sent.

#

as seen the images there

late sonnet
#

try test this manually using postman and another webhook if happen then is a discord "feature" or bug not announced..

frank kettle
#

after i sent message, it updated all to Miau_

#

but

#

if i click on them, it shows what they were actually supposed to be

#

๐Ÿค”

#

this is weird

late sonnet
#

try reload the client... maybe is more than a client bug

#

(discord client)

frank kettle
#

my guess is there was an update that changed that ๐Ÿค”

frank kettle
#

some player 7 hours ago noticed this

#

now we cant see since they all got changed to Miau_ ๐Ÿ˜‚ but yeah... it was 12 hours ago

#

so its not just my client ๐Ÿค”

late sonnet
frank kettle
#

im not sure what you mean by manually

late sonnet
paper venture
#

If I do player.damage(...); will it deal damage ignoring all damage reduction? There is no setFinalDamage but I need to deal damage that ignores all damage reduction...

rough drift
#

player.setHealth(player.getHealth() - damage)

paper venture
#

I want to make a player ignore other players armor, but it should look like a normal attack, just setting health may be unwanted, moreover killing by that would not be counted as killing by this player...

half bane
#

main:

public final class Main extends JavaPlugin {
    @Override
    public void 
        getCommand("hi").setExecutor(new TestCommand());
    }
}

TestCommand

package com.wolfyxon.playerdatamgr.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class TestCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        sender.sendMessage("wasup");
        return true;
    }
}

plugin.yml

...
commands:
  hi:
    description: Test command
    usage: /<command>
    aliases: [hii, hello]
#

it just prints the command name when I run it

#

omg i have my old username

hazy parrot
half bane
#

yes

hazy parrot
#

because your usage should be returned only if onCommand returns false

#

which is not true in your case

half bane
#

here's a proof

[15:09:15] [Server thread/INFO]: [PlayerDataManager] Enabling PlayerDataManager v1.0-SNAPSHOT
[15:09:15] [Server thread/INFO]: [PlayerDataManager] PlayerDataManager has started
half bane
#

when I remove it, errors appear

hazy parrot
#

can you add some logging before sendMessage and check again

hazy parrot
half bane
#

nevermind

frank kettle
#

why is yours true?

hazy parrot
#

true means that command is successfully executed

half bane
frank kettle
#

hm

half bane
#

(im new to plugins)

frank kettle
#

i use false, never used plugin.yml usage

#

my bad then

hazy parrot
frank kettle
#

:Kappa:

#

did u delete things or does it actually look like that?

hazy parrot
#

wow

#

i didn't even notice

frank kettle
#

:Kek:

#

shouldnt that be giving errors?

hazy parrot
#

that wont compile lol

frank kettle
#

yeah to which question

#

๐Ÿคฃ

hazy parrot
#

that code won't even compile so you either sent wrong code or you are ignoring your ide being whole red

frank kettle
#

it should look something like this @half bane

half bane
#

I know

hazy parrot
#

your code doesn't look like that ^

half bane
#
package com.wolfyxon.playerdatamgr;

import com.wolfyxon.playerdatamgr.commands.TestCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class Main extends JavaPlugin {
    @Override
    public void onEnable() {
        // Registering commands
        getCommand("hi").setExecutor(new TestCommand());
        ////////////////////////

        getLogger().info("PlayerDataManager has started");
    }
    @Override
    public void onDisable() {
        getLogger().info("PlayerDataManager has stopped");
    }
}
hazy parrot
#

well, you didnt send that first time

frank kettle
#

ah ok

half bane
hazy parrot
#

as i said, just add log message on your onCommand, because i think you are not using right jar

half bane
#

theres no logs

frank kettle
#

are u using eclipse jar imports or maven?

half bane
hazy parrot
half bane
#

i did

hazy parrot
#

on onCommand

half bane
#
public class TestCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        System.out.println("RUN");
        sender.sendMessage("wasup");
        return false;
    }
}
hazy parrot
#

yeah, run command now

#

see if RUN gets printed

#

if it doesn't get, you are not using right jar

half bane
#
>hi
[15:22:22] [Server thread/INFO]: /hi
half bane
frank kettle
#

send your maven

hazy parrot
#

package jar again, and put it into plugins folder

frank kettle
#

oh true, maybe hes not updating plugin ๐Ÿคฃ imagine

hazy parrot
#

that is most likely the case

half bane
#
[15:25:54] [Server thread/INFO]: [PlayerDataManager] Enabling PlayerDataManager v1.0-SNAPSHOT
[15:25:54] [Server thread/INFO]: [PlayerDataManager] PlayerDataManager has started
[15:25:54] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[15:25:54] [Server thread/INFO]: Done (13.821s)! For help, type "help"
>hii
[15:26:03] [Server thread/INFO]: /hii
>hello
[15:26:06] [Server thread/INFO]: /hello
rotund ravine
#

Yeah, are you returning false?

hazy parrot
#

he is not

half bane
half bane
hazy parrot
#

that is why i said he isn't using right jar

hazy parrot
rotund ravine
#

he needs to send the correct shit.

rotund ravine
#

We already concluded that he send something false.

half bane
#
package com.wolfyxon.playerdatamgr.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class TestCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        System.out.println("RUN");
        sender.sendMessage("wasup");
        return false;
    }
}
rotund ravine
#

?paste

undone axleBOT
rotund ravine
#

paste your whole plugin

#

properly.

frank kettle
#

false or true it should work

rotund ravine
#

including plugin.yml

tall dragon
#

public void??

frank kettle
tender shard
#

lol

tall dragon
#

well why doesnt he send the correct and up to date stuff then

half bane
tender shard
#

make him upload him on github instead

rotund ravine
#

so we can diagnose it properly.

#

You are pasting incorrect code attempting to get an answer.

#

We can't give you one without the proper code.

half bane
#

now im pasting the full code

tender shard
#

oh

#

NOW you do

#

after you wasted everyone's time already

#

great

#

upload it to github

half bane
#

bruh

rotund ravine
#

alex being salty today.

tender shard
#

it wasn't me who sent some outdated code

#

lol

frank kettle
#

alex woke up and chose violence

tender shard
#

I only just joined and read the previous chat

frank kettle
rotund ravine
#

I never expect spigot people to be sane.

frank kettle
#

i bet hes updating plugin on his pc server and asks "are you sure you want to replace this file" with the same name and he put to "always use same option" and probably picked "ignore this type of files" before ๐Ÿคฃ so its never updating

tender shard
#

did you meanwhile upload your project to github

frank kettle
#

idk man, u asked for coding help and deleted part of the code.

late sonnet
#

@frank kettle

frank kettle
#

oh yeah i read it.

#

im in that server as well

#

ty for letting me know its not just me, i even changed some part of the code tryign to fix it.

#

i will just wait till discords fixes it.

#

i did check the github and doesnt seem like anyone added it as a bug ๐Ÿค”

half bane
frank kettle
#

but might be me who never uses githubs issues part, maybe i saw it wrong

late sonnet
hazy parrot
rotund ravine
hazy parrot
#

it wont be enabled in your server

frank kettle
hazy parrot
rotund ravine
#

Other than that ๐Ÿ‘€

half bane
#

ignore how weird my debugging methods are

hazy parrot
#

that will error in your console as you cant init another instance of main class

half bane
#

turns out i can

#

but i think the TestCommand class just isnt running

hazy parrot
#

you are not using right jar then, for 100th time

half bane
#

they work the same

hazy parrot
#

new ClassThatExtendsJavaPlugin() will always throw error in spigot

rotund ravine
#

Well all of them will send back the command name due to it returning aflse.

late sonnet
frank kettle
#

im not used to github that much

#

:Sadge:

half bane
#

ig something must be wrong in getCommand("hi").setExecutor(new TestCommand());

frank kettle
#

all of this work fine

tall dragon
hazy parrot
late sonnet
hazy parrot
half bane
#

theres some gitignored stuff

hazy parrot
#

code

half bane
#

its generated by Minecraft Development plugin

late sonnet
#

git in the server?

frank kettle
#

I created a plugin with the exact same code from github and works for me.

hazy parrot
half bane
#

so... whats wrong

magic wharf
#
@EventHandler(ignoreCancelled = true)
    public void onPlayerInteract(PlayerInteractEvent event) {
        if(event.isCancelled()) {
            Bukkit.broadcastMessage("Cancelled"); return;
        }
        Bukkit.broadcastMessage("triggered");
    } 

So if i right click the air with an item it won't trigger the event at all. But if i remove "ignoreCancelled = true", it will trigger the event and event.isCancelled() gets true. If i right click a block it works without any problems

half bane
#

hm i removed the usage and now the command does completely nothing

half bane
#

oh my god

#

i forgot to change the main class, it didnt refractor

paper viper
#

...

half bane
#

and the old class was still compiled

charred blaze
#

chatGPT really has some talent creating minecraft plugins D:

half bane
#

please end me

tall dragon
#

since its far from always correct

charred blaze
paper viper
half bane
#

okay

paper viper
#

i dont feel like explaining why just do it ๐Ÿ˜ญ

charred blaze
#

how do i make it end work ? ๐Ÿ’€

tall dragon
#

wdym

charred blaze
#

it just

#

stopped

#

creating the code

tall dragon
#

tell it to finish its last answer

#

it sometimes fuks up

charred blaze
#

can i do that?

tall dragon
#

sure

charred blaze
#

oh i can do that ๐Ÿ’€

mortal hare
# frank kettle

at this point i would use command api or make a array of pairs that i iterate to set executors for each command

tall dragon
charred blaze
#

it didnt say sorry :/

#

right

#

im leaving this Ai

#

xd

tall dragon
#

it can do some handy things for u

#

but if u cant actually verify what its doing its not all that usefull

frank kettle
#

he does "logic" well

#

but not use the API that well

charred blaze
#

is it truth that chatgpt stoles code?

frank kettle
#

so if you know what you can do with API, but want to use it to "make quicker" code. it seems handful

charred blaze
paper viper
#

it probably does take code from github repos

tall dragon
#

well "stole" it learned from code publicly available

frank kettle
#

its learning

#

๐Ÿ—ฟ ๐Ÿท

charred blaze
#

yeah right

tall dragon
charred blaze
#

Probably?

paper viper
#

ai isnt gonna replace jobs anytime soon

#

or maybe never

#

coders will still exist

charred blaze
#

intresting

charred blaze
#

๐Ÿ’€

tall dragon
frank kettle
#

problem is it takes code from whatever place it finds and doesnt have a way to verify it. sometimes it will take code from different APIs and put them together.... which makes it wrong. but the logic itself will be there, so be careful about it.

lethal iron
#

Is someone here having issues with Paper's itemMeta#lore method? I'm trying to set the lore to a list of components, none of which have italics

#

but no matter what I do they are all always italics

charred blaze
#

"this is spigot"

lethal iron
#

That is the kind of answer I expected from this discord

frank kettle
#

?spigot

lethal iron
#

I know it is spigot, I know how to read

tall dragon
#

so eh pick ur poison i guess

charred blaze
#

or they will ban you

#

(better)

frank kettle
#

you mean Paper's API or the Material paper?

tall dragon
#

possibly

lethal iron
#

But a decent chunk of people who make plugins for spigot also make plugins for paper, because surprise, paper is a spigot fork

frank kettle
#

wrong

lethal iron
frank kettle
#

we use spigot api for plugin, but maybe we use papers jar for server version

charred blaze
#

i use paper's api (for purpur server xd)

#

dont ban me

tall dragon
frank kettle
#

maybe show code when asking for code help

frank kettle
lethal iron
#
        List<Component> lore = new ArrayList<>();
        lore.add(Component.text("test").color(TextColor.color(255, 255, 255)));
        lore.add(levelComponent);
        lore.add(blocksRequiredComponent);
        lore.add(Component.space());
        lore.add(enchantmentsHeaderComponent);
        lore.addAll(enchantmentComponents);
        lore.add(Component.space());
        lore.add(gemsHeaderComponent);
        lore.addAll(gemComponents);
        lore.add(Component.text("test").appendSpace().append(MiniMessage.miniMessage().deserialize("<reset> test")));
        lore.add(MiniMessage.miniMessage().deserialize("</italics> test"));

        itemMeta.lore(lore);

I hate dumping code and telling people "go find the error" but yeah this is basically what I'm trying to do

frank kettle
#

i know lore will be set as italic by default if u dont put any color

#

maybe its that what u mean?

lethal iron
#

Nothing seems to work

frank kettle
#

is this how yours looks?

mortal hare
#

default lore formatting is italic dark purple lore

lethal iron
frank kettle
#

yeah

#

oof

#

๐Ÿคฃ

#

it shouldnt all be italic

lethal iron
#

โ˜ ๏ธ โšฐ๏ธ

#

It's driving me insane

frank kettle
#

what is the variables you're using?

#

can you show that?

#

is it TextComponents?

lethal iron
#

Yep

frank kettle
#

why

#

just use Strings no?

lethal iron
#

"nooo dont use strings please" @deprecated -paper

frank kettle
#

I only use TextComponents for chat stuff that requires hover/click events

frank kettle
hasty prawn
#

Paper deprecates those things for literally no reason afaik

lethal iron
#

I'd use strings but since I have mini message added I'd like to use it and allow gradients

#

Yep, literally so just people get an annoying warning

frank kettle
#

on spigot setLore Strings isn't deprecated

lethal iron
#

of course, and it will always work for compatibility reasons

frank kettle
#

why do you use paper api btw?

lethal iron
#

Becasue the server is running paper and I want to add gradients and so on

frank kettle
#

doesnt paper api only add few extra "time saving" things like instead of doing getWorld.getChunk() you can do like getWorldChunk() right away?

lethal iron
#

yeah there are a couple of "shortcuts" like that

tall dragon
#

well it also includes minimessage by default iirc

lethal iron
#

I'm using it to set item names and lores with components

tall dragon
#

and most things String related are components there

lethal iron
#

exactly

frank kettle
#

ooo

#

that

lethal iron
#

yep

frank kettle
#

i made my own code for that ๐Ÿคฃ

#

didnt know paper had such a thing

hasty prawn
#

What is in the lore() method anyways, honestly that and the Component class are the only things I could see that's adding the italics

#

But Components doing it seems odd unless it's some weird default behavior that you aren't overriding thonk

lethal iron
#

lore() without args is a getter and lore(List<Component> components) is a setter

hasty prawn
#

The setter what's in that

lethal iron
#

let me take a look

#

Well, it just takes me to the itemmeta interface

#

no actual implementation there

hasty prawn
lethal iron
hasty prawn
#

You're using the latest version of Paper right

lethal iron
#

Yep, updated 15 minutes ago

eternal night
#

nothing adds italic

frank kettle
eternal night
#

the client does

eternal night
#

if you use a component method you have to actively set itallic to false

#

spigots legacy "fakes" that automatically

hasty prawn
#

Well I was kinda right then, that is weird lol

frank kettle
#

it sucks if you make a plugin in paper u will basically lose 50% servers compatibility

#

unless u make then different versions

eternal night
#

wtf is that stat for

river oracle
#

And you can't post on spigot too

eternal night
#

like what

#

this is the stats I find on bstats ๐Ÿ˜…

frank kettle
#

bStats

river oracle
#

The .3% running bukkit ๐Ÿฅฒ

frank kettle
frank kettle
#

it must be a little different for other plugins but around the same no?

#

for spigot-paper %s

eternal night
#

well that is the global stat

frank kettle
#

oh

#

found it now yeah

#

didnt know about that page

#

my bad

river oracle
#

Yeah you still end up losing g abt 50% of the share

eternal night
#

spigot is at ~25%

eternal night
#

np ๐Ÿ™‚

frank kettle
#

thats honestly very nice to know tho, the italic thing

#

if someday i code in paper

lethal iron
#

itemMeta.lore(lore.stream().map(c->c.decoration(TextDecoration.ITALIC, false)).toList()) this did the trick

eternal night
#

Yea I usually have a util method for that

#

concerning that applies to any lore / item display name yoU'll interact with

frank kettle
#

glad this issue was fixed here instead of the usual "this is spigot" :kappa:

eternal night
#

?whereami

hasty prawn
#

That is goofy that it makes you do that

eternal night
#

Its vanilla

#

spigot does it for you in the background when parsing legacy

river oracle
#

Ban vanilla

frank kettle
hasty prawn
#

It can be vanilla and still be goofy KEKW

eternal night
#

paper does to

eternal night
#

if you use legacy

#

but with components you directly describe how you want it to look

#

so overwriting a style on your component automatically is meh

lethal iron
#

kinda weird that paper doesn't explicitly tell the client not to apply italics if the component it receives doesn't have it

eternal night
#

I mean paper can't

#

you'd have to modify the component

#

unless specified explicitly it is up to the client to decide how to render it

#

and sadly the client auto applies itallic

charred blaze
#

how do i delete project in intelij

eternal night
#

I hate it too dw xD

#

mojang should have just explicitly made renamed items italic in like, an anvil or something

frank kettle
charred blaze
#

in the workspace?

frank kettle
#

doesnt intellij read the projects depending on the folders inside the workspace?

charred blaze
#

hm?

tall dragon
#

i usually just close the project & delete the project directory

lethal iron
small hawk
#

If i want to make customConfig let's say items.yml and on first plugin launch it should create a File with already done/example config I should use saveResouce and getResource ? Am i right?

remote swallow
#

?config-api

#

?configs

undone axleBOT
drowsy cloud
#

I'm starting with Gardle and I have a problem:

Gradle does not install bungeecord
compileOnly('net.md-5:bungeecord-api:1.18.2-R0.1-SNAPSHOT') <-- this lines does not work

charred blaze
#

am i creating restrictions object for my duels plugin correctly?


public class DuelRestrictions {
    boolean bowAllowed;
    boolean notchAllowed;
    boolean potionsAllowed;
    boolean goldenAppleAllowed;
    boolean shieldsAllowed;
    public DuelRestrictions(boolean bowAllowed, boolean notchAllowed, boolean potionsAllowed, boolean goldenAppleAllowed, boolean shieldsAllowed) {
        this.bowAllowed = bowAllowed;
        this.notchAllowed = notchAllowed;
        this.potionsAllowed= potionsAllowed;
        this.goldenAppleAllowed = goldenAppleAllowed;
        this.shieldsAllowed = shieldsAllowed;
    }
    public boolean isBowAllowed() {
        return bowAllowed;
    }
    public boolean isNotchAllowed() {
        return notchAllowed;
    }
    public boolean isPotionsAllowed() {
        return potionsAllowed;
    }
    public boolean isGoldenAppleAllowed() {
        return goldenAppleAllowed;
    }
    public boolean isShieldsAllowed() {
        return shieldsAllowed;
    }
    public void setBowAllowed(boolean yesornot) {
        bowAllowed = yesornot;
    }
    public void setNotchAllowed(boolean yesornot) {
        notchAllowed = yesornot;
    }
    public void setPotionsAllowed(boolean yesornot) {
        potionsAllowed = yesornot;
    }
    public void setGoldenAppleAllowed(boolean yesornot) {
        goldenAppleAllowed = yesornot;
    }
    public void setShieldsAllowed(boolean yesornot) {
        shieldsAllowed = yesornot;
    }
}
tardy delta
#

field access modifier where

charred blaze
#

what is that

eternal night
#

you might be missing the java plugin which defines the compileOnly configuration

charred blaze
tardy delta
#

you better

#

id make that thing a bitset wrapper but that doesnt matter

#

or atleast use flag encoding

charred blaze
#

what

tardy delta
#

google it if youve never heard about it

#

a BitSet is just a datastructure and the other is some binary logic

charred blaze
#

how can i create a SIMPLE object?

dull lagoon
#

Hi.

glossy venture
#

i usually make shit protected so internals and subclasses have access

charred blaze
charred blaze
#

do i need to use "private"

#

or something?

glossy venture
#

nah

charred blaze
#

ok

glossy venture
#

dont need to

dull lagoon
#

Right now I have a Plugin called DraksLib that i usually import as files, classes.
How do I make it a Library so IntelliJ imports it, makes my project depend on it, instead of having to copy and paste the DraksLib Classes inside my project?

#

I didn't find anything helpful in the IntelliJ Docs, can someone walk me through?

charred blaze
#

what does return true; and return false; thing do in the onCommand? what will happen if i change true to false?

quaint mantle
#

false implies the command failed and it will show the usage

charred blaze
#

nvm fixed

dull lagoon
quaint mantle
forest pumice
#

Hey, how can I add a license to my plugins?

charred blaze
#

how do i send clickable message to a player?

tardy delta
#

take a look at textcomponents

quaint mantle
#

Maybe minimessage instead

half bane
tardy delta
#

thats string to string not string to uuid

#

doesnt OfflinePlayer#getUniqueId provide what you need?

half bane
#

in case the player is offline

charred blaze
#

i dont want whole message to be clickable. this is what im trying to do. "player sent you a duel request click ACCEPT to accept click DENY to deny on this message"

charred blaze
#

and get its uuid

#

with the method said above

#

ig

#

is this sql

#

then idk

tardy delta
#

where x=10 and z=-10?

#

and where is your from table

#

oh god

vast depot
#

net.minecraft.world.Item and i call getDeclaredFields and map it to their name it returns A, B, C why are the mappings such as d(maxStackSize) not in there? What am i missing?

they dont seem to be existent anywhere

tardy delta
#
SELECT * FROM TABLE WHERE ID='ChunkID(x=10:z=-23)';```?
tardy delta
#

componentbuilder

charred blaze
#

thx

tardy delta
#

and you have exactly that?

#

those " ' probably

vast depot
# vast depot net.minecraft.world.Item and i call getDeclaredFields and map it to their name i...

anyone got any ideas, These should be printed but its printing 3 declared fields, Nothing seems to make sense. kotlin private fun build(item: ItemStack): ItemStack { val itemstack = CraftItemStack.asNMSCopy(item) val jClass = itemstack.o().c() println(jClass.n()) println(jClass::class.java.declaredFields.map { it.name }) println(jClass::class.java.declaredMethods.map { it.name }) println("SUPER CLASS" + itemstack::class.java.superclass.declaredFields.map { it.name }) return CraftItemStack.asBukkitCopy(itemstack) }

tardy delta
#

hm thats fine, looks like the error thing did

#

wdym not hardcode the table?

#

what would you do otherwise?

#

im still wondering why you are saving json in a db based on the toString return values

#

also i dont really understand why you are joining the future

#

that defeats the whole point of it

#

your method should do one thing but it looks like its doing a bunch

charred blaze
tardy delta
#

and whats this for? you could probably load the db into memory?

charred blaze
tardy delta
#

congrats

charred blaze
#

umm

#

am i doing something wrong?

tardy delta
charred blaze
#

how do i do new line in that?

#

can i use just \n?

tardy delta
#

ig not

#

id use a componentbuilder

charred blaze
#

im using it

tardy delta
#

what are you trying to do?

#

ah

#

i dont have the docs or an ide

#

what is this crap ๐Ÿ’€

charred blaze
tardy delta
#

.event()

charred blaze
#

how do i make code executable in that????

tardy delta
#

you dont

charred blaze
#

what

#

cannot i?

tardy delta
#

there are only a few actions, exec a command, open a link

#

abd i forgot the rest

charred blaze
#

uhhh

#

so i cannot execute code by that event?

tardy delta
#

run a command ig

remote swallow
#

Execute a fake command and listen on playwr pre command event or whatever its called

tardy delta
#

cuz theres no other way

charred blaze
#

cannot spigot just make method for it

pseudo hazel
#

no

charred blaze
#

why

pseudo hazel
#

you just make your own command

#

and then listen for when it gets executed

#

vanilla restrictions I assume

hazy parrot
#

You are free to contribute as spigot is opensource

charred blaze
#

what if someone accidentally gets my command's name?

#

security exploit

pseudo hazel
#

use permissions

#

like what if someone accidentally receives the message

tardy delta
#

call it ahhagagjagaiosiugtyuiojhgfa and nobody will use it

charred blaze
#

doesnt this

#

is

#

executed by player?

charred blaze
pseudo hazel
#

it will execute that command as if by a player

river oracle
#

The logic

remote swallow
#

Yes, if its a not real command and you listen to the command pre process thwy cant findit

river oracle
#

Use a map monn

tardy delta
#

ah i was thinking about overriding some method ๐Ÿ’€

charred blaze
#

Bruh

#

Hm

tardy delta
#

use minestom if you think this is shit

charred blaze
#

how can player possibly know my random keyboard command?

pseudo hazel
#

xD

charred blaze
#

aa

#

that

pseudo hazel
#

they cant

tardy delta
#

look it up

charred blaze
#

python

#

thing?

eternal night
pseudo hazel
#

the whole point is that the player doesnt see the actual command

charred blaze
#

how can player possibly search for that command?

remote swallow
#

If you dont register it and listen to command pre process they will never know it

charred blaze
#

like can he scroll up using arrow keys on keyboard?

remote swallow
#

You make them run the command

#

Nope

pseudo hazel
#

no cuz he didnt type it

charred blaze
eternal night
#

your pluing should still prevent wrong usages

pseudo hazel
#

the plugin xD

#

the plugin just says

charred blaze
#

what

remote swallow
#

You make them run jt

#

It

pseudo hazel
#

"okay a command has been executed by this player"

charred blaze
#

isnt this command executed by player?

pseudo hazel
#

yes when they click it

remote swallow
#

Yes but they dont get to see the command

#

Run a random command and catch and cancel on player command pre process

charred blaze
pseudo hazel
#

no?

#

why would they

charred blaze
#

non registered command?

pseudo hazel
#

I mean unless your command send them a help message ig ;P

remote swallow
#

If you cancel it on player command pre process they wont

charred blaze
remote swallow
charred blaze
tardy delta
#

cant you hook in the commandmap and make sure it doesnt show up as a tabcompletion?

remote swallow
pseudo hazel
#

okay, so how does one "cancel the player command pre process"

remote swallow
charred blaze
#

Hmmm i just realised i just dont need to hide the command

tardy delta
#

ah you are just going to listen for the cmd pre prcs?

charred blaze
#

why not having /denyrequest commands

#

by default

pseudo hazel
#

lol

charred blaze
#

lol

pseudo hazel
#

what does the command do

charred blaze
#

denys duel request

pseudo hazel
#

why would you want to explicitly hide that from the player

charred blaze
#

idk

#

i dont rember

#

why was i

#

xd

#

does args in onCommand contain the main command too? (spigot api)

tall dragon
#

no

rustic birch
#

Is there a way we can set keybinds?

tall dragon
pseudo hazel
tall dragon
rustic birch
#

Like "z" does a thing

tall dragon
#

for example u can use F as a useable key by cancelling the ItemSwap and performing ur own code

#

but no u cant do custom keybinds

pseudo hazel
#

you cant as its client dependent

#

like what if I have my crouch on z

tall dragon
#

yea and the client does not send its input

#

it just sends whatever actions its peforming

echo basalt
#

For custom keybinds the only thing you can do is listen to OFFHAND_SWAP and do stuff

#

you can also just cancel the thing and it won't swap

#

and the packet is still fired if both hands are empty, so it's convenient

#

for youtuber commissions I just tell them to remap the key

rustic birch
#

Can I listen to two events like shift and ofhandswap

echo basalt
#

for the text click to run a function, I've already given a solution to this in the past

echo basalt
rustic birch
#

At the same time it is doable right

pseudo hazel
#

yes

rustic birch
pseudo hazel
#

but you need to keep track of what has been pressed by what player I think

echo basalt
rustic birch
#

Oh then I'll just use sprint + offhand

paper venture
#

I've got some strange bug, I have this code, it runs every tick

rare rover
#

use the new case system

#

that bad

echo basalt
#

yea here

paper venture
#

My health isnt regenerating at all

echo basalt
#

and usage here

rare rover
#

anyways

#

what's the best way of making an itemstacker?

#

just loop all entities in a radius?

echo basalt
#

ItemBuilder type thing

hazy warren
#

Trying to figure out scoreboard nametag visibility behaviour,
two players are on the same team with visibility set to never and they cannot see each other's nametags โœ…
one player is on another team with visibility set to always, and he can still see the other two's nametags ๐Ÿ‘Ž why?

quaint mantle
#

Guys it's possibile to create a cooldown for the name of inventory ?

When , for example , after 5 sec , it change

river oracle
quaint mantle
#

Because i want to create a animated gui

river oracle
#

With pure bukkit you'd have to make a scheduler for everyone in the inventory and create a new inventory with the new title every 5 seconds

quaint mantle
#

So , it's possible

#

Thx

river oracle
#

Personally I'd use packets but you can do whatever you think is easier

charred blaze
#

how do i create custom named config

rough basin
#

What is the difference between the Arrow and Snowball projectiles?
Is there any difference in how I determine its damage, speed, and direction?

charred blaze
#

thx for googling for me

charred blaze
#

use "instanceof"

rough basin
#

My question is not about it

#

I am asking what is the difference between an arrow class and a snowball class cus they both seem to behave very similarly,
I would like to know if determining the speed, direction, and damage for both classes can be set in the same way(method?).

bleak galleon
#

But the best way to figure that out is testing it i guess

magic wharf
#

Is right clicking with an item the air not triggering PlayerInteractEvent anymore?

charred blaze
#

will this work ArrayList<UUID> uuids = (ArrayList<UUID>) Duels.ignoresConfig.getList("Ignores."+target.getUniqueId());

#

config:
Ignores:
someuuid:
- uuid
- uuid

eternal oxide
#

?paste First use this, then ask an actual question

undone axleBOT
charred blaze
eternal oxide
charred blaze
#

ah

#

np

mortal hare
#

Is it possible to wrap primitive java array to let say a Collection or a list?

hazy parrot
#

Arrays.asList

mortal hare
#

without copying

#

make a immutable view

#

of collection from array

worldly ingot
#

No

#

You could write your own I suppose

#

None in the stdlib though that I'm aware of

mortal hare
#

what if i want to use internally primitive array just because i know its initial dimensions and expose it as a collection

#

why is this not a thing

#

inside std lib

worldly ingot
#

Frozen arrays were a JEP for a while but ultimately people just end up using Collections

#

You can create an initially-sized List as well

mortal hare
#

what does jep stand for

worldly ingot
#

It's a proposal for a Java feature

#

Java Enhancement Proposal iirc?

eternal night
#

jdk*

worldly ingot
#

Same thing >:((

eternal night
#

๐Ÿค“

#

but tbh, a collection wrapping a primitive array sounds terrible

hazy warren
#

Trying to figure out scoreboard nametag visibility behaviour,
two players are on the same team with visibility set to never and they cannot see each other's nametags โœ…
one player is on another team with visibility set to always, and he can still see the other two's nametags ๐Ÿ‘Ž why?

eternal night
#

you'd be auto boxing on every damn access

mortal hare
eternal night
#

idk what your array size is, but probably not lol

mortal hare
#

why would autoboxing be so expensive

eternal night
#

I mean you are allocating on the heap everytime ?

mortal hare
#

doesnt array copying allocate space on heap too

eternal night
#

yea but a single time

#

a single long block

#

iirc arraycopy of like an int[] with size 1 million was like 2ms ?

dense falcon
#

Could not find org.spigotmcspigot1.19.3-R0.1-SNAPSHOT.

Hello,
why I have this error? ```gradle
plugins {
id 'java'
}

group 'fr.program'
version '1.0'

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
compileOnly 'org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
}

sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../server/plugins')


plugin.yml: ```
name: LoupGarou
version: 1.0
api-version: 1.19
main: fr.program.LoupGarouMain
eternal night
#

you are missing the repository

mortal hare
eternal night
#

and spigot is not in any repository eyes_zoom

#

only spigot-api

#

(unless you are codemc and don't give a shit)

mortal hare
#

you need to buildtools

#

for this to work

#

and as the comment says mavenLocal() inside repo block

worldly ingot
#

IntList <o/

eternal night
#

thank you fastutils

worldly ingot
#

Still hate the name of it

dense falcon
#
plugins {
    id 'java'
}

group 'fr.program'
version '1.0'

repositories {
    maven {
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'

        // As of Gradle 5.1, you can limit this to only those
        // dependencies you expect from it
        content {
            includeGroup 'org.bukkit'
            includeGroup 'org.spigotmc'
        }
    }
    /*
     As Spigot-API depends on the BungeeCord ChatComponent-API,
    we need to add the Sonatype OSS repository, as Gradle,
    in comparison to maven, doesn't want to understand the ~/.m2
    directory unless added using mavenLocal(). Maven usually just gets
    it from there, as most people have run the BuildTools at least once.
    This is therefore not needed if you're using the full Spigot/CraftBukkit,
    or if you're using the Bukkit API.
    */
    maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url = 'https://oss.sonatype.org/content/repositories/central' }
    // mavenLocal() // This is needed for CraftBukkit and Spigot.
}

dependencies {
    // Pick only one of these and read the comment in the repositories block.
    compileOnly 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT' // The Spigot API with no shadowing. Requires the OSS repo.
    compileOnly 'org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
}

sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../server/plugins')
``` https://www.spigotmc.org/wiki/spigot-gradle/ ๐Ÿ˜ญ
#
#

I am with groovy.

sterile token
#

lol

magic wharf
#

for me, if ignorecancelled is set true it is only triggered when i right click a block, if ignorecancelled is false its getting called but instantly cancelled

dense falcon
mortal hare
#

well i dont think autoboxing of arrays would be so bad, its not as if you dont do this with Lists or maps when you add primitive values to it (it autoboxes primitives)

eternal oxide
#

The Spigot jar is not distributed due to licensing, the API is. To depend on Spigot you must run Buildtools to build it locally

#

?bt

undone axleBOT
mortal hare
#

oh lol

#

i mentioned primitive array right

#

my bad

#

i was used to cpp naming

#

when i meant primtive array i mean fixed sized array

sterile token
mortal hare
#

not primitive valued fixed array

dense falcon
sterile token
dense falcon
#

I installed it.

undone axleBOT
mortal hare
#

so if I lets say used Object[] array

eternal oxide
#

run it

sterile token
#

follow the wiki, they explains you everything

mortal hare
#

autoboxing wouldnt happen

#

since im accessing Objects not primtive data types

sterile token
#

For example

worldly ingot
#

Well everything you put into that array would get boxed

eternal oxide
#

.3

worldly ingot
#

And if you ever wanted to take it out and access it as an int, it would have to be unboxed (less expensive than having to box, but yeah lol)

#

say objects[0].intValue(), that's an unboxing operation (and if you didn't explicitly use intValue(), it's just implied)

mortal hare
#

yea but lets say i use class objects

#

not primitives

#

in the array

#

i get it when you use ints or chars or other primitives

dense falcon
worldly ingot
#

Yeah like an Integer[] or something. You can do Integer[] array = { 1, 2, 3, 4 }; but you're still boxing 1, 2, 3, and 4

#

Boxing just means primitive -> wrapper

dense falcon
#

Nvm.

eternal oxide
mortal hare
#

Second time, i wouldnt use any primitives in the array

worldly ingot
#

new Integer(5)? lol

mortal hare
#

no ints

#

jsut class instances

#

custom class instances

worldly ingot
#

You've lost me

mortal hare
#

MyClass[] instances;

eternal night
worldly ingot
#

And MyClass holds an int or something? lol

mortal hare
#

no

hazy parrot
#

but you said you want primitives

worldly ingot
#

You're still allocating to the heap so you're delegating the problem KEKW I'm so confused

mortal hare
#

i named it wrong

eternal night
#

the entire point was about primitive and boxing ๐Ÿ˜ญ

dense falcon
eternal oxide
#

build your plugin

mortal hare
#

when i said primitive array i meant fixed array data type

#

not fixed array data type with primitives in it

eternal night
#

Well

hazy parrot
#

afaik java doesn't have Array object

mortal hare
#

Object[]
what's this then ๐Ÿ˜„

eternal night
#

so you want an immutable view of a normal Object array

mortal hare
#

yes

#

finally ๐Ÿ˜„

worldly ingot
#

Then we loop back to the frozen array JEP and people just using Collections

dense falcon
#

Ok I will try thanks.

eternal night
#

there is List.of(Object[]);

#

which does not copy the data

mortal hare
#

oh really

#

that's neat

eternal night
#

yes

mortal hare
#

thank you

#

literally what i wanted

eternal night
#

actualyll

#

I lied

mortal hare
#

cmon

worldly ingot
#

lol

mortal hare
#

:/

eternal night
#

only the finite implementations don't copy

worldly ingot
#

Yeah and there are only List1 and List12, right? lol

#

Or something to that effect

eternal night
#

yea something along those lines

eternal night
#

there is a package private method to create one of those arrays

#

you just don't have access to it kekw

mortal hare
#

i guess reserving initial list capacity would work for now

#

and then using Collections class to make a view of it

eternal night
#

any reason you are not just using google stuff ?

#

or is this not in spigot land

mortal hare
#

i dont have it as my dependency

#

ik its in spigot

#

but i tend not to use

#

doesnt fastutil have smth like this

eternal night
#

yea

#

fastutil has ReferenceImmutableList

eternal oxide
eternal night
#

if you have it as a dependency, go for that I guess

charred blaze
#

If I cancel this event, will players still have a way to obtain items from their inventories?

mortal hare
#

yay

#

problem solved

#

fastutil

eternal oxide
eternal night
#

fastutil prayge

dense falcon
eternal oxide
#

nope, not successfully

dense falcon
#

I will redo.

eternal oxide
#

?paste your buildtools.log

undone axleBOT
eternal night
#

ReferenceImmutableList.of

#

constructors are for noobs

worldly ingot
#

Constructors are for those that haven't learned the prettiness of hiding the new keyword

#

Down with the new keyword

eternal night
#

imagine the perfect world we'd be in

#

if people chose ItemStack.of(Material)

#

instead of new ItemStack

eternal oxide
#

thats not buildtools.log

#

thats better

#

ok it build

#

now ensure you have local maven as a repository in your gradle

dense falcon
#

Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not find io.netty:netty-transport-native-epoll:4.1.82.Final.
Searched in the following locations:
- file:/C:/Users//.m2/repository/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final.pom
- https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final.pom
- https://oss.sonatype.org/content/repositories/central/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final.pom
Required by:
project : > org.spigotmcspigot1.19.3-R0.1-SNAPSHOT

Possible solution:

eternal oxide
#
repositories {
  mavenLocal()
}```
dense falcon
#

Ok now it's good!

eternal oxide
#

your mavenLocal() is commented out

dense falcon
#

I just forgot to add mavenCentral().

remote swallow
#

Gradle wooooo

sterile token
#

Okay, can someone confirm that velocity api is weird?

#

look that weird api

tardy delta
#

can someone confirm you're not on weed again

sterile token
tardy delta
#

whats so weird about it apart that they use a newline for brackets

lost matrix
#

Probably guice

sterile token
#

oh right

#

Because chat gpt given another way of implementation which looks more like bungee one

#

I mean im first time using velocity because the bungee plugin doesnt work there, and makes sense tho

mortal hare
#

Does Reference in fastutil means a view of container?

#

or what

#

there's literally no definition on naming

#

of fastutil classes

#

at least in javadocs

#

does ReferenceList copy values or uses passed collection or array to display

#

@eternal night

#

well for your defined class ReferenceImmutableList constructor does not copy the objects

    public ReferenceImmutableList(final K a[]) {
        this.a = a;
    }

#

i wonder if this is the case for other Reference based lists

#

note that constructors using an array will not make a defensive copy.

#

so ImmmutableList.of() doesnt not work

#

or it actually does

#

Note that this method does not perform a defensive copy.

eternal night
#

@mortal hare refernec means it compares via reference not equality

#

if you want to use .equals you can go with ObjectImmutableList

mortal hare
#

i think ObjectImmutableList would suit me better

eternal night
#

really depends on your setup ยฏ_(ใƒ„)_/ยฏ

mortal hare
#

since i would return List interface

eternal night
#

both implement that

#

List interface should not make any assumption about comparison method used

#

but yea

#

ObjectImmutableList is probably the safer bet and does not create a copy either

mortal hare
#

fastutil is sooo useful

#

best lib

#

for java

eternal night
#

yea

spare prism
#

Hello. Is there a way to ignore the region protection when a player places or breaks a block in WorldGuardAPI?

#

Like with the flags block-break allow and block-place allow

mortal hare
#

btw

#

why no one uses iterable?

#

and prefers collection to be returned

eternal night
#

I mean Collection has a bunch of nice extra methods ?

#

if you return me an Iterable<Something> and for a simple contains call I have to loop over that damn iterator I am not using your lib lol

paper venture
#

Can I make arrows go through blocks?

mortal hare
#

in paper iirc you have dedicated event for that

tardy delta
#

Iterable<T> allows you to use a for each loop

eternal night
#

cool

#

I always wanted to implement my own foreach loop for a contains call

tardy delta
#

and it calls iterator internally

eternal night
#

yea that is the use of that interface lol. If you want your type to be usable in a foreach loop

lost matrix
eternal night
#

eh

#

Consumer for iteration is meh

#

like, you are now stuck in effectively final land

#

so getting any information for that iteration back up is rough

paper venture
lost matrix
eternal night
#

oh yea, for sure

#

I mean, that is why there are specific immutable types 5Head

mortal hare
eternal night
#

and obviously @UnmodifiableView, thank you jetbrains

mortal hare
#

this is what i found

#

but that's not for blocks sadly

lost matrix
eternal night
#

allows your IDE to be smart

mortal hare
paper venture
#

I found ProjectileHitEvent, gonna try to cancel it

lost matrix
eternal night
#

gets you that

#

idk, jetbrains annotations don't actually get you safety just make user experience so so so much nicer

lost matrix
#

But their example is a very interesting choice because Arrays.asList already returns an immutable List...

eternal night
#

like my god @Contract my beloved

#

ยฏ_(ใƒ„)_/ยฏ

#

jetbrains moment too I guess kekw

tardy delta
#

i hate people that use notnull and nullable annotations everywhere

eternal night
mortal hare
#

why

tardy delta
#

one case where nullable is not actually null and i gotta suppress warnings everywhere

lost matrix
#

Can you PR their wiki? I wanna add "Jetbrains source contributor" to my github XD

eternal night
#

idk ๐Ÿ˜…

sterile token
eternal night
sterile token
#

I dont like using apis who uses @urban grotto and @Nulleable because then i need to supress the shity warnings

eternal night
#

gg

#

the alternative is API that uses Optional

#

pick your poison

eternal oxide
#

I like the null annotations

mortal hare
#

IDE annotations > Useless heap objects

eternal night
#

^

tardy delta
#

whenever i call player.getInstance().X() in minestom i gotta suppress the nullable warning even though it can never be null ๐Ÿ˜ข

eternal night
#

tho valhalla might change that

sterile token
tardy delta
#

that doesnt have an annotation

eternal night
#

then minestome might be either poorly designed or wrong there

sterile token
tardy delta
#

well it can be null, but whenever a player spawned their instance cannot be null

lost matrix
#

I had to write a micro service where everything that got in was immediately wrapped in an optional and no null values
or unpacking where allowed. Never had a NPE

eternal oxide
#

yeah a Player object "should" never be null, The getter can return null though

#

therefore the object can

tardy delta
remote swallow
#

If the path doesnt exist

sterile token
#

๐Ÿ’€

eternal oxide
#

only for InteliJ ๐Ÿ˜‰

eternal night
#

wtf

sterile token
#

It have to disable null checks cause of that shit

#

๐Ÿ˜ก

eternal night
#

"oh yea, a config might very well return null there, but what a shitty error"

tardy delta
#

does anyone by any chance knows a site which explains entity behaviour in detail?

#

that fandom stuff doesnt say much and wiki.vg is only about packet stuff

eternal oxide
#

programatically?

spare prism
#

I want to ignore that protection somehow with some specific conditions

#

if that's possible

eternal oxide
#

you could listen late to the event, if it's cancelled you coudl query WG to see if it's blocking. Then handle it manually.

spare prism
#

that u can't build, for example

#

if that's what u mean

eternal oxide
#

then you need to listen early and query WG, then cancel the event before WG gets it and handle it yourself

#

that means you have to listen to every place/break

spare prism
eternal night
#

iirc world guard has some internal events

#

you could use

#

just, well, they are highly subject to change

#

which might be a problem for you

spare prism
#

at least in the documentation

eternal night
#

that is the public one

spare prism
#

and it's about pvp

eternal night
#

which is API contract

#

as stated, there are internal ones

#

which are not API contracted, hence might change a lot

spare prism
eternal night
#

hence why I stated, you could use them just, might explode without notice

#

might be worth just asking in their discord btw

tardy delta
#

oh i also hate people that use @ApiStatus.Internal

eternal night
spare prism
tardy delta
#

more warnings to suppress

eternal night
#

that

#

ehm

#

very 5head

tardy delta
#

me reverse engineering entity ai with chatgpt ๐Ÿ˜Ž

#

heh isnt there a generic.movement_frequency?

#

stupid ai is explaining stuff to me, convincing me that it exists and then it doesnt ๐Ÿ’€

eternal night
#

average chat gpt moment

lost matrix
tardy delta
#

oh i also hate people that dont write a toString

eternal night
#

toString is overrated kappa

lost matrix
#

Whats your IDE erroring about? Wrong parameters?

tardy delta
lost matrix
#

Oh yeah i see whats wrong. Your method expects a Player but you pass it a String
Dont do that.

eternal oxide
#

Your getIP requires a player object when you are passing a String

grand magnet
#

Whats your IDE erroring about? Wrong parameters?

sterile token
#

I think he is using eclipse ๐Ÿ’€

grand magnet
limpid nexus
#

switch statements

eternal oxide
#

either use a Player object or create a method which accepts a String

lost matrix
grand magnet
#

But then the command no longer works

glad prawn
#

Pass your target