#help-development

1 messages · Page 1025 of 1

dense oracle
#

what do u mean?

torn shuttle
#

whatever it's not worth fixing, I'll modify an interaction entity instead, I'm only going to run into other problems

dense oracle
#

;)

#

or what do u mean?

icy beacon
#

io.papermc.paper

dense oracle
icy beacon
#

?fork

undone axleBOT
#

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

icy beacon
#

we cannot guarantee that all spigot plugins work on paper because we don't know what paper does

#

either rerun and verify that this happens on spigot or refer to paper for support

polar forge
#

Guys, how do I tp a player to another world using pressure plates and a command block?

quasi gulch
#

/execute command

polar forge
#

I know

#

I did, but how do I define the other world

#

I wrote

quasi gulch
#

ìn world

#

wait i opne mc

polar forge
#

Execute as @p at @s run to “coords” “world”

kind hatch
#

/execute in <world_name> run tp <player_name> X Y Z

polar forge
#

It’s not always fixed to only one player

kind hatch
#

Then substitute it?

river oracle
#

Replacements be like

polar forge
kind hatch
#

The @ selectors

polar forge
#

Yes @ what? p s a

quasi gulch
#

look up whats best for your situation

kind hatch
#

^

#

p = player
s = selected/current entity
a = all players
e = all entities
r = random
n = nearest (soon to be)

polar forge
#

It doesn’t work

#

I’m having “impulse, unconditional and needs redstone”

#

And the same code, but I replaced it with @s

dense oracle
#

is nearest player

polar forge
#

Oh thx!

tender shard
#
Minecraft Wiki

Target selectors are used in commands to select players and entities arbitrarily, without needing to specify an exact player name or a UUID. One or more entities can be selected with a target selector variable, and targets can be filtered from the selection based on certain criteria using the target selector arguments.

kind hatch
#

Fandom. cries

tender shard
#

why does everyone hate that site so much

icy beacon
#

it does inconveniences to its wiki owners iirc

dense oracle
#

just tested

icy beacon
#

same error?

dense oracle
#

yup

icy beacon
#

can you click Ctrl+Shift+F (global search) and search for UNCOMMON?

#

oh now VERY_RARE

#

bc i don't see it anywhere

#

oh

#

i see it now

#

are you remapping properly?

river oracle
dense oracle
chrome beacon
#

The maintainers of the fandom page have moved to minecraft.wiki

icy beacon
#

show your pom

#

?paste

undone axleBOT
chrome beacon
#

so you should be using that

dense oracle
icy beacon
#

no

#

?nms

dense oracle
lost saffron
#

does someone know how to compile a plugin into a jar file dm me if u know

#

its to hard

#

can someone do it for me

river oracle
#

Lol wat

#

Pretty sure every project preset intellij makes a jar by default

dense oracle
lost saffron
#

i used chatgpt to make the plugin

river oracle
#

In the inventory view yes

pseudo hazel
#

then use chatgpt to compile it

river oracle
lost saffron
#

why

icy beacon
pseudo hazel
#

chatgpt can probably explain precisely how to compile it

lost saffron
#

can i send the code and yaml thingy

#

then can someone compile it?

icy beacon
#

do NOT download jar files from strangers

kind hatch
#

10 bucks says chatgpt didn't even say to use maven

river oracle
#

Inventories don't have raw slots

#

Only views do

kind hatch
lost saffron
#

i don have a jar file

icy beacon
icy beacon
river oracle
lost saffron
#

plz someone help

river oracle
#

Yes

tender shard
pseudo hazel
#

yes, there are only armor slots in a player inventory..

icy beacon
lost saffron
river oracle
#

But armor slots are part of the player inventory

#

They aren't separate

tender shard
icy beacon
tender shard
#

that doesnt look correct

icy beacon
#

but that also works

lost saffron
#

ok

pseudo hazel
#

its not 100

#

wtf

lost saffron
#

but i dont know how to install maven

river oracle
pseudo hazel
#

armor slots are right after the others

river oracle
#

I'm not on pc so I can't check nms

lost saffron
#

thats the problem

tender shard
kind hatch
#

I swear, there are too many pictures floating around. All with different numberings.

tender shard
#

crafting is 41, 42, 43, 44, and result is 45

icy beacon
#

that's outdated i think

pseudo hazel
#

wdym

#

there are only armor slots in the player inventory

river oracle
#

Where are you getting thr item from

pseudo hazel
#

if you open a chest, the view doesnt have armor slots

river oracle
#

The view or the inventory

#

Inventory doesn't have raw slots

#

I've said this already

tender shard
#

the picture I sent works for PlayerInventory#getItem(...)

river oracle
#

It has the slot numbering that's all

#

It starts at 0 ends at size - 1

tender shard
#

correct

pseudo hazel
#

yeah just the players items

river oracle
#

It Returns PlayerInventory

#

getOpenInventory gets the open inventory view

lost saffron
#

name: HacksPlugin
version: 1.0
main: com.yourname.hacks.PluginMain
api-version: 1.16

icy beacon
pseudo hazel
#

dude, either learn how to make a plugin properly or ask gpt to help you compile it

lost saffron
#

i have no experiance of making plugins

river oracle
#

Shit ass code

icy beacon
pseudo hazel
#

neither did I when I started

icy beacon
icy beacon
#

chatgpt is not taking spigot dev's jobs anytime soon

river oracle
#

Lmfao chatgpt doesn't know pdc

#

I bet you it's 3.5

#

Not even 4

icy beacon
#

just like that

pseudo hazel
#

yeah probably, but I doubt youll ever need the players crafting slots

lean pumice
#

How i can do the PlayerVelocityEvent with the packetsevents?

river oracle
#

Yes

sleek estuary
#

onenable is thread safe? spigot 1.8

tender shard
#

yes

tender shard
#

TL;DR yes

echo basalt
#

So they're all right and wrong at the same time

dense oracle
#

im sry, that i got so much errors today...
i cant register my enchantment
i think i know why, but i dont know, if its possible
i read some things about the registry. i cant just register my enchantment with it, bc the client does not have the registry entrie right? but is it still possible to register an "empty" enchantment, just the name, max lvl etc?
thats my (relevant) code:

echo basalt
#

Registries eventually get frozen

#

you gotta unfreeze and do some weird beyblading in the code base to get it to work

slender elbow
#

or just wait until 1.21 for proper custom enchantments support via data packs 😄

dense oracle
slender elbow
#

it's right around the corner anyway

dense oracle
#

yeah, but i wont use it for like 3-6 months so nah

echo basalt
#

doesn't 1.21 launch like next week?

dense oracle
#

yeah
in 6 days

pseudo hazel
#

yup june 13th

#

and md will be there to launch spigot the next day (says me blissfully ignorant of the workload)

torn shuttle
#

ok

#

did I dream that when setVisibleByDefault is toggled to false it didn't register hitboxes for players?

#

I swear that was a thing

#

no?

#

this hitbox bs makes 0 sense

#

why does it just randomly cancel some projectile damage

river oracle
#

It's in the snapshots

torn shuttle
slender elbow
torn shuttle
#

I swear they have 2 hitboxes

#

this shouldn't be possible

echo basalt
#

or whatever the term is

torn shuttle
#

displays do have a bounding box

icy beacon
torn shuttle
#

but when I don't have an underlying entity the arrows do not bounce at all

#

they just go through

#

this doesn't make sense

#

also sometimes I straight up see it triggering twice

icy beacon
river oracle
icy beacon
#

istg

#

i'm releasing 2.2 and moving to rust idk

eternal oxide
river oracle
torn shuttle
eternal oxide
#

Who knows with mojang 😛

torn shuttle
#

fantastic I am getting different behavior when my client doesn't see the entity spawn

#

so they are client-authoritative I think

#

which, btw, why

#

mojang

#

why would you let clients say what they hit

eternal oxide
#

less processing for the server, but bad design

river oracle
#

Get gud

torn shuttle
#

sure and it's more convenient for me if my bank has no login number or password but it wouldn't be a very good bank if anyone could hop on and use my money

#

mojang is already using the most basic aabb hitbox system possible, I'm sure you could load it on the server with minimal overhead

eternal oxide
#

My bank is a bitch. I have to use name + password + online banking code + 2fa AND Chip+pin authorization.

torn shuttle
#

lmao you're not even using a security matrix card

#

get good

eternal oxide
#

hehe

torn shuttle
#

say hello to how I do banking

#

if you want to do basically anything you better bust this out because it will ask for 3 numbers

#

also the login is with a bank-issued code

eternal oxide
#

I have a littel calculator thing, I have to insert my bank card in, then ask for a number from teh bank, type it in, get a response code, put that into the website, then get a 2fa auth key, pluss all my other info. Just to check my balance

torn shuttle
#

also we do also have 2fa

#

yeah I have that calculator as well

#

so they can't sniff your keystrokes

eternal oxide
#

frigin nightmare. Wifes is just username + password

#

different bank

torn shuttle
#

the worst part is, if you use the app, basically none of this is required

eternal oxide
#

yeah

torn shuttle
#

I can log in with just my fingerprint and validate any transaction

#

but they refuse to let me do simple 2fa via website

#

it makes no sense

#

they already have lowered security standards for the app, I don't know why they imagine the website should be less convenient for added security

eternal oxide
#

I maybe use it once a year as its such a pain to log in

torn shuttle
#

I have to use it multiple times a month for my business and I really do not like doing it on my phone for business, it sucks

vast ledge
torn shuttle
short drift
#

What's the deal with player.sendBlockDamage(location, damage) ? I can't get it working.

#

It's blinking like crazy.

torn shuttle
#

never messed with that too much but iirc it's a very fickle thing because if you stop applying it it resets or something, since it acts as though you stopped mining a block in mc

short drift
#

I tried applying it every tick, but that didn't really help.

torn shuttle
#

not 100% sure of how it's supposed to be used but I would assume you might want to add to the damage each time it's sent or something

short drift
#

Sometimes when you click correctly it stays on the block until you click something else.

torn shuttle
#

don't know for sure but I assume it's because of the systme that is supposed to reset blocks if you cancel mining them

#

never really messed with that specifically

stoic parrot
#

How do I get the chat message in AsyncChatEvent?
(ik this is the spigot server but paper servere is kinda ded)

ivory sleet
#

isn’t just like message() or something

#

Which gives you a component that u can deserialize into text

dire marsh
#

mojang's netcode with block breaking is a mess, it's probably blinking because the client is predicting the breaking

short drift
#

I'm also thinking maybe it's bugging out only for the grass because grass breaks normally with single click.

slender elbow
#

mojang's netcode with block breaking is a mess

short drift
#

But I'm not sure.

dire marsh
short drift
#

I have set PLAYER_BLOCK_BREAK_SPEED to 0.0.

#

So there's no client side prediction anymore.

hollow cobalt
#
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event){
        if (event.getItem() != null && event.getItem().getType() == Material.AMETHYST_SHARD) {
            if (event.getAction().toString().contains("RIGHT_CLICK")) {
                Player player = event.getPlayer();
                Location location = player.getLocation();
                Vector direction = location.getDirection();

                player.setVelocity(direction.setY(0.5).multiply(2.5));

            }
        }
    }

why do i get this error when running this

cannot find symbol
icy beacon
#

it cannot find symbol

vast ledge
#

not just 3 words

icy beacon
#

this is compile time

#

i think

vast ledge
#

rly

icy beacon
#

yeah cannot find symbol is compile time

#

this is a ?learnjava moment

dire marsh
short drift
#

Any tricks I can use?

vast ledge
#

for what?

#

oh

vast ledge
#

that

tender shard
short drift
#

For displaying the (fake) block breaking animation without it blinking/resetting.

dire marsh
short drift
#

Sure, I can test that.

torn shuttle
#

you should either put it in imports or the model folder and for the rest I am pretty sure the readme is up-to-date

dire marsh
#

@short drift have you tried using the sendBlockDamage with a custom sourceId?

short drift
#

How would I get an appropriate sourceId?

#

Just any random UUID?

dire marsh
#

it's an int

short drift
#

Int? What does it do?

dire marsh
#

well all entities on the network level have an int id

torn shuttle
#

again, the readme says that

dire marsh
#

it's a UUID but for packets

vast ledge
dire marsh
#

You can probably generate it based off the block position, and probably make it negative to avoid interfering with anything, it's up to you really

short drift
#

Yes, I know what an int is. I just asking what it represents. I assumed it would have been UUID.

torn shuttle
#

yes

short drift
dire marsh
#

it doesn't care

torn shuttle
#

so this is fun, if I'm looking at this correctly the server doesn't send the actual bounding box of an entity but the default bounding box of that entity type

#

oh wait

#

I might be wrong actually

pseudo hazel
#

could probably manipulate it to get what you want

young knoll
#

The server does not send the bounding box at all

torn shuttle
#

oh hey I fixed it

young knoll
#

The client just knows the bounding box for each entity type

torn shuttle
#

I don't think so?

dire marsh
#

coll is correct

short drift
#

Mojang doesn't like to send data if they don't have to.

young knoll
#

However, it's pretty easy to attach an interaction entity and redirect all interactions from it to the actual entity

dire marsh
#

^

short drift
#

Which is a sensible approach. But poison for modding.

dire marsh
#

not sending a flying packet every tick to save 1MB an hour, absolutely killing anticheats.

torn shuttle
#

well

torn shuttle
#

one of two things can't be true then, either the server decides arrow collisions (which makes sense tbh) or the client gets bounding box updates (which would make less sense)

young knoll
#

The server decides arrow collisions

torn shuttle
#

yeah now that I got it working that does seem to be the more likely thing

dire marsh
#

the client tries to predict stuff though

torn shuttle
#

but at the same time I was getting some downright bizarre behavior

#

might be a bug

young knoll
#

Old model engine uses custom sized slimes for hitboxes

#

New one uses interaction entities

short drift
#

Ok, so I tried setting the break animation only once. And yes, it does reset.

#

Next I'll try the negative integer.

torn shuttle
#

but if you send a client a spawn packet for an entity, then modify the bounding box on the server, and shoot the entity, the arrow will almost always bounce off giving a damage event that is cancelled

#

but if you hide the entity from the player and do the same modification to the hitbox it works

#

if you think that doesn't make sense, well, 🤡

young knoll
#

Mojank

torn shuttle
#

it has to be partially client authoritative though

#

I mean why else would it get cancelled and double trigger

torn shuttle
#

it does require exposing private fields and hiding the underlying entity from the client but now it works

#

I was going to do interaction entities but that just makes it annoying for some stuff

short drift
#

Setting the PLAYER_BLOCK_BREAK_SPEED to 0.0 does, however, remove all glitchy client side block breaking animations for materials which break normally with a single click.

#

So that's nice.

torn shuttle
#

besides this has the fortunate side effect that the mojang pathfinding does take the bounding box into account by default so the entities will actually pathfind correctly even with large hitboxes (i.e. large entities won't go through small spaces)

#

well, they will not just phase through them

short drift
#

Oh yeah! Setting the id to -2 definitely does work!

torn shuttle
#

I think they might still try to go through, haven't tested that yet

short drift
#

Let me shoot that on a video for you.

young knoll
#

I did both

#

Since the client would use the normal hitbox for attacking/right clicking

#

So I added an interaction entity for that

short drift
dire marsh
short drift
#

@dire marshThat's very cool. Excellent advice. Thank you so much. I was getting desperate.

#

Now I'll just have to spend 12 months rewriting all Mojang damage logic and tool breaking logic etc.

#

Funny, though. I use break naturally, but the grass doesn't make breaking sound or drop anything. It just disappears.

torn shuttle
#

same as filename, no extension

#

nametagName is the name you want to see in-game, though be warned I am literally programming the part that actually displays that right now so it's not currently implemented

#

though I guess it will be implemented tomorrow

#

that's the underlying entity

#

yeah

#

also while I'm sure people are thrilled that this is now a support room for my plugins it might make more sense for you to post questions about my plugins in my support discord, not here, plus I'm about to go to the gym and there's a 0% chance that I will respond to support messages here

#

I don't do dms, you can find that discord link in my spigot projects

hollow cliff
#

Hello!
I am developing a plugin with Minecraft/Spigot Version 1.20.6, ProtocolLib 5.1.0. I am trying to edit the server info packets. I am getting no errors in console and I tried debugging and can confirm the event is working but there are no changes occurring

This code is in my onEnable:

getServer().getPluginManager().registerEvents(this, this);
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Status.Server.SERVER_INFO) {
            @Override
            public void onPacketSending(PacketEvent event) {
                WrappedServerPing packet = event.getPacket().getServerPings().read(0);
                packet.setPlayersOnline(69);
                packet.setPlayersMaximum(70);
            }
        });
#

On the protocollib website, it says to use 5.3.0 for >= 1.20.5 but I can't get that version working in my pom, i went to check the repository and couldn't even find it

chrome beacon
#

5.2.0-SNAPSHOT is the latest version

hollow cliff
#

I used the search feature on this discord and found out that you have to write event.getPacket().getServerPings().write(0, packet); at the end of the event

hollow cliff
#

feel silly finding it 1 minute after asking 😭

fair rock
#

Its okay to feel that way but its nice too that you found your solution c:!

meager wolf
#

i have heard somewhere that items have rarities, for example, dirt is "common" and its in white, and enchanted book is "rare" and its in blue, and like, enchanted golden apple is mythic, and its in pink, is there really a rarity system in minecraft or is it just the item name color

young knoll
#

I think it really only effects the color

#

But yes there is a rarity system

pliant topaz
#

Is there a way I could directly kinda import a json loot table as a loot table object? or would I have to create the logic myself

#

just liek a normal loot table fro datapacks

#

so, yea

young knoll
viscid sail
#

I have the BlockState for a specific sign in Minecraft. I'm trying to modify it programmatically without relying on deprecated packages. While the 'Sign' interface seems ideal, many of its methods are deprecated. This leaves me with the 'SignSide' interface as an option, but I'm unsure how to convert the BlockState instance for the sign into a compatible SignSide instance. Any assistance would be greatly appreciated!

young knoll
#

Sign#getSide(Side)

viscid sail
fair rock
young knoll
#

yes

pseudo hazel
#

its like Sign.getSide but for documentation stuff I guess

icy beacon
#

normally # denotes class methods and . denotes static methods when talking about docs

dense oracle
river oracle
viscid sail
#

It seems like methods in the SignSide interface are also deprecated although it doesn't say in the docs?

lost matrix
#

The docs define if something is deprecated or not in the first place.

chrome beacon
#

You're most likely depending on Paper

viscid sail
blazing ocean
#

paper deprecates a lot

#

?whereami

chrome beacon
#

^^

pseudo hazel
#

if its deprecated in ide but not on spigot docs, its paper messing around

upper hazel
#

why section.load or YmlConfiguration.load not reload config?

chrome beacon
#

it does

upper hazel
#

nah when i change value in section plugin does not react

#

like i not change it

chrome beacon
#

well you haven't provided any code on how you use the config

#

nor have you specified which load method you're talking about

#

so we can't really help you

upper hazel
chrome beacon
#

That still doesn't show how you're reading from the config

upper hazel
#

when i use command

#

plugin invoke

#

reloadConfig method

chrome beacon
#

that doesn't answer the question

upper hazel
chrome beacon
#

still doesn't show how you're reading from the config

upper hazel
pseudo hazel
#

can I cancel the player teleport event and prevent the player from teleporting?

#

event.setCancelled(true) doesnt seem to work

upper hazel
#

somenthing wrong with impl classes

chrome beacon
echo tangle
#

i imported CraftPlayer from the spigot-1.20.6-R0.1 jar yet can't use CraftPlayer, and i get a red line under CraftPlayer?

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

chrome beacon
#

?nms

pseudo hazel
#

hmm, ill test it again then

chrome beacon
#

Make sure Spigot is up to date

#

and that you're actually using Spigot

pseudo hazel
#

me?

#

yeah im on latest spigot

chrome beacon
pseudo hazel
#

but im still seeing if its me messing up the code

#

because sadly its not the simplest code xD

#

organizing players across multiple worlds

#

hmm yeah it might be me

#

xD

#

im teleporting them myself again after

echo tangle
chrome beacon
#

You're making everything harder for yourself by depending on the jar

young knoll
#

^ Use maven

#

Mojmaps are best

tender shard
#

eeew

#

is someone not using a build tool?

#

yikes

#

what is this, 2003?

chrome beacon
#

ant existed back then kekwhyper

tender shard
#

oh

#

well I was 8 years old back then, so forgive me for not knowing that lol

chrome beacon
#

I was born in 2003 💀

#

I just googled it

tender shard
#

dude you're younger than my boyfriend

#

get some help boykisserdead

fair rock
echo basalt
#

05

jagged quail
#

@austere cove your long lost twin in here

fair rock
quasi gulch
#

Schön Knakiges Brot

jagged quail
blazing ocean
austere cove
tardy delta
#

you left the door open

#

silly

haughty granite
#

hello, in 1.20.4 the command below worked but now it doesn't work in 1.20.6 and I don't understand how to adapt it with the data components
/give @a minecraft:potion 1 {Potion:"water",display:{Name:'{"text":"Eternal Fluid","color":"yellow"}'},Enchantments:[{id:unbreaking,lvl:1}],Unbreakable:1,HideFlags:38}

fair rock
#

Not again, please dont shoot my legs again 💀 Im swear im not running again RUNS FAST

haughty granite
chrome beacon
#

or even better the mc commands discord

chrome beacon
#

^^

#

was about to say

fair rock
blazing ocean
#

it's decent

quasi gulch
#

I think it looks ok and overseeable

blazing ocean
#

yea

fair rock
#

The colors 💀

quasi gulch
#

just black xd?

blazing ocean
#

they're fine

fair rock
#

Its like Lasertag Arena

chrome beacon
#

Better than most sites for Java obfuscators

fair rock
#

Black and Neon lights 😂

quasi gulch
#

You studie art xd?

fair rock
#

Hell nah, just working full time with a frontend team 💀 They would burn us for that 💀
But im backend and that has a reason xd

quasi gulch
#

well he doenst have a frontend team i would think xd

pliant topaz
#

isn't it just one guy developing it?

quasi gulch
#

so he can do what he wants and no one can do anything xd

pliant topaz
#

and doing frontend i mean

haughty granite
fair rock
#

For just one person, its good, like my own projects. I think he like backend more than frontend just as me xd

chrome beacon
blazing ocean
#

yes

#

pyro

#

did

quasi gulch
#

tried it also it works on 1.20.6

#

Do you have essentials installed?

haughty granite
fair rock
quasi gulch
#

do minecraft:give

#

essentials overides all vanilla commands and makes them worse

haughty granite
#

love u

hollow cliff
pliant topaz
#

nms or protocollib, and up to this day, i still don't know what's better lmao

chrome beacon
#

PacketEvents uwu

#

tbh it depends on the goal and server

quasi gulch
#

if you just wanna use packets and dont wanna update your plugin every time a new version comes out protocollib is best if you want to use more then protocolLib offers you shouldnt use it

pliant topaz
#

thats another option, i think i will try all of em atleast once

pliant topaz
tender shard
tardy delta
#

¯_(ツ)_/¯

pliant topaz
sacred light
#

Does anyone know how to force a spawn?

Ex: I left the game at 112, 32, 64 and when I rejoin I want to be at spawn (124, 64, 240

pliant topaz
#

u can teleport the player upon playerjoinevent

tender shard
blazing ocean
sacred light
#

Where do i find that

tender shard
#

somePlayer.spigot().respawn()

acoustic shuttle
kind hatch
#

Why respawn specifically when you can just teleport?

tender shard
#

oh my bad, I didn't properly read

#

I thought it was about "forcing a player to respawn", not "spawn on join at specific location"

#

this is the correct event to force a spawn after joining ^

sacred light
#

Ok

kind hatch
#

I'm surprised there's an event for it.

pliant topaz
#

didn't even know there was another event tracking player join something haha

tender shard
#

it was added in 1.8 iirc added in 1.7.10

pliant topaz
#

;-;

short drift
#

I get the output "Setting block speed to 1.0".

#

But I can't break some things.

#

Like carrots.

#

Weird?

pliant topaz
#

carrots are instabreak, prob blockbreakspeed would be null i suppose?

#

does it say that?

short drift
#

Oh ... interesting.

#

That's a great theory.

tender shard
#

what even is the purpose of that code? where/how are you calling it?

short drift
young knoll
#

Setting the base value to 1 does not mean the final value is 1

#

There may be modifiers altering it

short drift
#

Doesn't really matter for me.

#

Basically I'm only handling the insta break blocks.

#

Well, maybe it's easier to show.

#

Grass normally insta breaks.

young knoll
#

Make sure there are no modifiers

short drift
#

I think the sound pitch is wrong, tough. It seems Mojang doesn't use 1.0.

young knoll
#

It depends on the block

#

iirc spigot exposes that somewhere

short drift
#

Oh? Nice.

#

That's great. I'll look it up.

short drift
#

But, what do you mean by the modifiers exactly?

young knoll
#

To the attribute

#

The base value is transformed by any modifers to get the final value

short drift
#

I mean. That's the base value. So I assume modifiers would get applied normally.

echo tangle
#

so i have this depedency in my maven

  <groupId>org.spigotmc</groupId>
  <artifactId>spigot</artifactId>
  <version>1.20.6-R0.1-SNAPSHOT</version>
  <classifier>remapped-mojang</classifier>
  <scope>provided</scope>
</dependency>```
and whenever i try to use CraftPlayer I get that it cant be resolved, even though it's in the spigot jar?
pliant topaz
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

young knoll
#

Have you run buildtools

echo tangle
#

yeah

pliant topaz
#

not completely sure, just thought it might be of help but idk really

chrome beacon
#

?nms

young knoll
#

Did you run it with the remapped flag specifically

echo tangle
#

yeah

echo tangle
river oracle
#

how are you compiling

#

@echo tangle ^

short drift
# pliant topaz carrots are instabreak, prob blockbreakspeed would be null i suppose?

Only that ... yeah, it's not block specific. That attribute affects all breaking equally.
I also tried setting the event priority to highest, but it made no difference.
So what happens is on BlockDamageEvent I check if it's on my list - if it's not I set the base break speed to the default 1.0 value and simply exit. But the carrots will have none of that nonsense.
It somehow acts as if the break speed was still 0.0.
However dirt blocks etc break as they should.

#

So it's kind of weird.

#

Same with torches. Probably all insta break blocks.

#

But why - no idea.

#

Or ... wait .. I need to test whether it's just incredibly slow to break.

tender shard
#

also be sure to set your JDK to java 21 at File -> Project Structure -> Project -> SDK in IntelliJ

short drift
#

Nope. Trying to break it for couple of minutes - nothing happens.

young knoll
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

short drift
#

Was that for my benefit? Sure, here:

    @EventHandler(priority = EventPriority.HIGHEST) public void onBlockDamageStart(BlockDamageEvent event) {

        // If player is holding a tool, increase block break speed.
        var player = event.getPlayer();
        var block = event.getBlock();
        var blockType = block.getType();

//        var toolType = player.getInventory().getItemInMainHand().getType();

        // If not an instantly breaking block, exit early.
        if (!instantlyBreakingBlocks.contains(blockType)) {
            System.out.println("Block is not instantly breaking, exiting early.");
            allowNormalBreakingSpeed(player);
            return;
        }
// Etc, doesn't go here.
#
    private void allowNormalBreakingSpeed(Player player) {
        var playerBlockBreakSpeed = player.getAttribute(Attribute.PLAYER_BLOCK_BREAK_SPEED);
        if (playerBlockBreakSpeed == null) {
            System.out.println("Player block break speed was null, can't set block break speed!");
            return;
        }
        System.out.println("Setting block break speed to 1.0");
        playerBlockBreakSpeed.setBaseValue(1.0);
    }
#

There's really not much to it.

#
  1. Is it on the list? No:
  2. Set break speed to 1.0.
young knoll
#

Is carrots in the list

short drift
#

Works for most blocks just fine.

#

No, carrots are not on the list.

young knoll
#

Try and break carrots and then lets see what your break speed actually is

#

/attribute @s player.block_break_speed get

short drift
#

Weird, right?

#

I suppose I might have a theory, but the fact that this doesn't happen to all blocks kind of squashes it.

#

I think ... one possibility might be that the same thing does happen to all blocks.

#

But for blocks that are not insta-break, the event fires more than once.

#

The second time it fires the value has already been set to 1.0 - allowing it to break.

#

But for insta-break blocks it never fires more than once.

young knoll
#

It's possible it doesn't update the players breaking speed when they are already in the process of breaking a block

short drift
#

Right. Hm.

#

I mean, it's not really the end of the world. I can fix this by simply handling ALL insta-break blocks.

#

There aren't that many of them.

#

But it does seem kind of fragile.

echo basalt
#

You could apply the modifier when the player looks at a block

#

but that can cause latency issues

short drift
#

Or perhaps on playerinteract. I think it might fire before BlockDamageEvent.

pseudo hazel
#

how do events work, do they call the handler methods instantly or next tick?

young knoll
#

instantly

pseudo hazel
#

ah good

#

thanks

young knoll
#

If they were next tick idk how cancellable would work :p

pseudo hazel
#

then my hacky way will work

#

oh yeah good point haha

#

time travel I guess

#

undo redo pattern

#

idfk

short drift
#

Using PlayerInteractEvent kind of works.

#

But I'm not sure if I want to do that.

#

There's so much stuff going on in that event.

#

It would require quite a bit of defensive coding. And still might end up with edge cases I didn't think of.

#

It's not fun to deal with. I think It might rather just handle all the insta break blocks in special cases.

sullen canyon
short drift
#

Oh, hm. FiraCode I think.

#

Or something like that.

sullen canyon
#

ty

short drift
#

It's a pretty solid font.

#

It gets out of the way and doesn't really bother you.

#

Which is what a good font does.

blazing ocean
#

size 17!?

#

mine is set to 11 lol

tardy delta
#

jetbrains mono?

#

mine is 13

blazing ocean
brittle geyser
#

How to replace blocks faster than FAWE? How FAWE fast replace blocks?

#

i need replace certain chunks, 1000 chunks per second

chrome beacon
#

If you're swapping the entire chunk that might be possible

#

but you'd need some quite intrusive nms code

pseudo hazel
#

is the easiest way to fill an area with blocks (or air) just to loop and use setType?

blazing ocean
pseudo hazel
#

okay nice

silver robin
#
public void onBlockBreak(BlockBreakEvent event) {
    Block block = event.getBlock();
    plugin.getLogger().info("broken a block at " + block.getLocation());  // gets logged
            
    block.setType(Material.BEDROCK);  // doesn't work

    block.getWorld().setBlockData(block.getLocation(), Material.BEDROCK.createBlockData());  // doesn't work
} 
``` When a player breaks a block I want to put bedrock there, how to do that?
tender shard
#

set it one tick later

silver robin
#

by the way I pulled this code from a 1.16.5 plugin and it works there
has anything changed?

tender shard
#

usually it should work without delaying, unless you cancel the event

echo tangle
echo tangle
tender shard
#

maven doesn't have a "build" lifecycle

silver robin
tender shard
#

is there another plugin cancelling the event?

silver robin
#

literally nope

#
plugin.getLogger().info("Event is cancelled? " + event.isCancelled());``` it logs false, even when event handler is registered with listener priority highest
#

I'll make sure and remove all other plugins now and try again yeah even with the only plugin, it still doesn't replace the block

echo tangle
tender shard
echo tangle
#

under run as, there is an option for maven build and clean?

tender shard
#

run mvn package and then show the full output

wet breach
#

this way we can ensure previous compile tries are not interfering

echo tangle
#

too long to send

tender shard
#

?paste

undone axleBOT
kind hatch
#

?paste

undone axleBOT
echo tangle
tender shard
#

it compiled fine, so what's the issue

echo tangle
#

i can't access craftplayer

tender shard
#

did you set your JDK to java 21 in eclipse?

kind hatch
tender shard
#

iirc they did run buildtools, otherwise maven would have already complained

echo tangle
#

i have build tools

kind hatch
#

Wait, you're using eclipse?

echo tangle
#

yeah

kind hatch
#

oof

river oracle
#

@worldly ingot do you know of these eclipse shenanigans?

kind hatch
#

Is it not detecting your local m2?

echo tangle
#

i assumed it is

echo tangle
river oracle
#

only other thing would be java 21 maybe?

#

though I thought we already checked that

tender shard
#

why not just use intellij :p

echo tangle
#

i wanna try new things

tender shard
#

which version of eclipse are you running? (Help -> About Eclipse)

echo tangle
#

2024-03 (4.31.0)

tender shard
#

Which "JRE System Library" does it mention in "Java Build Path" in settings?

echo tangle
#

when thats set to 21 i still get the same error + additional ones

tender shard
#

tbh I'd just switch to intellij

#

maven + eclipse is a pain

kind hatch
#

Preferences > Maven > User Settings
What path is set there?

tender shard
#

just use intellij and it'll magically work :p

echo tangle
#

my .m2 repo

kind hatch
#

wack

echo tangle
eternal oxide
#

whats the issue?

kind hatch
#

Maven with eclipse

echo tangle
#

can't get craftplayer to work even though i supposedly have the depedency for it

eternal oxide
#

exact issue? his log looks like it built fine

kind hatch
#

Apparently they aren't getting access to nms.

eternal oxide
#

right click your pom -> maven update project

echo tangle
#

update project does nothing

kind hatch
#

Have you tried setting the <localRepository> tag in the pom?

eternal oxide
#

it shoudl have taken a second or two to rebuild

kind hatch
eternal oxide
#

else, select the project in the Package Explorer, then click Project menu at the top and clean

eternal oxide
#

error?

kind hatch
#

?img

undone axleBOT
#

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

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

echo tangle
#

just that craft player isnt valid

#

i might aswell just use intellij at this point

eternal oxide
#

have you pasted yoru pom for us yet?

echo tangle
#

o

eternal oxide
#

your special source is too old

kind hatch
#

dang it

eternal oxide
#

current version is 2.0.3

echo tangle
#

oh bruh

kind hatch
#

I was gonna say that

echo tangle
#

thanks lol

glad prawn
#

try it

#

just try lol, thats easiest way to know

drowsy helm
#

No

#

Any world interaction has to be on main thewad

#

Yeah you can

small valve
#

Is there a way to get a list of banned players for that server on Bungeecord without using plugin messaging?

wet breach
#

could store banned players in a DB instead

small valve
#

😭

#

also trying to avoid that, i guess PM is the way to go 😔

harsh ginkgo
#

hi, I'm trying to disable chunk save in ChunkUnloadEvent event using setSaveChunk(false), but it doesn't work. Does anyone have an idea what it is?

wet breach
echo tangle
#

don't know if this counts as development, but for eclipse ide, i did something and now my java files have no color and i can't hover over to see errors or see the selections after the . does anyone know how to revert or fix this?

wet breach
#

hope this helps find the relevant areas in the configs

echo tangle
#

yeah but it all happened at the same time so i assumed it was related. also part of my code is fine and formatted previously and the other part is broken

wet breach
#

could try reloading the IDE but would probably undo whatever change you did

#

if you believe its related to it

echo tangle
#

reloading?

wet breach
#

restarting

echo tangle
#

oh yeah i've tried that

wet breach
#

@worldly ingot don't you use eclipse?

small valve
wet breach
#

what do you mean yet another database?

#

DB's are kind of a routine thing in regards to managing and hosting servers

#

also, there is only so much data that the yaml file can handle before it takes too long to load or save as well

#

so eventually you will need a DB at some point

#

but not setting one up because you don't like setting them doesn't seem like a good reason to avoid doing it, to include going routes that end up not being ideal

river oracle
#

why not use SQLite

#

if you're too lazy to setup an offsite DB or setup mysql on windows

#

which is a pain in the ass

worldly ingot
#

Right click the src folder, Build path -> Add to build path

#

Or something like that. Can't remember the exact phrasing of those settings

echo tangle
pseudo hazel
#

my own xD

#

well its more of a library not relaly an api

#

but its just for my own plugins haha

#

idk any others

ivory sleet
#

InventoryFramework, TriumpGui and Interfaces are good ones

#

But realistically you could write a nice one yourself since there really isn’t a lot to handle other than checking which slot a player clicked

echo tangle
#

is there a way to see the updated versions of stuff like PacketPlayOutDestroyEntity in remapped mojang

worldly ingot
#

Probably ClientboundRemoveEntity or something like that

echo tangle
#

o im stupid thanks

late sonnet
pseudo hazel
#

oh yeah I saw your coment

late sonnet
pseudo hazel
#

oof

#

yeah I tested it with justa give command and its borked there too

#

except on singleplayer ofc xD

#

so yeah def craftbukkit

late sonnet
#

Thanks 1.13 xd

dawn flower
#

how do i rotate this (block displays)

#

i tried with transformation but it didn't do what i wanted

#

nvm i figured it out

young knoll
#

?mappings

undone axleBOT
echo tangle
#

oh, thank you!

quaint mantle
#

do you guys use ORM's?

drowsy helm
#

Not for plugins

#

For websites, yes

bitter rune
#

For website integration would it be better to change my plugin to save into a database? Or is there an easier way to pull information from the server ?

drowsy helm
#

Yes, database ideally

#

But depends on what you’re doing

#

If it’s live data, then a socket or rest api would work

quaint mantle
drowsy helm
#

Depends on what language

#

But for java yeah hibernate is probs the best

bitter rune
#

How can I draw

#

Something like this, the top would d be the avatar of a person then the stats that are in my custom plugin, live stats isn't necessary, they can logout to see them refresh

drowsy helm
#

Yeah database would be ideal for that

umbral ridge
quasi gulch
ivory sleet
#

Idk seems to be some casting issues if I read that trace correctly

quasi gulch
#

Okay but i dont really know what to do with it. And why its a mix out of two different plugins. Or how to fix it

ivory sleet
#

well it also seems like ur connection is null

quasi gulch
#

Both plugins work without error seperatly

eternal oxide
#

Not sure you can relocate h2. I know you can't SQLite

ivory sleet
#

Does one of the plugins use the storage and database stuff from the other one?

quasi gulch
#

no both dont use code from the other one

#

but if you cant relocate sqllite how does it not get errors from other plugins using sqllite?

#

Thought you needed to relocate it

eternal oxide
#

SQLite natives can;t be relocated

#

they are hard coded in SQLite so alwasy look to teh original locations

#

no clue if h2 is the same though

#

If you are on current spigot just use teh libraries section of plugin.yml

quasi gulch
#

what does that mean? Whats a library section?

ivory sleet
#

well they’re using paper, but paper has that library feature also

eternal oxide
#
libraries:
    - com.h2database:h2:2.1.214```
#

or whatver version you use

quasi gulch
#

okay and what does that do? does that download the libary into the spigot.jar so not every plugin needs it to implement into their plugin or?

eternal oxide
#

Spigot downloads the lib and injects it into the plugins classpath

quasi gulch
#

so i wouldn't need to add it to my jar file?

eternal oxide
#

correct

#

just the entry in the plugin.yml

quasi gulch
#

ahh ok thanks

ivory sleet
#

Anyway justin iirc the way luckperms deal h2 and sqlite is not by relocation

#

But by isolated classloading

quasi gulch
#

whats that

ivory sleet
#

Obv yk how luckperms download dependencies at runtime

#

For h2 and sqlite they download the jars but they load the them up w the like platform classloader or whatever u call it

#

That way its isolated from the minecraft app

quasi gulch
#

okay and the problem with h2 is it cant be relocated and then gives me the error because i did?

ivory sleet
#

I assume it can’t be relocated, I mean I’d also assume you can find a workaround

quasi gulch
#

So normaly relocation would fix this problem with other depencys for example just for me to understand

eternal oxide
#

yes

#

it works in one plugin as part of it can;t be relocated, so a single plugin is looking at the original locations. It breaks when you have two plugins because the loaded native classes now belong to one plugins classpath

ivory sleet
#

And normally you don’t have to relocate because shaded dependencies get scoped to ur plugin classloader (I think at least)

eternal oxide
#

The second plugin can;t access that classpath

quasi gulch
#

okay i dont know what shaded depencys are?

ivory sleet
#

its when u include them in ur thicc jar

quasi gulch
#

Ohh ok

ivory sleet
#

such that when ur jar is loaded into runtime, yea then those classes are made sure to be loaded as well

quasi gulch
#

How would i know if a depency can be relocated or is loaded only into my classloader?

shadow night
ivory sleet
#

well, drivers tend to not be relocatable, but most libraries will be, it has to do with that the library maybe do class lookups and weird shit behind the scenes

#

Well its not like its only loaded into ur jar classloader, but its more like u have this parent-child tree of classloaders

quasi gulch
#

so its like either the docs tell me or its like rusian roulett and i will see at runtime xd

ivory sleet
#

yea lol

quasi gulch
#

i think i will have to look at classloaders first dont even know whats it rellly is

ivory sleet
#

Yea

#

I mean java has an obscure “api” in their std lib to handle and manage loading classes if so needed

#

and by api its like 1 class

#

I’d recommend checking out luckperms source also

quasi gulch
#

ok thanks

upper hazel
quasi gulch
#

Show your code at the lines in the error

upper hazel
#

I figured it all out. I accidentally used metrics from the API plugin

solid tiger
#
int radius = 7; // Adjust as needed
                for (int x = -radius; x <= radius; x++) {
                    for (int y = -radius; y <= radius; y++) {
                        for (int z = -radius; z <= radius; z++) {
                            Block block = player.getLocation().getBlock().getRelative(x, y, z);

Can I use something else to fing player in radius?

shadow night
#

getNearbyEntities?

#

Oh, there is an overload with a filter

shadow night
#

oh, it's about blocks

#

I'm high

floral drum
#

P sure anyway

wintry elk
blazing ocean
#

that's not how you use them

#

NamespacedKeys are identifiers

rich flume
#

thats some wild code

blazing ocean
#

like, minecraft:water is a NamespacedKey

#

also

#

NamespacedKeys always have to be lowercase

rich flume
#

you might just want to use metadata instead for this

blazing ocean
#

^

blazing ocean
#

28 char indent KEKW

rich flume
#

good lord

blazing ocean
#

nested commands go brrr

fair rock
blazing ocean
rich flume
#

isnt that bridigar?

blazing ocean
#

it's cloud

rich flume
#

oh

#

i thought cloud was annotation like acf

fair rock
#

That code looks like my if if if if if if statements xd

blazing ocean
#

except that there's nothing else you can do here

fair rock
#

Tf is cloud or bridigar?

blazing ocean
#

they meant brigadier

rich flume
#

^

blazing ocean
fair rock
#

I googled brigadier and got Brandies. Hell yeah i need that lmao

#

Is brigadier the minecraft command builder?

blazing ocean
#

yea

tardy delta
#

only ever been using acf, is there like a good kotlin one?

blazing ocean
#

cloud

tardy delta
#

wondering if they themselves think this is sane

blazing ocean
quaint mantle
#

For sure aliens made it

blazing ocean
pseudo hazel
#

you can still remove indentation but the question is if you want to do that xD

#

or qtleast move out the majority of the code

harsh ruin
#

I'm trying to use minimessage for a chat format, but it's not exactly working.. Why? How do I fix it?

var mm = MiniMessage.miniMessage();
    Component parsed = mm.deserialize(e.getMessage());
    e.setFormat(e.getPlayer().getName() + ": " + parsed );```
pseudo hazel
#

is there like a toLegacyString or something

#

or how are you sending th emessage

blazing ocean
#

this looks like it's adventure so you'll need to use paper

#

or you can try the LegacyComponentSerializer if you only want the colours

#

in general using minimessage for public chat is very dangerous because you can make text open links on click, etc

harsh ruin
#

It's not going to be used for the server i'm working for, just trying to use the colors rn

blazing ocean
stoic parrot
#

"only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:2)
"
What does this mean?

blazing ocean
#

please provide some more context

stoic parrot
blazing ocean
#

then give us the whole error

#

?paste

undone axleBOT
blazing ocean
#

and your code

stoic parrot
stoic parrot
blazing ocean
blazing ocean
#

how are you compiling it

stoic parrot
#

maven clean, compile, install

blazing ocean
#

like on the left sidebar of that

#

if you click on tehre it'll show the entire build log

stoic parrot
#

yeh wait ill send it

fair rock
#

...

blazing ocean
#

still the same thing

#

click on here

fair rock
#

You have to click on that what he showed you

stoic parrot
#

I'll just send the paste

#

here

blazing ocean
#

that looks like an issue with the library you're using

#

send your pom.xml

stoic parrot
#

okay

blazing ocean
#

try going to C:\Users\Ammar\.m2\repository\studio\xstream\KeyAllX and deleting the maven-metadata-local.xml

stoic parrot
#

okay

#

It worked now

#

Thanks!

#

Any idea why that happened tho?

blazing ocean
upper hazel
#

what link should I use to check releases in github

#

for UpdateChecker

wintry elk
#

ok i got an error and its saying this "Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because "vextarget" is null"

young knoll
#

Sometimes the target can be null

#

You should check for that

pliant topaz
#

I saw that when every world containing a bukkit plugin creates a bukkit datapack which is empty (or atleast mine, running paper tho this is not a paper question so please don't send me the whereami 🥲). Is it possible for me to modify this datapack so I can add files to it automatically? and if, how would i do that?

fresh cloud
#

Not having really played Minecraft for years or especially done plugin dev, what'd be the way to go for displaying custom 3D models (made with blockbench but shouldn't matter I guess) in the world? Should have gravity but no collisions with other entities, and should be rotatable
Armor stands still?

echo basalt
#

I guess you could go for it

fresh cloud
#

dang
Feels a bit overkill for my case tho (didn't explain I know), I don't need a damageable entity or/with animations, just two 3D models that I can position and rotate through code

novel pendant
#

is there a way to get marker entities in a world? It seems like checking for entities by class is resulting in no returned markers despite there 100% being a marker entity in the world Im checking.

young knoll
#

Is it in a loaded chunk

novel pendant
#

it should be but Im not positive since I'm loading it through something else. Should I try somehow forcing the chunks to load and then check?

young knoll
#

Sure

novel pendant
#

that did it thanks, cant believe I didnt consider that may have been it 🤦‍♂️

bitter frost
#

Can someone compile this for me?

lusty cipher
#

does Item or ItemStack have any functionality where I can get the name such as minecraft:netherite_pickaxe or minecraft:shulker_box?

young knoll
#

getType and then getKey

lusty cipher
#

oh right thanks

icy beacon
#

?whereami

tardy delta
#

💀

icy beacon
#

we are spigot. we cannot guarantee that something you do on spigot behaves the same on paper

tardy delta
#

thats because opening one triggers the event again, stackoverflow

still ridge
#

wrong server :/ my bad

icy beacon
chrome beacon
#

The code is paper specific

icy beacon
#

i read "paper"

still ridge
icy beacon
#

and thus i redirected the dear fellow to a different server

lusty cipher
#

would it be possible to open an inventory and then kick off some async task that slowly loads items into that inventory?

#

and any recommendations on what async task I should use

chrome beacon
#

yes just jump back to the main thread when adding the items to the inventory

blazing ocean
#

why does it need to be async

#

bukkit api doesn't support async

#

as in events getting called

lusty cipher
#

cause it can take a few seconds sometimes

blazing ocean
#

then spawn a new task

still ridge
# icy beacon we are spigot. we cannot guarantee that something you do on spigot behaves the s...

🤔 in any case, does this code cause a crash on spigot or is it due to a lower level? (just to know)

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryType;

public class InventoryOpenEventHandler implements Listener {
    @EventHandler
    public void onInventoryOpen(InventoryOpenEvent event) {
        event.setCancelled(true);
        event.getPlayer().openInventory(
            Bukkit.createInventory(
                null, InventoryType.ANVIL, "My Custom Anvil"
            )
        );
    }
}
blazing ocean
#

why would that cause a crash?

#

and you should probably check if the event inv is an instanceof AnvilInventory or however it's called

icy beacon
chrome beacon
#

so ofc it would crash

lusty cipher
icy beacon
#

you are calling createInventory in InventoryOpenEvent

blazing ocean
#

ah right

icy beacon
#

thus calling another InventoryOpenEvent

#

and thus calling another createInventory

still ridge
#

OH :/

icy beacon
#

infinitely

chrome beacon
still ridge
#

ok I'm an Idiot

icy beacon
#

yes

lusty cipher
still ridge
blazing ocean
#

i guess you would just have a variable index and run a timer, increasing the index?

chrome beacon
icy beacon
lusty cipher
#

kinda