#help-development

1 messages · Page 964 of 1

rotund ravine
#

BlockToFromEvent dang, i mispelled it

stiff sonnet
#

but I don't think I can get the blocks from taht

rotund ravine
#

You def can

young knoll
#

^

stiff sonnet
#

how though i wasn't able to find a list

#

What do the handlers even do

rotund ravine
#

There won't be a list

#

it's called for one block

#

to a second block

stiff sonnet
rotund ravine
#

what

stiff sonnet
#

as far as I understand it I'd just get the block position maybnne

young knoll
#

What

rotund ravine
#

Do u need an overview of how the event system works

stiff sonnet
#

I mean I guess you can cancel it

young knoll
#

The event is called before the change actually occurs

#

So from will be the water, to will be the redstone

stiff sonnet
#

my bad then ._.

#

uh related question: how do I check if a block can be flushed away

rotund ravine
#

Interesting question

stiff sonnet
#

bruh

#

event for this when

stiff sonnet
#

and that is what isSolid differentiates between afaik

rotund ravine
#

pray

#

Go submit one

rotund ravine
young knoll
#

Yeah idk what internal method Mojang uses there

#

And if it’s exposed in some way

spare prism
#
    @EventHandler
    public void onClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        if (!event.isShiftClick()) return;

        ItemStack itemStack = event.getCurrentItem();
        if (itemStack == null || itemStack.getType().isAir() || itemStack.getType() != Material.SHULKER_BOX) return;

        if (!(itemStack.getItemMeta() instanceof BlockStateMeta)) return;

        BlockStateMeta blockStateMeta = (BlockStateMeta) itemStack.getItemMeta();
        BlockState blockState = blockStateMeta.getBlockState();

        if (!(blockState instanceof ShulkerBox)) return;

        ShulkerBox shulkerBox = (ShulkerBox) blockState;
        player.openInventory(shulkerBox.getInventory());
    }

i open a shulker inventory for player, but when players modify the inventory contents, it doesn't get saved. how can i fix that?

young knoll
#

You have to set the meta back afterward

#

I do it in the close event

inner mulch
#

i have created my own raytracing method so i can also get air blocks, altough it seems like i can also get blocks inside the floor. is there some kind of rule i can set up so i get the exact air block at a max distance of for example 10, but it stops before going underground? this isnt possible right?

young knoll
#

Once your ray trace hits a non air block, do whatever?

cinder abyss
#

Hello, if two plugins send a resource pack respectively, are both downloaded?

rotund ravine
#

?tryandsee

undone axleBOT
inner mulch
cinder abyss
young knoll
#

Yes

cinder abyss
#

okay thanks

cinder abyss
young knoll
#

You can apply as many server packs as you want now

cinder abyss
#

okay perfect thanks

stiff sonnet
young knoll
#

Actually

#

If the event is being called for a block with water as the source

#

That means the block can be destroyed by water

acoustic pendant
#

in a string like this: 1,2,3,15 ...
how can i check if x value is in the string? i'm splitting it but if I use contains(1) for example, if the number is 15 will it return true as well?

young knoll
#

Yes

rotund ravine
#

grats

young knoll
#

You’d have to split it at the comma and then parse each value into an integer

stiff sonnet
#

b.getType() != Material.AIR

acoustic pendant
#

but whan can i use instead of contains?

young knoll
#

Well if you’ve parsed them all into integers

#

Contains is fine

rotund ravine
#

a block

#

can be 3 types of air

acoustic pendant
stiff sonnet
acoustic pendant
#

Oh

#

okay thanks

fringe yew
#

for some reason, my config.yml + message.yml files aren't being included in the jar file

as a result, i am experiencing an error when the plugin is loaded.

onEnable

 if (!getDataFolder().exists()) {
    getLogger().info("Detected first time launch! Creating configuration files...");
    getDataFolder().mkdir();
}

saveDefaultConfig();
saveResource("messages.yml", false);
FileConfiguration config = this.getConfig();

pom.xml
https://paste.md-5.net/ijukiyikep.xml

rotund ravine
#

show project structure

fringe yew
#

wdym

#

oh

#

plugin.yml is fine tho

#

validated all yml files and they passed

rotund ravine
#

tag mfnalex for maven help

cinder abyss
#

Hello, how can I get an accurate blockLight and skyLight for a block? I want an ItemDisplay not to be too bright in night

fringe yew
#

(sorry for ping lol)

young knoll
cinder abyss
young knoll
#

You probably have to update it constantly as time changes

cinder abyss
#

humm

#

I'll try then thanks

#

but as long as I remember, I think that it was always bright, even when updating

tender shard
undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

cinder abyss
#

lol

fringe yew
#

NOT LITERALLY

#

😭

cinder abyss
#

I like this humor

quiet ice
#

germans be like that

cinder abyss
#

lol

fringe yew
#

i just want to fix my plugin 😭 😭

cinder abyss
#

I'm french, so I was just about to make a bad joke

#

with germans

rotund ravine
#

snails

fringe yew
#

slug

cinder abyss
#

wine 🍷

#

(Alcohol consumption is dangerous for your health. Drink in moderation.)

fringe yew
#

tell that to oliver

cinder abyss
#

🤣

#

@jagged quail do you like alcohol?

fringe yew
#

he likes his vodka

cinder abyss
#

he's russian?

rotund ravine
#

that's a weird thing to like as the first thing

cinder abyss
#

(only wrong answer accepted)

rotund ravine
#

Bruh, they usually go for some sugary drink

fringe yew
#

icl this is the craziest dev talk ever

rotund ravine
#

the chats aren't so closely moderated that they go full nazi on us.

#

You should probably repeat ur question though

cinder abyss
#

okay wow

#

so tell me a "good first thing"

#

😏

rotund ravine
stiff sonnet
#

any idea how to check if a water block is a source block? Casting the water blockdata to Levelled and then reading its level doesn't seem to work.

cinder abyss
stiff sonnet
#

I wish

robust pebble
#

how woudl you run something while the server is running

young knoll
#

?scheduler

#

?scheduling

undone axleBOT
stiff sonnet
sullen marlin
#

You're casting a different block to the one you check

robust pebble
#

new BukkitRunnable() {
@Override
public void run() {
Bukkit.broadcastMessage("Mooooo!");
}
}.runTaskTimer(plugin, 20L * 10L /*<-- the initial delay /, 20L * 5L /<-- the interval */);
id put this in on enable right

sullen marlin
#

Replaced v getBlock

robust pebble
#

and is the long in milliseconds i assume?

#

like thread.sleep is

rotund ravine
#

20 ticks to a second by default

stiff sonnet
#

that was indeed the problem

waxen widget
#

hi is there someone who can help me

rotund ravine
#

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

rotund ravine
#

what u on about

#

@young knoll

#

help me

#

he's editing and adding more of those

waxen widget
#

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

young knoll
#

Oi knock it off

robust pebble
#

ask the question normally

rotund ravine
# waxen widget ?ask

It just means to ask ur question and someone will see it and think "Oh hey i can answer that shiz" and then answer it.

orchid trout
#

?h

rotund ravine
#

packets aren't received sync.

waxen widget
#

how to fix creeper immediately explodes ? i’ve been dealing with the creeper bug it explodes immediately

rotund ravine
#

Switch thread if u want to process something sync @inner mulch

inner mulch
rotund ravine
#

Again. U remember what i said earlier @inner mulch

inner mulch
#

why thread >:(

#

does some1 know how i can create a

waxen widget
#

its from aternos crossplay server

java - 1.20.4
bedrock - 1.20.73

rotund ravine
#

@waxen widget Are you developing?

acoustic pendant
waxen widget
young knoll
#

No but you can with a set of integers

acoustic pendant
#

oh

orchid trout
rotund ravine
waxen widget
#

okie thank youu

robust pebble
#

anyone have any tips with integrating webserver with mc plugin

lost matrix
#

Dont do it on the main thread

robust pebble
#

right now i just have a webserver running on localhost:8080 and im telling it how many players are online

robust pebble
lost matrix
#

Start a new thread for your webserver. And dont call methods from the game from this thread. Use the BukkitScheduler for that.

young knoll
#

Run it on someone else’s main thread

lost matrix
#

Exactly

sand spire
#

What should my order of trying to find an extern solution be when (I think) something is impossible using only the methods provided by spigot?
Between NMS, Paper and importing a library/api from https://www.spigotmc.org/ (or maybe even something else).

On top of that, should try my best to avoid any of these and why?

young knoll
#

Well

#

If you use NMS you will likely need to update the plugin every version

#

If you use paper api it won’t run on spigot

#

And if you use a third party library you rely on it being updated when needed

sand spire
sullen marlin
#

Start with what you are trying to do

young knoll
#

If you use paper exclusive methods

#

The plugin will not run on a spigot server

sand spire
sand spire
young knoll
#

The software

#

The jar you are running

sand spire
young knoll
#

No

#

The server itself

#

That you are playing on

#

Is running spigot

#

(Or paper or some other fork)

sand spire
rotund ravine
#

if u use paper api

#

u should use paper

young knoll
#

Spigot api will run on spigot and paper

#

Paper api will only run on paper

sand spire
#

ah

rotund ravine
#

Though if u use only spigot function with paper-api u can use it on spigot.

#

U have no way to know though

sand spire
#

I just followed a tutorial on day 1, I think my server is paper cause I named it something with paper in it xd but I use like 90% spigot methods

#

but I guess it doesn't matter

stiff sonnet
#

is tehre an easy way to check if .addItem will fail because the inventory is full?

rotund ravine
#

check the return

stiff sonnet
#

it's just a hashmap though

lost matrix
#

And it contains all items that didnt fit

stiff sonnet
#

oh

#

well thanks!

rotund ravine
#

Though it's kinda weird being ItemStack and amount when the amount is already in the itemstack so be careful

young knoll
#

It’s not

#

It’s itemstack and index in the initial array

#

The returned HashMap contains what it couldn't store, where the key is the index of the parameter, and the value is the ItemStack at that index of the varargs parameter. If all items are stored, it will return an empty HashMap.

rotund ravine
#

I was getting annoyed by me assumptions everytime i used it and didn't read the javadoc lel

remote swallow
#

Cast state to powerable iirc

young knoll
#

It’s part of data not state

minor garnet
remote swallow
#

Coll new pr, deprecate block data and state and merge it into block info

inner mulch
#

how can i stop flowers from being destroyed by water?

#

or torches

#

anything thats destroyed by water

tender shard
rotund ravine
inner mulch
#

i will try it out

inner mulch
tender shard
rotund ravine
#

It can

#

Literally

inner mulch
#

okay wait

tender shard
#

implements Cancellable

tender shard
rotund ravine
tender shard
#

same

inner mulch
#

flower got destroyed :(

rotund ravine
#

U did it wrong then

inner mulch
rotund ravine
#

Whatever he did

#

Then .setCancelled

rotund ravine
inner mulch
#

prove

#

send me a video of this event working the way it want it to work

rotund ravine
#

It broke

#

Enough proof

inner mulch
#

liar

#

blockphysics thing doesnt work too

#

what even is this for

rotund ravine
#

BlockFromTo works

inner mulch
#

did he cancel the event fully?

#

in this case the flower doesnt break cuz the water doesnt flow

#

not cuz the flower is immune

rotund ravine
#

He did not

undone shale
#

Hi

rotund ravine
inner mulch
#

ah

#

thats not making the flower immune tho

rotund ravine
#

It is

inner mulch
#

indirectly

#

the water is just stoping to flow

rotund ravine
#

Unless u mean playerbucketemptyevent too

#

It’s not flowing to that exact block

#

But all the other blocks

inner mulch
#

ok

wicked sinew
#

Codevision c;

rotund ravine
thin delta
#

Would it be possible to make an ender chests be shared with everyone on the server?

#

Like instead of everyone having their own ender chest details, it only uses one?

#

The purpose would be to utilize the connection function of ender chests without using unique contents

tender shard
thin delta
tender shard
#

you might have to delay opening the new inv by one tick (not sure)

thin delta
#

I was thinking of arbitrarily assigning someone's ender chest data as the "universal" ender chest

#

And then everyone just references that

#

Not sure if that's possible though

#

I'm not super experiences with developing plugins

tender shard
#

sure, that'd also work. probably you could use a "fake player" for that, e.g. create a GameProfile for a random UUID and then re-use that profile every time again

thin delta
#

This would be better

tender shard
#

although I think that it's not possible to get an offline player's enderchest

#

so yeah it'd be easier to recreate the inventory yourself, then save it in a YAML file / database / whatever

thin delta
#

Lemme find it one sec

tender shard
#

yeah but if you create a "fake player" as owner for the enderchest, you'll only be able to obtain an OfflinePlayer instance of them. And I'm like 99% sure that getEnderChest() is only available for Player (online player) objects

thin delta
#

You're probably right

#

So would this fake player just always be online?

tender shard
#

so imho you're better off by doing sth like this:

  1. Save/load the ender inventory to a yaml file on startup
  2. Whenever someone opens their enderchest (InventoryOpenEvent), cancel that event and show a custom inventory that's filled with the custom items
  3. InventoryCloseEvent -> save it again
tender shard
thin delta
#

as in the fake player idea in general?

tender shard
#

?xy

undone axleBOT
tender shard
#

TL;DR: you can't

#

you'll have to check all tohse things manually

#

what's your actual goal?

thin delta
#

Also, remind me. NMS is essentially minecraft's actual code whereas spigot is just interferring with events?

tender shard
#

like, once per server?

#

and when the item disappears (e.g. used up, or burnt up in lava, etc) it's craftable again?

#

okay I see. it's not THAT complicated. I would do it like this:
When the item is craftef, set a boolean to true (save that in a config or whatever)
Then you gotta listen ONLY to two events:

  1. ItemDamageEvent (or EntityDamageEvent?) not sure how it's called. check if the damaged entity is instanceof Item, if so you can get the ItemStack, and check if it's your custom item. If yes -> set the boolean to false again
  2. The event that's called when a "usable item" (e.g. pickaxe) gets damaged. Then check if new durability is 0, if yes -> same as above, set the boolean to false again

And then ofc only make the item craftable if your custom boolean is true

#

that's the best solution I could think of. Not sure if there's any better way, but I doubt it

#

hmmm good question, I haven't thought about that. But I think there's an event for that too

#

yeah my way is usually to just "get the job done" and then later, listen to players complaining, then you can always improve it haha. unfortunately, I don't know any better way

#

np!

#

alternatively... you could ofc loop over all online player's inventories, loop over all items laying on the ground (World#getEntities) and also loop over all chests etc (loop over all loaded chunks, then nested loop for all Chunk's getTileEntities() -> instanceof Container -> getInventory) but that'd 1. be a fucking burden and 2. wouldn't allow you to detect if a offline player has that item in their inv

tender shard
restive mango
#

Anyone have a good resource for how to manage static variables in subclasses?

I have a bunch of subclasses all with different 'names', like "dirt", "fart", "sandpaper", all inheriting from the same class which has a single 'name' variable, and when I initialize the subclass, I would like all of those things to be static.

torn shuttle
acoustic shuttle
#

Is it possible to save chunks as a Base64 string like you can items? or something like that I want to be able to load the same chunk in other servers

restive mango
#

want me to explain in detail

#

and you can tell me what to do?

#

😛

acoustic shuttle
young knoll
#

As a base64 string

#

That’s gonna be a massive string

acoustic shuttle
#

well I mean I said or something like that

#

just a way to save them to a file

tender shard
young knoll
#

Chunks are already saved to a file

#

Well, regions are

tender shard
acoustic shuttle
torn shuttle
#

tbf schematics are also a pain

#

they changed the format

young knoll
#

Yes but at least they aren’t a huge string

tender shard
#

remember: a chunk isn't only a bunch of blocks, but also information about entities and tile entities (chest contents, etc)

restive mango
#

wait

#

so do you want me to explain

#

in detail

torn shuttle
tender shard
acoustic shuttle
young knoll
#

Well no

acoustic shuttle
#

just blocks

young knoll
#

They are binary data

acoustic shuttle
#

and signs ig

torn shuttle
restive mango
#

bruh

torn shuttle
#

so I have to deal with it as a massive string regardless

tender shard
acoustic shuttle
restive mango
#

i suppose ill just do so anyway

young knoll
#

Schematics are NBT

#

How did you manage to turn that into a string

tender shard
#

also doesn't minecraft/spigot have a builtin way for "structures" now?

#

Why not use that

young knoll
#

Yeah that’s basically the same as schematics

#

Just a bit less compact

tender shard
restive mango
#

I have an effect class, 'Effect' which looks like:

public abstract class Effect implements GeneralEffect {
//GeneralEffect is just an interface with an all-purpose 'use' command

    public static String name; //name of the effect in the code

    public static Component title; //title of the effect for a menu system

    public static List<Component> description; //description of the effect for a menu system

    public static Material typeBut; //material used for the menu

    public static List<Parameter> parameterList; //a list of parameter types and limits for various parameters which can be given to the effect to modify it (e.g. make it bigger, change its color, etc.)


}

I then have a number of effects which all inherit this class, and when initialized, go through and do like
name = "fart"
title = component.text("Fart Blast");
etc.

In each effect I also have a number of nonstatic variables which are used to hold that specific effect instance's parameters, whatever the player has them set to when they run the command/use the item/etc that triggers the effect.

#

just wondering if that is good data structures or not

young knoll
#

No

restive mango
#

yah so what should i change it to you think

young knoll
#

Why do you need any of the static stuff

restive mango
#

because a player can also open a menu for all the effects and i'd prefer this junk be in one place

#

its also used for range checking

#

like e.g. you tried to create a fart blast of range 21 when it needs to be 20 or less

#

do you mean why specifically it should be static?

#

that's just

#

me wondering

#

if that helps with speed

nova notch
young knoll
#

Just have instances for each effect

#

Throw them in some kind of registry

restive mango
#

you mean have a static class for each effect

#

and then a separate class

#

for the variables?

young knoll
#

No

#

Just a class

#

That holds all the data about the effect

#

Each instance is a different effect

#

If certain effects need a bit more to them, make child classes

restive mango
#

so basically you mean don't bother with the static stuff?

young knoll
#

Yes

#

I guess you could make the registry static

restive mango
#

and just have like a hashmap of strings => effects

young knoll
#

But none of the effects need to be static

restive mango
#

in the main plugin class

young knoll
#

Yeah you can do it that way

#

That’s basically what a registry is

restive mango
#

hm

#

@young knoll what about if two players use the same effect and have input different variables, and the effect uses a bukkitrunnable which is using the variables for the effect class in the registry

#

wouldn't the first player's bukkitrunnable start generating as if it was using the second player's variables

young knoll
#

Make an effect instance class

restive mango
#

yeah

#

so i will need a separate class for variables in your suggestion

young knoll
#

That’s how minecraft works, there’s EffectType and then the actual effect

#

EffectType has all the fixed data about an effect, like the particle color or max level

#

And then the instance has the duration and whatnot

robust pebble
#

if I have agradle dependency do i have to specify it elsewhere?

cursive kite
#

I am working on a custom Auction Plugin and trying to create a live countdown on the item... I tried creating a timer which every second updates the items lore but it is not updating within the inventory..


        ItemMeta meta = displayItem.getItemMeta();
        
        List<String> lore = meta.getLore();
        
        String expireLore = ChatColor.translateAlternateColorCodes('&', 
                "&7Expires:&b " + DateUtils.getSimpleStringDifference(expires));
        
        lore.set(expiresLineIndex, 
                expireLore);
        
        meta.setLore(lore);
        
        displayItem.setItemMeta(meta);
        
    }```
young knoll
#

The item in the inventory will likely be a clone

#

You need to get a direct reference to it from said inventory

robust pebble
#

anyone here familliar with jetty?

cursive kite
#

I don't think I did... It gets saved to a list

    
    public static void setup() {
        
        auctions = getValidAuctionItemsWithin24Hours();
        
        beginTimer();
    }
    
    private static void beginTimer(){
        
        BukkitRunnable runnable = new BukkitRunnable() {
            
            @Override
            public void run() {

                auctions.forEach((id, auctionItem) -> auctionItem.update());
                

            }
        };
        
        runnable.runTaskTimer(Factions.getPlugin(), 20, 20);
    }
    
    public static HashMap<Integer, AuctionItem> getAuctions(){
        return auctions;
    }```

and when putting into the inventory

```ItemStack displayItem = AuctionManager.getAuctions().get(itemID).getDisplayItem();
            
            inv.setItem(slot, displayItem);```
#

That is not cloning it right

young knoll
#

It is

cursive kite
#

Ah how so

young knoll
#

Pretty sure setItem is going to clone your item into a minecraft one

robust pebble
#

im implementing a dependency and when I run the plugin its throwing a classnotfound exception

cursive kite
#

What is a way to resolve the issue then

young knoll
#

Get an instance of the item from the inventory

#

And modify that

robust pebble
#

shade?

young knoll
#

Yes

#

?shading

#

Darn

#

You need to add the dependency to your jar

#

Either via maven shade plugin or shadowJar for gradle

robust pebble
#

dependencies {
implementation 'org.eclipse.jetty:jetty-server:11.0.7'
implementation 'javax.servlet:javax.servlet-api:4.0.1'
compileOnly "org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT"
} so ur saying this isnt enough

young knoll
#

You have it set to implementation

#

But do you have the shadowJar plugin

robust pebble
#

nope

young knoll
#

Include that

robust pebble
#

do I have to do implementation"com.github..."

young knoll
#

?

robust pebble
#

oh i see

young knoll
#

You already have it set to implementation

robust pebble
#

so shadow jar saves as -all.jar

#

aight it works

robust pebble
#

wrong channel?

severe thicket
#

maybe

#

quite possibly

#

yes it is

proven musk
#

how would I put an items name into chat

#

like not the display name but the actualy name

robust pebble
#

add a toString method

proven musk
#

that shows the internal name

#

I tried .getLocalizedName but it didn't show anything

#

I tried getTranslationKey but its just the key

#

idk how to translate it

robust pebble
#

custom item?

proven musk
#

just a regular item

robust pebble
#

o

proven musk
#

whatever the name is translated to for the player

worldly ice
#

you can use components

proven musk
#

elaborate please

worldly ice
#

you can use a translatable component with a key of #getTranslationKey

proven musk
#

ty!

worldly ice
#

np!

proven musk
#

how would you do custom durability?

young knoll
#

PDC and the item damage event

proven musk
#

so youd have to track it and then set the damage to the correct percent?

young knoll
#

Yeah

proven musk
#

ty!

lament tree
#

Figuring out how to correctly have every player have a recovery compass on joining the server in their ninth hot bar slot without having any inventory bugs, any ideas?

#

I’ve tried using inventory event listeners but they just delete and re create items

#

I’m looking for more of restriction

drowsy helm
#

if its buggy you arent doing it correctly

lament tree
torn shuttle
#

hotloading? nah, cringeloading

#

I bricked my hotloading setup

vital void
#

Anywhere here experienced with sending chunk update packets to client ?

#

Any know of any resources for it. I can get code to work perfectly no errors but dosent actually do anything client end

#

?chunkupdate

lament tree
#

@drowsy helm event.setCancelled(true)?

proven musk
#

can you like

#

add ui using itemdisplays and text displays

#

can you parent them to the players head

eternal oxide
#

yes, but good luck with the math

proven musk
#

slay

#

also uhm

#

how would you make an entity only visible to a certain player

#

is that annoying d o u have to delve into packets

eternal oxide
#

or easier, set visible by default to false, then use showEntity

proven musk
#

oh awesoem thanks

#

this is on the TextDisplay class, what do I use instead??

thin delta
#

Are you able to convert offline players to online players?

#

Trying to open an ender chest of an offline player

eternal oxide
#

there is no replacement at this time

proven musk
#

why would u deprecate something without a replacement :|

eternal oxide
#

it tells you in the javadocs

proven musk
#

what does that mean

#

what api

eternal oxide
#

do you understand what an API is?

proven musk
#

I assume its the thing im using

eternal oxide
#

yes, Spigot/Bukkit

proven musk
#

Im just confused why they depricate it before replacing it

eternal oxide
#

so the deprecation message says this element may change in the future

proven musk
#

mmm

eternal oxide
#

so use with caution

proven musk
#

weird

#

I didn't know depricate could be like that

eternal oxide
#

its just an advisory

sullen marlin
#

It can be however you want it to be

#

That note can probably be removed by now

proven musk
#

I guess its just weird when intellj expects depricate to mean "dont use this"

eternal oxide
#

in Spigot if a deprecation doesn't tell you to use a replacement, you continue to use that method.

proven musk
#

alr ty

#

how do display animations work ive never understood

#

like

#

if I wanted a text display to shrink to 0 over its lifespan

#

I set the transformation but it just is automatically that

#

even if I set the interpolation to 20

eternal oxide
#

which interpolation?

#

theres two settings for interpolation

#

delay and duration

#

delay = how long (in ticks) before the interpolation begins.

#

duration = how many ticks it will take to perform the interpolation

#

20 ticks = 1 second

proven musk
#

I set the duration to 20

#

the delay to -1

#

it just shows up as the transformation I set it to when I spawn it which makes sense

#

but how would I have it start at scale 1,1,1 and then move to 0,0,0

eternal oxide
#

-1 is not a valid delay

#

and 20 is just 1 second

proven musk
#

yep

#

what do I set it to them

#

I set it to -1 bc people were saying to do that idk

eternal oxide
#

how long do you want it to take to go from one state to the final one?

proven musk
#

1 second

eternal oxide
#

rather fast

#

however, ok.

#

if you set teh delay to 0 and duration to 20

#

so long as your Transformation is correct, it will take 1 second to go from its original state to teh transformed state

proven musk
#

doesn't work

eternal oxide
#

Then your transformation is wrong

proven musk
#

it just starts at the transformation

#
TextDisplay display = event.getPlayer().getWorld().spawn(event.getBlock().getLocation().add(0.5,0.5,0.5), TextDisplay.class);
display.setText(ChatColor.GRAY + "Tool xp: " + ChatColor.GREEN + "+" + xp);
display.setBackgroundColor(Color.fromARGB(0,0,0,0));
display.setVisibleByDefault(false);
display.setBillboard(Display.Billboard.CENTER);
display.setInterpolationDuration(20);
display.setInterpolationDelay(0);
var transformation = new Transformation(new Vector3f(0,0,0),new AxisAngle4f(0,0,1,0),new Vector3f(0.5f,0.5f,0.5f),new AxisAngle4f(0,0,1,0));
display.setTransformation(transformation);
display.setSeeThrough(true);
event.getPlayer().showEntity(Main.instance,display);``` im doing 0.5,0.5,0.5 for testing so I can see that it is in fact there
eternal oxide
#

?paste your code for spawning thsi display

undone axleBOT
proven musk
#

it makes sense to me why this wouldn't work

#

bc its setting the initial transformation

#

i just dk how i would set the NEXT transformation

eternal oxide
#

first, use teh spawn method that takes a Consumer, so you can set all the vaules before it spawns.

proven musk
#

then what

#

because im already setting the values before it spawns

#

will it just work if its already set to something

eternal oxide
#

you are not

proven musk
#

I mostly just dont get how this whole thing works

eternal oxide
#

you are spawning it, then setting values

proven musk
#

right

#

why is that bad

eternal oxide
#

it will spawn in an undefined (default) state

#

you want it invisible to start

proven musk
#

no

#

I want it visible to start

eternal oxide
#

display.setVisibleByDefault(false);

#

thats invisble

proven musk
#

to every player but the one I want

eternal oxide
#

and you then show it to one player

proven musk
#

im confused

eternal oxide
#

yes, you are currently flashing it up for everyone, then hiding it and showing it to one player

proven musk
#

ok

#

ok so after I do the consumer then what

eternal oxide
#

use the Consumer method

proven musk
#

how do I get it to animate

eternal oxide
#

then extend your duration to longer than one second and see if it makes any difference

#

if it doesn;t your transformation is wrong

proven musk
#

wrong how

eternal oxide
#

I've not played with transformations so I can;t help you there

proven musk
#

damn

#

still wont work

#

anybody who knows transformations around here

vital void
#

Looking for information on client based chunks

proven musk
#

client based chunks?

#

oh

vital void
#

Yeah

proven musk
#

sorry I thought u were telling me to do that

#

I was confused

vital void
#

Hahah

#

All good mare

proven musk
#

and basically just be an icon on the screen

vital void
#

Data pack maybe?

proven musk
#

im assuming its probably not very possible but if there are fixes for any of the issues (view bobbing, rotation weirdness, shading) then lmk

#

how would that help

eternal oxide
#

don;t use the eye location

proven musk
#

its a passenger to the player basically

eternal oxide
#

well, use teh pitch and yaw of eyeLocation

#

ah

proven musk
#

bc Im assuming anything else would cause desync from the server

eternal oxide
#

I assumed you were displaying it based on eye location

proven musk
#

no idk how id do that

eternal oxide
#

if its a passenger it will move as the player moves

proven musk
#

and I assume it would be even less smooth

#

sigh I thought this would be cool

#

and actually allow you to have custom ui

worthy yarrow
proven musk
#

right

worthy yarrow
#

Scary scary

worthy yarrow
#

(Obviously)

#

But it’s been made and quite smooth at that

proven musk
#

really

worthy yarrow
#

Ya know the rideable pearls?

proven musk
#

so its possible?

worthy yarrow
#

Like a fun toy in hubs of servers

proven musk
worthy yarrow
proven musk
#

so i want some sort of menu to tell you what food is in your slots

#

worst case its just in the chat

#

but it would be cool to do it like thr mod

worthy yarrow
#

Wait are you trying to make like those icons at the bottom right?

proven musk
#

yeah

#

in some capacity

worthy yarrow
#

Ohhh I thought you were talking about a concept such as you throw a pearl but when thrown the player is riding it

proven musk
#

nah

#

thats easy thats like one command in a datapack

worthy yarrow
#

Hmmm I wonder if you could manipulate display entities in a way to get those kinds icons

#

I’m sure Elgar knows more than I do

zealous osprey
proven musk
#

weird it womt have thr same issues

#

right

zealous osprey
#

ah @eternal oxide already said something about a passanger, whoops, didn't read that far. Sorry

proven musk
#

im already doing a passenger

zealous osprey
#

hm

clear elm
#

how can i create an config file`?

#

public static FileConfiguration config; config = getConfig(); i have this and its not creating one

eternal oxide
#

?configs

undone axleBOT
vital void
#

Anyone here familiar with nms? And sending chunk packets to players

acoustic pendant
#

If I need an event to manage a lot of things and it is bugging a bit if I do it all in one method.
Should I still do it there or créate another method or class?

tardy delta
#

wdym bugging, just create some methods so it looks clean

fallen eagle
#

What is the problem with the command?

tardy delta
#

well if you dont know

#

check args.length before indexing it

fallen eagle
tardy delta
#

there may not be any args, ensure args.length > 0

fallen eagle
tardy delta
#

line 26, learn to read stacktraces

acoustic pendant
dawn flower
#

how do i make an effect similar to the vanilla "can break" without the ugly lore showing on the pickaxe

tardy delta
#

havent played mc in a while but whats that effect?

dawn flower
#

basically lets you mine certain blocks only

#

the rest makes it look like you're in adventure mode

tardy delta
#

uhh dunno never heard of

rough drift
dawn flower
#

oh

#

tysm

rough drift
#

np

tardy delta
#

was looking for it in the docs but couldnt find it..

rough drift
#

I just have intelli open lol

dawn flower
#

so uh im gonna make a custom mining system but before i get surprised is that possible with spigot without nms? custom mining is basically modifying how fast you break blocks

torn shuttle
#

hm, has no one ever created a gui to manipulate resource packs?

acoustic pendant
dawn flower
acoustic pendant
#

There's an event, don't remember the name that lets you manage that

acoustic pendant
#

Yea that

dawn flower
#

what about showing block damage

rough drift
dawn flower
#

so nms

rough drift
#

Use protocollib for that

#

nope

#

you can just use protocollib

dawn flower
#

i don't think using a whole lib for 1 packet is very efficient

torn shuttle
#

oh buddy

#

mc packets are fucked

rough drift
#

^

#

you also don't need to shade it

torn shuttle
#

I mean I can't really talk here, I still went ahead and did it myself

dawn flower
#

i found this

#

Player#sendBlockDamage

rough drift
#

it's a stand-alone plugin, a lot of plugins use it so ¯_(ツ)_/¯

torn shuttle
#

but in fairness protocol lib wasn't updating to the latest mc version so

rough drift
torn shuttle
#

that's my excuse

rough drift
#

Yep, then you can use that @dawn flower

dawn flower
#

aight

#

thanks

rough drift
#

np

dawn flower
#

quick question, if i cancel BlockDamageEvent does it cancel the breaking animation or do i have to use mining fatigue for that

chrome beacon
#

mining fatigue

dawn flower
#

ok

dawn flower
#

what's a good way to make an addon system for a paid plugin without giving people a free copy of the plugin

lost matrix
#

Write an api, which doesnt include your plugin ofc

cinder abyss
#

Hello, is there a quick way to get every blocks with a certain PDC in all worlds without too many resource consuming? Or should I use a List stored in a file on server disable?

eternal oxide
#

Not all chunks are loaded all the time, so it would be impossible to check all PDCs

cinder abyss
#

LinkedList or List?

eternal oxide
#

why do you need to list them all?

cinder abyss
eternal oxide
#

doesn't explain why you feel you need to keep track of them

cinder abyss
#

to avoid checking if there a block with this PDC on every PlayerMoveEvent

cinder abyss
eternal oxide
#

why use PL to make them display?

cinder abyss
#

so to avoid lag

eternal oxide
#

thats not going to reduce lag

cinder abyss
#

for server?

eternal oxide
#

you are already spawning them so they exist

cinder abyss
#

yeah, actually, but I want to replace this spawning by a packet

#

but this is not the subject

eternal oxide
#

then all you need to keep track of is where the displays are

cinder abyss
#

not for after

#

because when It'll be with packet I can't track a thing that doesn't exist

eternal oxide
#

of course you can;t

cinder abyss
#

(I think)

eternal oxide
#

If you are replacing these to be packet based, they only exist in your code and on the client

eternal oxide
#

so Your code needs to keep track of every details

#

so No PDC

#

they literally do not exist on the server if you are going packet based

cinder abyss
#

yeah

#

but I want to store the PDC in a block

eternal oxide
#

there is no PDC, it will not exist as the entity does not exist

cinder abyss
#

to identify the base block and make the ItemDisplay appear to cover him

eternal oxide
#

I saw teh code

cinder abyss
#

I don't want the block to be passed through

eternal oxide
#

passed through?

#

as in walkable?

cinder abyss
#

no...

eternal oxide
#

you want a solid ItemDisplay?

cinder abyss
#

yeah !

#

not the ItemDisplay being solid

#

but the ItemDisplay cover a block which is solid

#

and I make the ItemDisplay disappear when the block is broke

eternal oxide
#

thats the same thing

cinder abyss
eternal oxide
#

what is the block?

cinder abyss
#

It'll be a crafting table

eternal oxide
#

then it has no PDC of its own, use 7smile7s blockpdc

#

?blockpdc

undone axleBOT
lost matrix
#

Thats from alex ^^

eternal oxide
#

ah alex

cinder abyss
#

😭

eternal oxide
#

yes, pointless

#

no need to store all that

#

just read teh PDC on teh block when you need it

cinder abyss
#

but how can I identify the block?

eternal oxide
#

its PDC

cinder abyss
#

but I will not loop for all blocks?

eternal oxide
#

no

#

at what times will you need to show teh display and remove it?

lost matrix
#

The blockpdc system is suitable for a few random blocks within a chunk.
Storing bigger masses of data should be done in a different way to prevent the chunk file from exploding in size.

lost matrix
#

What are you trying to do?

cinder abyss
cinder abyss
eternal oxide
#

then only when a specific block is placed/broken and at chunk load/unload

lost matrix
cinder abyss
#

it's a block placed rarely

eternal oxide
#

then blockpdc

lost matrix
#

Ah then blockpdc is perfect

eternal oxide
#

as I already saiud

cinder abyss
eternal oxide
#

monitor block place/break and chunk load/unload

cinder abyss
#

I'm a bit lazy with english today x)

cinder abyss
lost matrix
#

Btw i would load your data from the PDC into memory when the chunk is loaded. And den dont use it until its unloaded again.
Checks on a Map are faster than creating a new BlockPDC to see if it exists on a location.

cinder abyss
#

simple Map? Or LinkedHashMap?

dawn flower
#

what's the paste url again?

#

.paste

#

?paste

undone axleBOT
dawn flower
#

https://paste.md-5.net/zurazirubo.pl

 public void call(Event event, Player player, int level) {
        if (!callConditions(event, player)) {
            return;
        }
        if (!playerVariables.containsKey(player.getUniqueId())) {
            playerVariables.put(player.getUniqueId(), new HashMap<>());
        }
        if (actions.containsKey(level)) {
            Map<String, String> variables = new HashMap<>();
            for (String action : actions.get(level)) {
                try {
                    if (!evaluateAction(event, player, action, variables)) {
                        break;
                    }
                } catch (Exception ex) {
                    player.sendMessage(ChatColor.RED + "An unexpected error has occurred: " + ex.getMessage());
                    break;
                }
            }
        }
    }```
#

this is the line that's throwing the exception for (String action : actions.get(level)) {

#

cough

eternal oxide
#

You didn;t post any error

dawn flower
#

i did

echo basalt
#

Sounds like gson to me

dawn flower
#

i aint using gson

echo basalt
#

LinkedHashMap o_o

dawn flower
#

not sure then

#

i dont even have gson in my dependencies

fallen eagle
echo basalt
#

Anyways your actions map has a linkedhashmap instead of a string on its value

neat shore
#

how can i get all visitor access?

echo basalt
fallen eagle
echo basalt
dawn flower
echo basalt
#

Learn to read a stacktrace and figure it out yourself

fallen eagle
echo basalt
#

I don't think that's intentional

eternal oxide
echo basalt
dawn flower
#

oh wait

#

actions is supposed to be a string list

echo basalt
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

dawn flower
#

ok now im confused, im never casting actions to string, i'm casting it to string list

echo basalt
fallen eagle
echo basalt
#

The stacktrace contains the exact line your problem's at

fallen eagle
vast ledge
#

brother

echo basalt
#

Brother I'm not gonna spoon feed you your answers

#

You won't end up developing any critical thinking or problem solving skills with this approach

fallen eagle
echo basalt
#

If you want me to code it for you, it's a service not help

vast ledge
#

There Is usually a Caused by: at the bottom of an Error Message, this allows you to identify the problem, in your case, theres an Index out of Bounds exception

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at com.tekocraft.tekocore.commands.MainCommand.onCommand(MainCommand.java:26) ~[TekoCore.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 9 more
#

And index out of bounds occurs, when you're trying to access something in a array thats not there

echo basalt
#

(when you're trying to access an element at an index beyond the array's size)

vast ledge
#

Yea

#

xD

fallen eagle
#

Is it possible that the error is in line 26?

vast ledge
#

Yes

tardy delta
#

bruh still same error

echo basalt
#

Maybe

vast ledge
#

Thats whats creating the error

neat shore
#

!verify yongjun5835

undone axleBOT
#

This account is already verified!

tardy delta
#

i told you it was at line 26

dawn flower
#

you have to check if the size of the list before trying to get element x of the list

vast ledge
#

Yes

dawn flower
#

of array or whatever

vast ledge
#

or catch

#

The error

tardy delta
#

i also told you how to fix it

fallen eagle
dawn flower
#

a size starts at 1 and the index starts at 0 btw

tardy delta
#

i did

vast ledge
#
            if (args[0].equalsIgnoreCase("reload")) {
                subcommandReload(sender);
                return true;
            }
#

Instead of doing that

#

before that

#

check that args.length > 0

dawn flower
#

add if (args.length >= 1)

fallen eagle
vast ledge
#

?

dawn flower
#

on top of your command do

if (args.length < 1) {
  return false;
}```
vast ledge
tardy delta
#

actually return true if you dont want that stupid permission message to be printed

vast ledge
#

Just love AIkar for his framework xD

dawn flower
#

regarding my error, do i do
for (Object action : actions.get(level)) instead of String action?

vast ledge
#

Got the trace?

dawn flower
fallen eagle
#

I put args.lenght > 0 && args[0].equalsIgnoreCase("reload"); And it works now

#

Is it repaired or it will bug?

tardy delta
#

repaired

vast ledge
#

Why

dawn flower
#

oh my god

#

i just found out why, i'm using yaml for custom "coding" and forgot to put ""

fallen eagle
#

tysm

tardy delta
#

dunno they said cloud was better, and that you couldnt do things like user <name> set parent <parent> in acf, instead only user set parent <name> <parent>

vast ledge
#

Brother

#

3 edits

#

its enough

vast ledge
#

But i like the simplicity of ACF

tardy delta
#

never used anything else than acf, either used the builtin stuff or wrote a framework myself, which sucked

vast ledge
#

I understand that shit like this can look scary at first glance but still

vast ledge
tardy delta
vast ledge
#

EWWW

#

Kotlin

#

I was boutta say

#

taht aint the java i write

tardy delta
#

not the prettiest kotlin code i gotta agree

vast ledge
#

I just dont like kotlin it weird..

fringe yew
#

fr

ivory sleet
dawn flower
#

Cast may be removed by changing the type of 'action' to 'String' how do i suppress this

ivory sleet
#

and it wont be that weird

#

but obv its not ideal usage of kotlin

vast ledge
#

xD

#

i dont think he wants to change it

#

he wants to suppres the warning

dawn flower
# tardy delta by changing it to string

but then i cant add this

if (!(action instanceof String)) {
  TurboEnchants.logger().warning("Failed to parse enchant '" + this.getName() + "'. Please make sure your actions are surrounded by \".");
  return;
}```

and if they accidently not add " it just throws abunch of exceptions
tardy delta
#

where even does action come from

dawn flower
#

a yaml config

#
myenchant:
    event: "player-damage-entity"
    conditions:
     - "!is-sneaking"
    actions:
      1:
       - "send-message hello"```
tardy delta
#

i dont even know what happens when calling config.getString and its not a string

vast ledge
#

It might just cast to a string

echo basalt
#

prob just calls toString if it's primitive

dawn flower
#

alr

#

i'll just do String.valueOf

#

yeep that supressed it

#

how do i get the damage cause from a damage event

#

found it

tardy delta
#

might want to read docs

dawn flower
#

how do i get the death cause from a death event

#

im srs

#

this might be not coding related but how do i make this regex '(%.*?%)|([^ ]+)' only have 1 match in a situation like this %hello %percent2%% and not 2 matches

echo basalt
#

I'd recommend you make a parser instead of regex

#

Get the number of %'s and start matching

dawn flower
#

alr

stiff sonnet
#

is there an event or a method that I can override that gets executed right after a server reload finishes?

stiff sonnet
#

oh well thanks!

dawn flower
#

your onEnable method

#

ServerLoadEvent = onEnable

stiff sonnet
#

hm

#

oh I guess I'll use that then

drowsy helm
#

Incorrect

stiff sonnet
#

I guess I'll not

drowsy helm
#

If that were the case they wouldve had one event@

dawn flower
#

bro

#

when you reload all plugins reload

#

and onEnable is called when the plugin is reloaded

stiff sonnet
#

does seem to be the case according to the logs

drowsy helm
#

ServerLoadEvent > OnLoad > OnEnable

stiff sonnet
#

onEnable works fine for my use case then

orchid trout
#

dont you have to register the listener in onenable

#

hows that work

stiff sonnet
#

is there a hook for blocks that break when they have no block they're sitting on? It's for some reason not in BlockBreakEvent, and the BlockPhysicsEvent is not useful since I then run into the dilemma of finding out which blocks would be affected, again
Edit: Shiddy solution, but works:

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    void onBlockNoSupport(BlockPhysicsEvent e) {
        if (!e.getBlock().getBlockData().isSupported(e.getBlock().getLocation())) {
            onBlockBreak(new BlockBreakEvent(e.getBlock(), posFindOwner(e.getBlock().getLocation()).getPlayer()));
        }
    }
dawn flower
#

so onEnable is called before ServerLoadEvent

slim gate
#

org.sqlite takes too much space in jar, I'm using maven. To be exact, the package "org.sqlite.native" takes the most

dawn flower
#

file size?

sullen canyon
chrome beacon
#

You don't need to include it

slim gate
#
 <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.45.2.0</version>
        </dependency>
#

i use that

tall dragon
#

add <scope>provided</scope>

tardy delta
sullen canyon
dawn flower
#

intellij uses a trash theme tbf

tardy delta
#

go ask microsoft

slim gate
sullen canyon
dawn flower
#

even with their new "clean" ui it still looks trash, too much junk in the way

dawn flower
#

not ide code

sullen canyon
#

gimme the theme

tardy delta
#

default github dark ig

slim gate
stiff sonnet
#

does .subtract or similar on BlockVector3s do the same as on locations where they get modified instead of just returning the result of the maths operation?

#

there doesn't seem to be a clone method

ivory sleet
stiff sonnet
#

ugh

knotty swan
#

java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer.getHandle()'
at me.fe4thers.mcs.TabList.onPlayerJoin(TabList.java:281) ~[MCS-1.0.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor73.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:git-Purpur-2169]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.4.jar:git-Purpur-2169]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.4.jar:git-Purpur-2169]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:345) ~[purpur-1.20.4.jar:git-Purpur-2169]
at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleConfigurationFinished(ServerConfigurationPacketListenerImpl.java:134) ~[purpur-1.20.4.jar:git-Purpur-2169]
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:18) ~[purpur-1.20.4.jar:git-Purpur-2169]

Hi im trying to make a tablist but then without the players with their playernames and head and stuff, but Im getting this error.

#

pom:
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>

code:
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
UpdateTabList();

    List<UUID> uuidList = new ArrayList<>();
    for (Player player : Bukkit.getOnlinePlayers()){
        uuidList.add(player.getUniqueId());
    }
    ClientboundPlayerInfoRemovePacket packet  = new ClientboundPlayerInfoRemovePacket(uuidList);
    for (Player player : Bukkit.getOnlinePlayers()) {
        ((CraftPlayer) player).getHandle().connection.send(packet);
    }


}
#

help would be appreciated cus I have been stuck on this for 12 hours :(

young knoll
#

Are you reobfuscating with specialsource

dawn flower
#

why...

#

Player#hidePlayer

knotty swan
#

that will hide the players in game aswel

dawn flower
#

you can hide 1 player for 1 player

lost matrix
#

Paper has methods to hide players from the tablist

dawn flower
#

player.hidePlayer(playerToHide)

undone axleBOT
vast ledge
#

please

lost matrix
knotty swan
knotty swan
lost matrix
#

Sure, whats the problem with that

young knoll
#

?whereami

slim kernel
#

anyone knows why this is throwing this error? Worked in the past i dont think i changed anything..

File directory = new File(Main.getPlugin().getDataFolder(), "/plots");
        if (!directory.exists()) {
            directory.mkdir();
        }
        for (File file : directory.listFiles()) {
            final PlotData data = (PlotData) new PluginJsonWriter().getDataFromFile(file, PlotData.class);
            plotData.putIfAbsent(data.getId(), data);
        }
java.lang.NullPointerException: Cannot read the array length because "<local2>" is null
        at com.itzjustnico.plertanixplot.plots.PlotHandler.<init>(PlotHandler.java:42) ~[?:?]
        at com.itzjustnico.plertanixplot.main.Main.onEnable(Main.java:30) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:536) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:450) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.reload(CraftServer.java:935) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at org.bukkit.Bukkit.reload(Bukkit.java:802) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.dispatchCommand(CraftServer.java:844) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.dispatchServerCommand(CraftServer.java:829) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at net.minecraft.server.dedicated.DedicatedServer.bh(DedicatedServer.java:413) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:389) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1200) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1017) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3753-Spigot-7d7b241-b346a5f]
        at java.lang.Thread.run(Thread.java:833) ~[?:?] ```
knotty swan
lost matrix
#

?paste

undone axleBOT
lost matrix
knotty swan
#

okay ill try it im probably stupid

lost matrix
slim kernel
lost matrix
knotty swan
ocean hollow
#

Why doesn't InventoryClickEvent work in the player's inventory?

    @EventHandler
    public void swap(InventoryClickEvent event){
        if(event.getAction() != InventoryAction.SWAP_WITH_CURSOR && event.getAction() != InventoryAction.HOTBAR_SWAP) return;

        ItemStack cursor = event.getCursor();
        ItemStack current = event.getCurrentItem();
        
        if(current == null) return;
        if(!current.hasItemMeta()) return;
        if(!current.getItemMeta().getPersistentDataContainer().has(MoreBullets.WEAPON_TYPE)) return;
        if(cursor.hasItemMeta()) return;
        event.setCancelled(true);
    }
``` it works in chest, but it doesn't work in playerInventory
slim kernel
lost matrix
#

Btw this File constructor wont create a directory

lost matrix
#

For a folder you should just use new File(Main.getPlugin().getDataFolder() + "/plots")

#

or use nio

young knoll
#

Smh use the 2 param constructor

slim kernel
young knoll
#

File#exists

lost matrix
young knoll
#

You don’t need to append anything

#

You can just do new File(getDataFolder(), “plots”)

lost matrix
#

If you dont append anything then it is resolved as a file

young knoll
#

Meh

#

Only relevant if you are checking #isDirectory

lost matrix
#

Or you call mkdir on it

young knoll
#

mkDirs works fine

lost matrix
#

It wont create a "plots" folder, will it?