#help-archived

1 messages · Page 193 of 1

tiny dagger
#

you gotta do it async

rare prairie
#

Bukkit#getscheduler#scheduleSyncDelayedTask

tiny dagger
#

1 tick is 50ms

frigid ember
#

Thanks @rare prairie

#

10 ms was an example

#

Hmmm what about a next tick?

#

I'll look it up I guess

tiny dagger
#

Bukkit.getSchelduer().runTaskLater(plugin, () -> {your code}, 1);

neat oxide
#

And how would i turn a NMS loottable back into a bukkit loottable

#

i hate everything about this

#

everything

old barn
#
public static ItemStack blockgive() {
          ItemStack block = new ItemStack(Material.DIRT);
          block.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
          ItemMeta am = block.getItemMeta();
          am.addItemFlags(new ItemFlag[]{ItemFlag.HIDE_ENCHANTS});
          am.setDisplayName("§ablock");
          am.setLore(Arrays.asList("§7Bock Test", "§7Test"));
          megafone.setItemMeta(am);
          return block;
       }

How do I check if the player has that item in the inventory and how do I remove it if I do?

neat oxide
#

you save the itemstack you just created check the inventory using .getInventory and .contains

old barn
#

save the itemstack you just created, how do I do that?

vernal spruce
#

oh boy..

rare prairie
#

Inventory#contains

subtle blade
#

why do you want the vanilla loot table anyways?

#

you can get the bukkit one by just constructing a CraftLootTable

old barn
#

And how to remove the item from the inventory?

rare prairie
#

Inventory#removeItem

old barn
#

But if he had 64 items, he wanted to remove only 1, does this method remove all 64 from the inventory?

silent veldt
#

I think there's one that removes the itemstack by reference

rare prairie
#

use javadocs and find the method you want

subtle blade
#

removeItem(ItemStack) will remove that exact item and amount. If you pass an ItemStack with an amount of 5, it will try to remove 5 items

silent veldt
#

Yeah I thought there was one like that

#

You can remove by index, type.. there's a lot of methods you really should read the javadoc

#

So I'm trying to lighten up my OnPlayerJoin event. The server tends to lag a bit when players join.

#

One thing I do on login is check for duplicate IPs and to warn if the alt of a banned player logs in

#

I'd like to put this check in an Async thread and just display the message to staff afterward if there's a problem

#

Thing is, it reads from the BanList, and I know you aren't supposed to use Bukkit methods in async threads. But it's only reading

rare prairie
#

Async thread are usually requires when you want to connect to database, like mysql

silent veldt
#

Would there really be any harm in that?

#

It reads from the database too, to check the IPs

rare prairie
#

Then you can usea async task

mellow wave
#

I think you're fine if you're just going to read the player ip

silent veldt
#

I was mainly concerned about getting and reading the BanList, which is retrieved using a bukkit method

#

But I'm only reading, and honestly the ban list is rarely updated

rare prairie
#

No, if you read/change something from/in database then you should make another thread

mellow wave
#

Store the banlist on startup

silent veldt
#

Nah, just reading

#

And notifying if there's a match

mellow wave
#

I mean you could just go for reading it async too but you could just store and modify a copy of the ban list when required

rare prairie
#

yes on plugin startup

silent veldt
#

That sounds like the best way

#

I mean, is there any problem in calling #isBanned(String) from an async thread?

#

On the tiny tiny chance someone adds a ban when that happens, I wouldn't mind it being inaccurate as long as it doesn't crash anything

rare prairie
#

If the isBanned does not contain any of database/long time request stuffs, then you don't need another thread

silent veldt
#

I'm just trying to unload that method to reduce the login lag

#

I think I will just store a copy of the BanList and do it that way. Thanks for the input!

grim halo
#

There is something called the AsyncPlayerPreLoginEvent
In this event you can read data from a database.
Then prevent the PlayerLoginEvent sync.
While you block (read from a database) the AsyncPlayerPreLoginEvent the player will not connect.

wheat mirage
#

ASync pre login event is such a godsend

hollow thorn
#

how do i create a gaurdian beam

sturdy oar
#

N M S

wide cargo
#

anyone know why i keep getting warped out of the end and can't use /back to return to where i was

sturdy oar
#

EssentialsX?

wide cargo
#

i got a warning in the console that says "skipping player strafe phase because no player was found"

#

yea

#

ah

#

what could i do to resolve this ?

neat oxide
#

contact the author

wheat mirage
#

@hollow thorn World#spawnParticle or playEffect could help you

wide cargo
#

@wide cargo Actually nvm. There's a debug message in the DragonControllerStrafe class for what's being outputted to the console.
@frigid ember wait what

rapid lance
#

@wheat mirage I am the dev lol

wheat mirage
#

@rapid lance Then you may want to look in to stack traces and how to read them, it's super easy

#

Can't remember exactly what was said as it was like hours ago

rapid lance
#

Yea I’m kinda new to testing my own plugins, this is the first big one I’ve made

wheat summit
#

Hello, is there a way to summon an entitiy and make it not despawnable?

sturdy oar
#

Do they despawn?

#

I didn't know it

wheat summit
#

YUeah, would doing something like setting the ageLived parameter ticks in a task work?

#

Oh

glacial umbra
#

What does a "*" at the end of a plugin mean?

#

For example, "ASyncWorldEdit*"

sturdy oar
#

No API

#

Specified

wraith thicket
#

It's not declared an api version in plugin.yml

glacial umbra
#

Does it have any effect in the plugin itself?

sturdy oar
#

It's normal for plugins that work from 1.8-1.16

glacial umbra
#

Oh, ait

sturdy oar
#

?

wraith thicket
#

If the server sees a plugin that does not declare an api version, the compatibility layer will be used for materials for that plugin

sturdy oar
#

He's not talking about permissions

#

He's talking about the /plugins output

#

Yeah it's normal to have stars there

#

Although if a plugin does not support <1.13 you should contact the author and tell him to add API version

#

It may trigger old API for no reason

hollow thorn
#

YUeah, would doing something like setting the ageLived parameter ticks in a task work?
@wheat summit persistanceRequired

wheat summit
#

Ok, thanks,. is that a method?

hollow thorn
#

no its a tag

#

PersistanceRequired:1b

wheat summit
#

Ok thanks

#

I did that though it still didn't seem to work @hollow thorn

#

It was what I tried first

#

Is there a way to set the chests inventory name to something else?

grim halo
#

@wheat summit This tag still doesnt prevent unloading when the chunk unloads

wheat summit
#

So unloading the chunk also has a chance to despawn it?

grim halo
#

If the chunk gets unloaded then every entity there gets saved in the chunk... not sure what else you mean by despawn

wheat summit
#

Ok

grim halo
#

Or do you want to prevent removal of the entity

wheat summit
#

I am actually going to use an aLternate method since mine was not a smart one

#

Prevent removal, though I do need a better way to use it ^

grim halo
#

then maybe try setPersistent(true)

wheat mirage
#

Does anyone know where I can find some server benchmarks?

#

want to see the performance diff between 1.12 spigot and 1.16

grim halo
#

Thats rly hard to generally benchmark...

wheat mirage
#

I'm not looking for something perfect

#

I mainly want to see if theres anything that can be done to prevent the soft playercap of around 200 players

#

trying to find evidence or a reason behind everyone slamming 1.13+ servers are laggy and horrible

tiny dagger
#

or for 'mah pvp'

chrome lark
#

chunks

#

that's their major slowdown

#

Literally every form of "i need this chunk" is slower

opal heron
#

chunks

grim halo
#

I mean... you can just benchmark a 1.14 server by joining. It will just feel laggy and horrible.
For the rest im not sure. I know that 1.13 had world and chunk issues and 1.14 issues with villagers and raiders.
1.15 got a bit better and for now 1.16 feels pretty stable as well.

wheat mirage
#

I've noticed 0 issues with 1.16

chrome lark
#

then you also have the their collision logic which blows chunks in some cases, but, at least they're more accurate now

wheat mirage
#

Like you say joining will cause lag but thats just, false.

tiny dagger
#

yay accuracy

grim halo
#

Thats what i always craved in mc. More precise collision detection lefbad

wheat mirage
#

Why did they switch to such a slow system @chrome lark

#

I can see why they switched from a storage perspective

#

Infinite block ids all that

chrome lark
#

Well, in a lot of cases, it's marginally slower to the point it's irrelevant

wheat mirage
#

But why don't they care at all

chrome lark
#

issue is that any form of chunk load/gen bounces around the server a lot

#

We have a patch elsewhere to improve that

wheat mirage
#

Paper?

chrome lark
#

only problem is that by doing that, now we've found out that the lighting system is slow as all shit and causes other issues

grim halo
#

"elsewhere"

chrome lark
#

Mojang, woooo

wheat mirage
#

Are there any actual functional gameplay differences on Paper vs Regular?

#

Other than everyone will flame you out of the spigot discord for asking for help when youre using paper

chrome lark
#

I mean, if you're already running spigot, outside of dupe fixes, nope

wheat mirage
#

Is the performance superior for high playercounts?

chrome lark
#

Oh, and aikar overhauled entity activation range so it's not as arsy as the older one

wheat mirage
#

I'm dealing a lot with mob ai in 1.16

#

Im worried Paper may cause the AI to be laggy

#

Especially if they're not ticking much

chrome lark
#

Well, we have lots of improvements across the board; One scary thing with entity AI is that paper won't skip ticking entities where as spigot will

wheat mirage
#

Dont quite get what you mean?

chrome lark
#

But, spigot there is just hiding that your server is blowing chunks and rip entity consistency

wheat mirage
#

So youd say for high playercount paper is 100% superior?

grim halo
#

Isnt there a paper fork for high play count server?

chrome lark
#

Basically, when ticking entities, if the total time taken is so long on spigot, it will just skip ticking the rest of them; Paper doesn't do that; so in a lot of cases people will have issues coming over if entities are crazy, as we don't do that and prefer you to know that your server is crapping itself vs blowing up entity state pretending it isn't

#

I'd link an article about why max-tick-time is bad, but, given current convo, that's further err around the forks are evil rules

rapid lance
#

alright so im getting errors in my console abt registering commands, and im not really sure why

#

they are getting registered in the main class

chrome lark
#

did you throw them in plugin.yml?

rapid lance
#

yep

wheat mirage
#

@chrome lark Would you say for high playercounts spigot is much superior?

chrome lark
#

no

grim halo
#

Did you try throwing it in the trash and using acf?

rapid lance
#

ACF?

chrome lark
#

aikars command framework

rapid lance
#

oh

grim halo
#

Annotation command framework

chrome lark
#

basically deals with a lot of the crud of command writing

rapid lance
#

bruh im just trying to register them not use tabcomplete

grim halo
#

Its a bit harder to get started with but now i can just roll out commands with permissions and auto completion in 5min

rapid lance
#

oof

#

bruhhh

grim halo
#

But what errors do you get?

chrome lark
#

Are you suuuure you registered them all in plugin.yml?

rapid lance
#

...holy shit

#

im blind

grim halo
#

suspicious NPE at PunishmentGUI.java:77 might indicate that

crimson sandal
#

Is there an Event that gets fired after all plugins have been enabled or am I best just scheduling a 1 tick delayed task? I need to deserialize custom Recipes after plugins have registered them

grim halo
#

oh cat just got it

chrome lark
#

there is a server tick start event thing I think?

grim halo
#

Only for paper

crimson sandal
#

I'm currently running a 1 tick delay and it works fine, not sure if that's the best approach

chrome lark
#

No, spigot got a enabled one or something like that

#

the 1 tick delay is basically a legacy holdover

rapid lance
#

THANK YOU CAT

crimson sandal
#

I can't seem to find an event 🤷‍♂️

rapid lance
#

there was one fucking letter at the end of a command

chrome lark
#

ServerLoadEvent

wheat mirage
#

@chrome lark Sorry that was my mis-type

#

I meant do you think Paper is superior for high playercounts?

#

And can I switch Spigot to Paper without much worry of bad mob functionality

chrome lark
#

I mean, we have many features which are useful for even micro player counts, only people who might be upset is those with toaster machines, but that's more on mojang and they should probs jump back to 1.12 anyways; There are some caveats, e.g. if entity tick was hurting you already, there is a chance it might hurt more if you just simply had too many entities, we don't hide that issue from you, however

wheat mirage
#

I'm mainly concerned about gameplay experience

#

Performance is a concern, but not at the cost of gameplay

#

If Paper is superior and won't compromise gameplay experience

#

I'm all for it

alpine yoke
#

Hello. My discord account has been banned from discord. I would like to link my new one (this) to my spigot account. Can someoen unverify my old? (Marcelektro#9366, 363037836380864513)

#

If needed, I can prove it somehow.

frigid ember
#

instanceof

alpine yoke
#

yes

frigid ember
#

Well yes, but should I compare it to Player?

#

or some other class

chrome lark
#

if you wanna check they're a Player, you check if they're an instanceof a Player

frigid ember
#

okay thanks

wheat mirage
#

@chrome lark Thoughts on above? Is paper better without cost of gameplay?

frigid ember
#

e.getEntity() instanceof Player

alpine yoke
#

@frigid ember thank you, however there must be smth like cron, can someone run the job now? xd

chrome lark
#

outside of duplication, I don't think that there is any real gameplay changes outside of things like EAR 2 tryna restore vanilla further

alpine yoke
#

Thank you for help :)

wheat mirage
#

@chrome lark EAR 2?

chrome lark
#

entity activation ranges

wheat mirage
#

Is it lower or higher?

chrome lark
#

in spigot.yml, you'll see the activation ranges; idea of EAR2 is basically to add more activation exceptions, so more entities will be woken up to do stuff

wheat mirage
#

That seems potentially damaging to performance

chrome lark
#

saves you from having 200 entities around standing still

wheat mirage
#

But makes sense I guess

chrome lark
#

Well, you can disable some aspects of it if you want, it's highly configurable; We suggest taming entity lag by taming your count, these features help, but, at the end of the day, the # of them is what determines the load

#

imma go morning routine, jump in the shower, all that good stuff

frigid ember
#

does anyone know how to setup luckperms

#

is this caused by luckperms?

mellow wave
#

That's essentials

frigid ember
#

how do i fix it for members

#

ops it doesn't do anything to

mellow wave
#

I would just remove Essentials AntiBuild there are better plugins out there

#

Also op does fix it

#

At least on my server

#

^^

#

Actually it might be LuckPerms disabling op

#

I believe there's a setting for that

#

Can't remember it's been a while since I setup a server

wooden patrol
#

How is that possible that if I connect with older client (1.15.2 and lower) I can see nametags above player head but if I connect with 1.16.x client I can't see them the server is on 1.16.1 spigot

#

yes

#

I mean I just today download it and tried if I can see the nametags with older versions and I can but with 1.16.1 I can't

wind dock
#

hye guys, so In set tab completion to -1 in spigot.yml, but my players can still tab complete

#

Im running .15.2

#

1.15.2*

#

it doesnt work on this version for some reason

wooden patrol
#

I think it doesnt even work the tab-complete option in spigot.yml

#

I have it set to 2 and they can still do just / and all the commands show up

wind dock
#

ah I need a plugin dont I

fickle pewter
#

How can i fix getting like 10TPS with 3 player online?

mellow wave
#

That's CatServer not really supported here

fickle pewter
#

oh is Catserver different?

#

rip didnt think about that

grim halo
#

@fickle pewter What are your specs?

#

Because your server should be able to handle 300 entities...

#

Also the hoppers are not the problem here

subtle blade
#

If it's not Spigot, it's not supported

#

You're in the Spigot Discord server

grim halo
#

Same

fickle pewter
#

all i know is we have 28444MB RAM

grim halo
#

Then check if there is a CatServer discord... hope you speak chinese

mellow wave
#

^^

frigid ember
#

use Bing Translate

fickle pewter
#

its Forge mods + Spigot ye thats right

frigid ember
#

isnt forge mod and spigot called sponge

mellow wave
#

no

#

Sponge is something different

frigid ember
#

o

mellow wave
#

It is a whole different api

grim halo
#

Wait doesnt forgesponge support plugins+mods

mellow wave
#

Yes

#

But different api

#

So different plugins

fickle pewter
#

Skript is only Spigot + other plugins that are good are only Spigot

grim halo
#

Did you just imply that Skript is a good plugin?

fickle pewter
#

😉

#

tbh iv never used it but iv been enjoying my time with it

ancient ridge
#

@frigid ember there's already a sponge 1.14 version that you can compile yourself

muted halo
#

Hello Did anyone know theres is plugin with dynamic map on website and can choose our place for plat?

#

yea but like squares with numbers

#

and can choose number

#

of plat

#

wait I will show you

#

cant upload images

#

Can pv?

grim halo
#

upload it to imgur or some other host and send us the link

muted halo
#

dynamic map like this where map is divided

#

and people can choose plats

#

and iin game createby command

rapid lance
#

right so im back

#

plugin works up to the part where it bans people

grim halo
#

What am i looking at... You can do something like this with dynmap and worldguard regions i think...
But you cant just click them to perform some action.

rapid lance
grim halo
#

tad more context pls

rapid lance
#

so its a ban gui plugin

#

and this part is supposed to ban someone and say a certain message

wind dock
#

is there a plugin that can block tab complete in 1.15.2

#

that you guys know works

rapid lance
#

but its not doing anything

#

because i have 10 other inventories

muted halo
#

But its passible to create on dynmap squares like this with numbers?

rapid lance
#

and i need to check if its the right thing

#

huh?

grim halo
#

looks like InventoryClickEvent

rapid lance
#

yea

#

player clicks the yellow wool

#

bans another person

#

because isn't that depricated?

#

oh wait

#

no

#

oh the getName is deprecated

#

shiiiit

#

yea that one is deprecated

#

ok

keen compass
#

just because it is deprecated doesn't mean you can't use it

rapid lance
#

build? like version?

#

1.16.1

#

sop i can juste use (e.getInventory().equals(ChatInvCreator.ChatOffense))

#

yea

#

ChatColor.translateAlternateColorCodes('&'

#

umm

#

not really sure how to do that tbh

keen compass
#

getTitle() wasn't removed

rapid lance
#

pretty sure it was

keen compass
#

it exists in InventoryView

rapid lance
#

or i was using it

#

i started using getInventory

#

not so sure about the

#

ahhh ok

#

thats smart asf

keen compass
#

why don't you just compare the inventory object

#

instead of getting its name

#

o.O

rapid lance
#

wym

keen compass
#

or do these inventories change all the time?

rapid lance
#

nah i deleted and used (e.getInventory().equals(ChatInvCreator.ChatOffense))

#

they dont change lol

keen compass
#

yes that is comparing inventory objects

rapid lance
#

yea thats what i changed too

#

@frigid ember didn’t print anything lmao

#

I need to figure out wtf is going on

opal heron
#

Anyone knows a good alternative for a plugin called NameTagEdit?

rapid lance
#

Ok

#

NameTagEdit?

#

What does it do

mellow wave
#

Why do you need an alternate

rapid lance
#

TAB

opal heron
#

Yes, its basically a plugin that provides prefix to the tablist.

rapid lance
#

Just use TAB

#

Best plugin around

opal heron
#

Does it support permission per prefix/group?

rapid lance
#

Use TAB

opal heron
#

TAB?

#

doesnt that just provide prefix on the tablist?

rapid lance
#

And overhead prefixes and it supports PAPI

#

yee

opal heron
#

i found this one called AnimatedNames, i dont wanna make it animated, i just really want the prefix lol

#

Sure ill try that one

rapid lance
#

use TAB mate

#

ok @frigid ember u want my whole class file?

#

here

#

lines 113-251 work as intended

#

269-533 dont do anything

#

no i think its all the other inventories except the main one

#

oh shit...

#
        PluginManager pm = this.getServer().getPluginManager();
        pm.registerEvents(new Punish(), this);
        pm.registerEvents(new JoinEvents(), this);
        pm.registerEvents(new LeaveEvent(), this);
    }
#

yep

#

ahh

#

uhh

#

what?

#

Where are you initializing the ChatOffense variable?
@frigid ember wym

#

oof ok

#

thanks

ionic hound
#

does anyone have a good base code for gui. I am new to java

rapid lance
#

write it urself

ionic hound
#

lmfo

rapid lance
#

if ur new to java learn java first lol

mellow wave
#

^^

ionic hound
#

I know some but i want to see how it is supposted to look so i don't make a fool of my selfe

mellow wave
#

I use a forked version of Inventory Framework

rapid lance
#

Learn Java First

glacial umbra
#

Can I ask questions related to commands.yml in here?

rare prairie
#
        PluginManager pm = this.getServer().getPluginManager();
        pm.registerEvents(new Punish(), this);
        pm.registerEvents(new JoinEvents(), this);
        pm.registerEvents(new LeaveEvent(), this);
    }

Use Stream.of for registering new class instances like listeners if you have more than 3 classes

rapid lance
#

huh ok

rare prairie
#

for better readability

#

and for less code

rapid lance
#

ok i need to figure this out lmao

rare prairie
#
Stream.of(new ClazzName(), new Dog(), new Kit()).forEach(c -> pm.registerEvents(c, this));
karmic sable
#

Any way to avoid item tooltips (for a /faq) going off the screen? Or do I just have to split the text into more lines? PLEASE ping me if you have an answer (even if its the latter)

rapid lance
#

...oh i was thinking of doing something much more complicated lmao

#

thank you

ripe ledge
#

I need help
I have a scoreboard objective that already created
how I can add a player to the objective and set the player value?

#

does someone know how?

rare prairie
#

Objective#getScore(player.getName())

wheat mirage
#

Are there any events for the smithing table usage etc?

keen compass
wheat mirage
#

@keen compass thanks, google didn't turn up anything peculiarly

keen compass
#

could just search on the javadocs

keen compass
#

?jd

#

not sure why you would need google to do a search on a site that provides searching itself

wheat mirage
#

Google usually does better than per-site searching tbh

#

Is preparesmithingevent new?

#

Isn't in my IDE

#

And would explain google's lack of indexing for that page

crimson sandal
#

Yeah it's literally only just been added today 😛

#

It's a PR I made 😄

quick arch
#

pog

wheat mirage
#

Lmfao that makes more sense

#

Thanks for your contribution

crimson sandal
#

😄

sturdy oar
#

🍔 ✅ 😫 🌚 🇨🇳 👺 🧙‍♂️ 👨‍⚖️ 👍 🥰 🤪 💯 👆 🤚 👍 😹 😿 👽 🎃

crimson sandal
tardy sky
#

is it intentional that in spigot 1.16 structure blocks are limited to 32*32*32 in save mode?

quick arch
#

that'll be useful 🤔

crimson sandal
#

Didn't that used to be the limit in 1.15 and before? And that got changed in vanilla 1.16? I swear I remember reading that

#

It's 48 now

#

in 1.16

tardy sky
#

i was wondering if its a bug or intentional

#

if not ill report it as a bug

crimson sandal
#

I'm guessing that's something that hasn't been changed in spigot 1.16 by accident maybe

gloomy dragon
#

How do i build 1.16? I was using buildtools to build spigot and i got the 1.15

tardy sky
#

--rev 1.16.1

crimson sandal
#

Oh yeah, you're right @tardy sky it does default to 32 on spigot

tardy sky
#

you can only bypass by data merging the block or setblocking it

crimson sandal
#

What's the code you use to merge the data to get around it?

#

I've never really looked into Structure blocks in vanilla much tbf

tardy sky
#

/data merge block ~ ~-1 ~ {sizeX:48,sizeY:48,sizeZ:48} when standing on top of it

crimson sandal
#

Ohhh I see

tardy sky
#

anything bigger will force to 48 but if you click done in the structure block it resets to 32

crimson sandal
#

That's strange the decompiled class for the StructureBlock packet has -32 to 32 as the constraints 🤔 ```this.e = new BlockPosition(
MathHelper.clamp(packetdataserializer.readByte(), -32, 32),
MathHelper.clamp(packetdataserializer.readByte(), -32, 32),
MathHelper.clamp(packetdataserializer.readByte(), -32, 32));

this.f = new BlockPosition(
MathHelper.clamp(packetdataserializer.readByte(), 0, 32),
MathHelper.clamp(packetdataserializer.readByte(), 0, 32),
MathHelper.clamp(packetdataserializer.readByte(), 0, 32));
```

#

That doesn't make any sense though

#

Lol it's a vanilla bug

#

Try it in vanilla and it won't let you set it to 48x48x48 either

#

@tardy sky

tardy sky
#

oh i was told by a friend it worked in vanilla...

lone fog
#

Dangit Mojang

crimson sandal
#

Ohhhh it's due to be fixed in 1.16.2 😛

vale whale
#

[19:50:10 ERROR]: Could not pass event InventoryClickEvent to Discord v1.1.4
java.lang.NoSuchMethodError: org.bukkit.inventory.Inventory.getTitle()Ljava/lang/String;
at me.striker.clickablemessages.Listeners.click(Listeners.java:28) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor33.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.1.jar:git-Paper-90]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.1.jar:git-Paper-90]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.1.jar:git-Paper-90]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:2421) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.PacketPlayInWindowClick.a(SourceFile:32) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.1.jar:git-Paper-90]
at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1136) ~[patched_1.16.1.jar:git-Paper-90]
I get this in my console when I have the /discord plugin installed and it's very annoying
and that's not even the whole message/error

mellow wave
#

Also that's paper

vale whale
#

oh okay

crimson sandal
#

Well, I fixed it in Spigot lol, not sure if that would be something worth a PR though 🤔

subtle blade
#

Not worth a PR. Vanilla fixed it, will be removed shortly anyways. Not a game-breaking issue

mellow wave
#
  1. Which version?
  2. What are you trying to do?
  3. What are you doing so far / What have you tried?
stuck quartz
#

Is it possible to change the title of an open inventory? if so, how?

mellow wave
#

No open a new one

#

Add your worldguard version

#

I mean that works too but it's easier to open a new one

stuck quartz
#

ok, ill try

mellow wave
#

You're doing it wrong

#

7.0.3 is not for 1.12.2

vale whale
#

does someone know a 1.16 /discord plugin so that players get a link to my discord server when they type /discord?

mellow wave
#

That's not the cause

#

But please use the right version

#

Replace with your own code

dusky sigil
#

If you want the palyer world use

#

World world = p.getLocation().getWorld();

#

for the players world

#

oh okay

mellow wave
#

We already told you...

#

Use a Worldedit world

dusky sigil
#

How can i get a custom resource pack?

#

I looked into my server properties and found this

#

resource-pack=

#

and thats it

mellow wave
#

Put a direct download link there

dusky sigil
#

where can i post my resource pack?

#

all i want is just a couple sounds

mellow wave
#

Anywhere really

crimson sandal
#

Also, I've been looking at implementing a setSkin() method for Player, I've set the URL in the GameProfile and then send a PacketPlayOutPlayerInfo packet but sending that does nothing Hmm

mellow wave
#

Yeah you need to rewrite the code

#

Different api versions

dusky sigil
#

@mellow wave can i crank it in mediafire?

mellow wave
#

Yes

dusky sigil
#

that works

mellow wave
#

It works with whatever as long as you can get a direct download link

stuck quartz
#

how do i send a packet in 1.16.1

mellow wave
#

oh I highly recommend using Protocollib

#

or it will be annoying to maintain for all versions

stuck quartz
#

ok

near osprey
#

Im currently using google domains and I want to setup dns so I can have either play.st3r.co.uk or mc.st3r.co.uk, it also has to use the port 8100 this is due to my host only having 8100 and 8200 open.

wheat mirage
#

@crimson sandal

    @EventHandler
    public void onSmith(PrepareSmithingEvent e) {
        Bukkit.broadcastMessage("Fire");
        e.setResult(null);
    }```
#

The "Fire" is being broadcast

#

But setResult(null) doesn't seem to work

#

Even though it's annotated as @nullable

#

Does an air itemstack need to be used?

acoustic temple
#

So last night I was trying to get a command to run on a chatevent and was told to use

Bukkit.getScheduler().runTask(
    new Runnable() {
        public void run() {
            // Perform the command in here...
        }
    }
}, ...);```
Though I'm completely lost on how to go about that
mellow wave
#

Literally copy paste that in to the event and put your code inside of it

#

Or rather the run command part

acoustic temple
#

When i do that, it highlights a bunch of errors

vernal spruce
#

Also, I've been looking at implementing a setSkin() method for Player, I've set the URL in the GameProfile and then send a PacketPlayOutPlayerInfo packet but sending that does nothing Hmm
@crimson sandal well if ur looking for 1 type

mellow wave
#

Yeah you need to replace the ...

vernal spruce
#

here is what ive used last time

acoustic temple
#

What do I replace the ... with?

wheat mirage
#

@crimson sandal Yep even an air itemstack doesn't work, 😦

vernal spruce
#

@crimson sandal raw signature for skin just an example

#

taken from mineskin or w/e skin site wich give

#

also untested name to skin method

#

Might have a method for it as well

#

But im on toilet rn.. brb

bold anchor
#

@wheat mirage Is the item actually there or hidden away?

crimson sandal
#

Yeh I’ve base64 encoded the Json

bold anchor
#

not hidden away, not updated**

crimson sandal
#

One second, I’m just driving home 😛

bold anchor
#

Most of these spigot events need you to update the inventory yourself a tick later.

wheat mirage
#

@bold anchor I can take the item, so I think its there.

#

Not checked if its just a client bug tho

#

dec

#

sec

#

That's strange...

#

Because @bold anchor is right

#

It's a client bug

bold anchor
#

It's spigot

#

just update it a tick later lol

acoustic temple
#

So when i have it coded as this http://prntscr.com/tmrcyd the entire plugin stops working
Sorry about my clear ignorance, this is very foreign territory to me

wheat mirage
#

No, that's not how it works @frigid ember

golden valley
#

okay so, i didi it, i found the thing and edited it. now how do i recompile the edited jar?

wheat mirage
#

He means run Player#updateInventory

#

Which one refreshes the inventory for the client

#

@bold anchor Any reason the event can't handle updating the player itself?

bold anchor
#

Cause bukkit, If you use paper in a few hours that will be handled by the server.

acoustic temple
#

if i have the arguments in the other order it says that runTask is not applicable for "new Runnable(){},Main"

wheat mirage
#

@bold anchor How do you mean? Are you a paper dev or something?

bold anchor
#

No, but paper changed the prepare events to actually notify listener of udpates.

acoustic temple
#

That's what the plugin variable is

bold anchor
#

Smithing was just added in bukkit so that just needs to be adapted like anvil && grindstone

wheat mirage
#

Ah, makes sense

#

Could that not be submitted in a PR to Spigot @bold anchor

#

Doesn't seem like it needs to be paper specific

bold anchor
#

Lots of stuff doesn't, but oh well spgiot.

acoustic temple
#

It's initialized in the constructor

golden valley
#

how do i recompile a new spigot jar, after i edited some things?

acoustic temple
#

OH

#

i see what i did

#

i forgot to update Main with the new constructor

wheat mirage
#

@bold anchor I think if you submitted a PR it would be accepted, I'm probably going to switch to paper soon anyway

#

Even if all the mouth breathers in this channel will crucify me for ever asking for help with Paper in here

bold anchor
#

Just ask on paper

#

Just don't be an idiot and you will get proper help.

wheat mirage
#

Pretty inactive compared to here

crimson sandal
acoustic temple
#

Yup, its working now
Thanks for your help and patience!

crimson sandal
#

For e.g getting this ewogICJ0aW1lc3RhbXAiOiAwLAogICJwcm9maWxlSWQiOiAiMjA4NjQzMjNmNWI2M2M1NjljOWJmODUwYWRkY2UwODIiLAogICJwcm9maWxlTmFtZSI6ICJqYW1lc2xmYzE5IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiOiBmYWxzZSwKICAidGV4dHVyZXMiOiB7CiAgICAiU0tJTiI6IHsKICAgICAgInVybCI6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzI5MjAwOWE0OTI1YjU4ZjAyYzc3ZGFkYzNlY2VmMDdlYTRjNzQ3MmY2NGUwZmRjMzJjZTU1MjI0ODkzNjI2ODAiCiAgICB9CiAgfQp9

#

Which decodes to { "timestamp": 0, "profileId": "20864323f5b63c569c9bf850addce082", "profileName": "jameslfc19", "signatureRequired": false, "textures": { "SKIN": { "url": "http://textures.minecraft.net/texture/292009a4925b58f02c77dadc3ecef07ea4c7472f64e0fdc32ce5522489362680" } } }

pastel condor
#

@tranquil plaza you need to convert it

#

one sec

#

I'll get you the code

crimson sandal
#

Oh I just realised, the timestamp might be the issue with it being set to 0

wheat mirage
#

@crimson sandal Would you consider adding Paper's code to update the player of any changes the smithing result to your event?

pastel condor
#

BukkitAdapter.adapt(Bukkit.getWorld("world"))

#

he didn't adapt it

#

RegionManager regions = container.get(BukkitAdapter.adapt(Bukkit.getWorld("world")));

#

well it might be the wrong world object

crimson sandal
#

@wheat mirage we decided it doesn't work very well since it didn't update the player when you sent a different result. Instead the InventoryView gets passed through so you can make the change yourself

pastel condor
#

oh okay

#

yeah

#

and the support just screams at you

wheat mirage
#

@crimson sandal

    public void onSmith(PrepareSmithingEvent e) {
        e.setResult(null);
        Bukkit.getScheduler().runTask(RealmGame.plugin,() -> {
            ((Player) e.getView().getPlayer()).updateInventory();
        });

    }```
#

So this is necessary but should work?

pastel condor
#

and i can't ask them support
rip

wheat mirage
#

How come sending to the client doesn't work?

#

Even with the client using it's own code to predict the result

#

Latency should mean it'll arrive to the client after it predicts the result

#

And therefore there should be no trouble updating it

#

@frigid ember I've tested it, and it works, talk to @crimson sandal if you think his code doesn't work.

pastel condor
#

i'm using an old worldguard version because i'm in 1.12.2 and they want the last version D:
😦

#

for me I don't get support, because they hate me

#

or I like to believe that

#

they are just super mean to me

wheat mirage
#

No, latest spigot @frigid ember

#

So you're either wrong or my results are, I'll let you be the judge

bold anchor
#

Look at the CraftEventFactory

wheat mirage
#

Note: when criticising others code, it is prudent to actually read it.

crimson sandal
#

The event doesn't let you set the result

wheat mirage
#

@crimson sandal What?????

#

PrepareSmithingEvent doesn't let you set result?

bold anchor
#

Why even have the methods then?

wheat mirage
#

Is that what you're saying?

#

hope the red box helps

bold anchor
#

Look at the code in CraftEventFactory

crimson sandal
#

Wait I'm confused that event is different to what I pushed 😄

#

Hol' up

wheat mirage
#

wtf lmfao

frigid ember
#

quick question: I updated bungeecord to the latest build from https://ci.md-5.net/job/BungeeCord/, hoping it would support 1.16, but it says: 18:38:08 [INFO] Enabled BungeeCord version git:BungeeCord-Bootstrap:1.15-SNAPSHOT:2f54c94:1500
Am I missing something?

coarse island
#

can you make text clickable in Scoreboard, or just in Chat?

bold anchor
#

It was probably edited to fit in with the other events.

#

And like the other events they don't notify listener of changes, you gotta do that yourself.

wheat mirage
#

How hard would it be to PR that from paper over to spigot

#

May do it myself

bold anchor
#

Pr what?

crimson sandal
#

Oh dammit, I didn't push the newest Bukkit commit. setResult() does nothing.

wheat mirage
#

notify listener of changes

bold anchor
#

I mean atm paper should already have a smthing event.

wheat mirage
#

@bold anchor No I mean get the notification functionlaity over to regular spigot

crimson sandal
#

Me and Choco decided it shouldn't do anything

wheat mirage
#

Or by md_5 himself

#

I was so confused

#

Because I was using it

#

And it was all fine

crimson sandal
#

Oh ffs hahaha I've got this all mixed up with my RecipeBookEvent PR LOL

#

I've been programming all day I need a break LOL

#

setResult() is supposed to be in the SmithingEvent

#

Just ignore me

frigid ember
#

Much appreciated, thx!

crimson sandal
#

It's identical to PrepareAnvilEvent

#

And Paper has it so you can set the requested Recipe, but it doesn't make much sense to have it that way

#

I'm gonna go have a drink and watch Liverpool lift the EPL trophy 😄 😄 😄

wheat mirage
#

Are you able to add recipes to the recipe book?

lone fog
#

Yes

#

Adding a recipe with spigot will add it to the book if you have a way to unlock it

thick kiln
#

guys

#

cfg.reload(); and cfg.save(); method doesnt reload/save itemstacks, why?

civic aspen
#

Does anyone know what the event for a potion splashing and hitting a player is?

#

So for example Player 1 throws potion of harming, player 2 gets hit and the event that is called

thick kiln
#

my FileStorage class

#

wait a min

#
 public void save() {
        try {
            this.config.save(this.file);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void reload(){
        this.config = YamlConfiguration.loadConfiguration(this.file);
    }
bronze acorn
#

@thick kiln i treat yamlconfiguration as a java object

civic aspen
#

Ah the cause is very very useful thank you

bronze acorn
#

instead of having relof

#

change it to reload(YamlConfiguration config)

#

and instead of this.config

#

have config

#

same for reload

#

i mean save not relod

#

typing on mobile is a pain

tiny dagger
stuck quartz
#

I'm trying to get a BlockState of a sign and it's returning
Tile is null, asynchronous access?Tile is null, asynchronous access?

vernal spruce
#

Its pretty obvious by the error dont you think?

#

All API methods have to be called from main thread

#

no async/sync

tiny dagger
#

but why wouldn't my thing work anymore 🤔

vernal spruce
#

the chatclickable might have been changed

#

or replaced to another method

thick kiln
#

@bronze acorn i really don't understand :/

#

if i restart the server; it is changing but reload/save methods not working for that

bronze acorn
#

because you have to save the yamlconfiguration object you're editing

#

not a new one

#

so instead it would look like

#
 public void save(YamlConfiguration config) {
        try {
           config.save(this.file);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void reload(YamlConfiguration config){
        config = YamlConfiguration.loadConfiguration(this.file);
    }
#

u might not even need the parameter for reload

#

just remove config = probably

wheat mirage
#

Is there any way to order recipes in the recipe book for the client?
My custom recipes are littered in the regular ones

radiant pollen
#

Is there any way to order recipes in the recipe book for the client?
My custom recipes are littered in the regular ones
@wheat mirage Pretty sure it's client side.

tiny dagger
#

oh jeez

#

they made chatmodifier immutable

#

okay mojang

#

i'll remember you for this

#

finally

#

i fixed it

civic aspen
#

Is it possible to get the person who either shot the arrow that caused the EntityPotionEffectEvent or threw the potion that caused it? Or would it be better to use PotionSplashEvent and EntityDamageByEntityEvent for the arrow?

#

No, but any "bad" potion I can provide my list.

#

PotionEffectType.BLINDNESS, PotionEffectType.CONFUSION, PotionEffectType.HARM, PotionEffectType.HUNGER, PotionEffectType.POISON, PotionEffectType.SLOW, PotionEffectType.SLOW_DIGGING, PotionEffectType.UNLUCK, PotionEffectType.WEAKNESS, PotionEffectType.WITHER

#

In the methods I am not seeing something for that.

lapis plinth
#

why cant I used a setCancelled method in a PlayerDeathEvent when it extends EntityDeathEvent that extends EntityEvent?

civic aspen
#

@frigid ember I imagine that would work, I can handle Arrows seperately. (Arrows actually already are by something else)

quick arch
#

why is there no DEBUFF/NEUTRAL/BUFF potion enums 🤔

#

general question

#

long conditions are messy

lapis plinth
#

Whats the maven dependency import for paper 1.8.8?

#

this doesnt seem to wrok

quick arch
#

😐

#

He won't get support over there and here

lapis plinth
#

yeah cuz its "not maintained"

#

wow

#

ok

#

D:

civic aspen
#

@frigid ember I have gone with ```ThrownPotion potion = event.getPotion();

    // If shooter was not player ignore.
    if (!(potion.getShooter() instanceof Player)) return;
    Player attacker = (Player) potion.getShooter();

    for(PotionEffect effect : potion.getEffects()) {
        // Is potion effect bad?
        if (potionEffectBad(effect.getType())) {

            // If any victim is a allied player remove potion intensity
            for (LivingEntity victimEntity : event.getAffectedEntities()) {
                if (victimEntity instanceof Player){
                    Player victim = (Player) victimEntity;

                    // People can still hurt themselves, let's encourage skill!
                    if (attacker == victim){
                        continue;
                    }

                    // If players are in faction and not at war
                    if (main.utilities.arePlayersInAFaction(attacker, victim) &&
                            (main.utilities.arePlayersFactionsNotEnemies(attacker, victim) ||
                                    main.utilities.arePlayersInSameFaction(attacker, victim))) {
                        event.setIntensity(victimEntity, 0);
                    }
                }
            }
        }
    }``` I have a second method for if good/bad etc etc. Thank you for your help, time to test 🙂
stuck quartz
#

All API methods have to be called from main thread
@vernal spruce I'm sorry but, could you give me detail on how i could fix it? The main thread is the main script of the plugin?

winter salmon
#

Nevermind, I found an api

high mantle
#

hey, I've been looking around to no avail for an answer, so i've come here. I'm using a PlayerInteractEvent, and as I was playing around with it, I discovered that when a player right clicks a block with an empty hand, the event fires twice. Obviously there's the player right clicking the block, but what else is triggering this? I'll provide the method I have in question.

@EventHandler
public void onInteract(PlayerInteractEvent event) {
        
    Action action = event.getAction();
    Player player = event.getPlayer();
    Block block = event.getClickedBlock();
    
    if (action.equals(Action.RIGHT_CLICK_BLOCK) && !block.getType().equals(Material.AIR)) {
        if (block.getType().equals(Material.OAK_SIGN)) {
            player.sendMessage(ChatColor.GREEN + "You're making progress!");
    
        } else player.sendMessage(ChatColor.RED + "Either you didn't right click an oak sign or you fucked up.");
        
    }
        
}

(go ahead and answer the other's questions first, im just putting this here for when you get to it :))

civic aspen
#

@high mantle From the spigot API Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand. The hand can be determined using getHand().

high mantle
#

huh. I always thought the other hand was only "active" when there was an item placed there. this makes sense now. thanks!

civic aspen
#

Is there a way to get the AreaEffectCloud object from the EntityPotionEffectEvent? if it were the cause

#

AreaEffectCloudApplyEvent is the event I actually needed.

frigid ember
#

Hey there, I am looking for the name of the module required for these imports:

#

I have:

#
    compileOnly group: 'net.md-5', name: 'bungeecord-api', version: '1.15-SNAPSHOT'
    compileOnly group: 'net.md-5', name: 'bungeecord-protocol', version: '1.15-SNAPSHOT'```
buoyant path
#

Exception thrown whilst handling event: org.bukkit.event.player.PlayerJoinEvent
[16:16:15 WARN]: java.lang.NoSuchMethodError: com.mongodb.connection.ConnectionPoolSettings$Builder.maxWaitQueueSize(I)Lcom/mongodb/connection/ConnectionPoolSettings$Builder;

I've already shaded mongodb and this happens

#

thats cool

#

🙂

#
        Events.subscribe(PlayerJoinEvent.class).handler(event -> {
            Player player = event.getPlayer();
            VulcanPlayer vulcanPlayer = PlayerManager.getPlayer(player.getUniqueId());
            vulcanPlayer.setPlayer(player);

            GangManager.loadGang(vulcanPlayer.getGang());
        });
#

this is my code

#

getPlayer uses morphia to load in the player

#

which uses MongoDB

wheat mirage
#

Is there any way to order recipes in the recipe book for the client?
My custom recipes are littered in the regular ones

#

Asked this already, but just double checking

#

Didn't realise the recipe book was modifiable at all tbh

calm hull
#

Someone speak spanish?

valid turtle
#

My apologies if I'm being dumb, but where am I supposed to pass --forceUpgrade? I've run it on the jars of both the spigot file and the buildtools jar and neither of them upgraded the server from 1.15.2 to 1.16.1.

pastel arrow
#

Just downloaded the latest spigot build java -jar BuildTools.jar --rev 1.16.1 and in my ide It errors on all the imports The import org.bukkit cannot be resolved

sturdy oar
#

Ehm

pastel arrow
#

Just ran it again to see if it fucked up. give me a bit.

sturdy oar
#

Do you use NMS?

pastel arrow
#

For NBTTags technically.

#

But no thats not the issue

valid turtle
#

& your problem just helped mine, yapper :p running -rev 1.16.1. Worked on Ubuntu.

pastel arrow
#

👍

#

xD

#

Ran it again and that worked... WTF?

sturdy oar
#

Idk

valid turtle
#

Computers work perfectly every time. The perfect machine, ruled by imperfect machines 🥴

#

just say a gamma ray hit the RAM and broke the code

pastel arrow
#
if(lore != null) {
    String loreData = "";
    for(int i=0; i<lore.size();i++) {
        String line = Messages.util().removeColor(lore.get(i));
        loreData = loreData+line;
        if(i < lore.size()-1) {
            loreData = loreData+"|";
        }
    }
    data = data+",{Lore:"+String.valueOf(loreData)+"}";
}
``` So I'm just making a string with the lore... But in the yaml when I save it, it adds a new line.... https://i.imgur.com/2Dlpr9i.png
torn robin
#

print out lore

#

it probably has \n in it

pastel arrow
#

Lore: [ , º6Test, , º7Test]

#

Because if i == the size -1 of the list it will still add "|"

knotty karma
#

is it safe to read the world asynchronously? ik that writing to it is not supported, but can bad things happen if I read on a different thread?

subtle blade
#

it may not be accurate, but sure

#

that's why we have things like World#getChunkSnapshot()

knotty karma
#

ooh, interesting, didn't know that existed.

#

thanks!

pastel arrow
#

You're getting an index from the List that would return null.
What do you mean by this?

Also if that was the reason there would be multiple lines.

#

ConsoleOutput.debug("Lore: "+lore.toString()); just incase you wanted the code lol

#
String line = Messages.util().removeColor(lore.get(i));
if(line == null) {
    ConsoleOutput.debug("Line is null");
    line = "";
}
```Never shows in console so line isn't returning null
wheat mirage
#

Is there anyway to get the result from a Brew Event pre call?

pastel arrow
#

There isn't any quotes there is : though but thats not the issue. Otherwise there would be a new line everytime

#

What other character should I try?

#

Thats used alot more then | in item lores though

subtle blade
#

| is a special character in YAML

#

As is #

thick kiln
#

hi guys

#

world.spawnEntity(ConfigManager.getInstance().getLocation(loc, "Ejderha-Spawn"), EntityType.ENDER_DRAGON); not working, why?

#

it is working but dragon doesnt move

subtle blade
#

depends on the world

#

ender dragons only have ai in end worlds

thick kiln
#

uh

#

thanks!

pastel arrow
#

That's really weird. The # character didn't create a new line for but | did.
Give me a sec was testing adding \\|

thick kiln
subtle blade
#

I have a feeling it's because of the way dragon ai is handled tbh

pastel arrow
subtle blade
#

dragons are tied to the actual respawn process

pastel arrow
#

Add me lol

#

can't dm you

wheat mirage
#

@frigid ember I mean is there any way to know what the result is before the result is created?

#

Seems like an API limitation

#

@frigid ember PotionBrewer.d(itemstack, (ItemStack)this.items.get(i))

#

Be nice if these could be passed in, but I can NMS that myself

#

I may submit a PR for it

#

It always falls to the bottom of the priority list sadly as a workaround is faster

civic aspen
sturdy oar
#

Weird

civic aspen
#

@frigid ember Let me check it isn't my maven project at fault

#

@frigid ember Turns out it was my fault thanks again, the maven project was built against 1.13.1 opposed to 1.16.1 which the plugin is designed for anyway.

tiny pebble
#

I have a custom inventory inv here, and i want to check if the InventoryClickEvent is triggered in said inventory, but for some reason it is considered a different inventory?
https://hastebin.com/abawikoleq.java

There's the entire code. If anyone's able to help me make it so they're not considered different inventories please do, it's wonky

#

For better context, it checks to see if the clicked inventory is not inv, and if it isn't then simply just return. But if it is, it's supposed to do something... although it isn't doing it, therefore it is considering itself to be another inventory.

#

And yes, I have ensured that the listeners work and are registered properly

pastel arrow
#

Tried json. But it wasn't parsing the way I wanted. So I did it my own way with strings.

tiny pebble
#

That's what I was thinking, but how can I check the title? event.getInventory().getTitle() apparently isn't a thing, although I truly thought it was haha

fair abyss
#

@tiny pebble in newer versions getTitle is moved

tiny pebble
#

Thank you so much!

idle parrot
#

anyone know how to change the icon ip and the words under it that say A Minecraft Server???\

rotund orbit
#

Why would I be getting this error? org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/apache/commons/lang3/tuple/Pair

#

@frigid ember It is one of my plugins: Medieval Factions

#

Server version is 1.16

#

Plugin.yml api and pom.xml spigot dependency versons are 1.13

#

Thank you

wheat mirage
#

CraftItemEvent doesn't seem to fire if there is no supporting recipe. Anyone got any alternatives or ways to fix?

#

The result is being set manually in preparecraftitemevent

fleet crane
#

why not use the recipe api....

idle parrot
#

how can change the ip and let other people join?

fleet crane
#

but the prepare event should still fire

#

obviously the craft event wont fire because theres nothing to craft

idle parrot
#

but if i change it id doenst work

wheat mirage
#

@fleet crane I need highly variable ingredients with NBT checks along the way

#

If there's new API I'm not aware of

#

Glad to hear about it

idle parrot
#

ok any suggetions

fleet crane
#

shaped recipes can check for nbt

wheat mirage
#

@fleet crane Not multiple types. I have 4 slots which can be any type of equipment of a certain type (e.g. anything from a gold axe to a gold chestplate)

#

Recipes are too restrictive for that

#

Unless I can use some implementation of Complex Recipe (which just seems to be read only, not an interactable API), that's not an option for me

crimson sandal
#

I've come back to the presence of md_5 😮 😄

wheat mirage
#

Unless you think adding 4^8 recipes is a good idea

#

If I could set a base recipe in the preparecraftitem event for these custom recipes so that there would be something to hook into for mojang, that would likely work.

#

But there isn't.

#

I think I now understand why hypixel wrote their own crafting table.

crimson sandal
#

I mean hypixel rewrote literally everything

#

Their SkyBlock is a work of art tbf

tiny pebble
#

I made my plugin create a world with Bukkit.getServer().createWorld() although now that I deleted the world, it continues to try and update said non-existant world even after a reload. What can I do to basically remove that world from its memory?

crimson sandal
#

At that level you're way beyond plugin APIs

tiny pebble
#

welp

#

is there any way to do it through the code? or is there at least any way to delete the world through code?

#

aight

wheat mirage
#

@crimson sandal Pretty sure APIs could support me here

#

But they're just not good enough I guess

crimson sandal
#

Recipes are hard because they obviously don't persist over restarts and directly influence other plugins that make use of them

#

My Chests++ plugin has autocrafting and I have to load my configs a tick after onEnable to make sure other plugins have registered their recipes

wheat mirage
#

@crimson sandal You may be looking for ServerLoadEvent

#

The API could support this I think. Atleast a CraftingInventory#setRecipe method

#

Instead I think I may be able to achieve it through some hacky NMS

#

When in rome I guess.

crimson sandal
#

Wait what do you want to achieve again?

wheat mirage
#

Just have some dynamic crafting recipes

#

My current implementation runs my own logic in the prep event

#

To set the correct result

#

Sometimes the ingredients are doubled on craft

#

(Fucking bizarre)

crimson sandal
#

Ahh yeah, I was trying to do that exact thing before I wanted to make it so meta data was passed to the result item

wheat mirage
#

If there's more than one item in any slot

#

Problem is, there's no associated recipe

#

I'm digging into NMS here to set the recipe manually to a base CustomRecipe recipe

#

Which hopefully will work somewhat well

#

I may have to overlay logic on the actual craftevent though

#

But atleast it'll be called 🙂

crimson sandal
#

For my autocrafting I ended up creating a custom workbench inventory and then had to do the shaped and shapeless recipe checks myself

sleek ivy
#

does anyone have any suggestions... if getDisplayName includes 1.16 hex colors it just gets converted to one of the mc colors when sent to ComponentBuilder

crimson sandal
#

But I didn't need to use the actual Crafting inventory for that

wheat mirage
#

@crimson sandal May be easier honestly lol

#

why not use the recipe api....
md_5

Little annoying getting dots thrown at me because the API isn't all powerful though 😛

sleek ivy
#

essentials sets the getDisplayName to §x§5§5§5§5§5§5viveleroi but the ComponentBuilder can't read it, and it goes with §5 and makes it purple

crimson sandal
#

I think there's a PR open about that atm if I'm not wrong

sleek ivy
#

it seems like it should work so that would be good

#

where's the current repo? I'd like to find that

crimson sandal
sleek ivy
#

oof I need an account besides the forum one... one sec lol

crimson sandal
#

Ohhh yeah, you have to sign the CLA as well and wait to be approved to see PRs

sleek ivy
#

ok... dang. does that pr seem like it's fixing the issue?

crimson sandal
wheat mirage
#

Appreciate the help

#

Will save that

#

Going to try and get it working within the API (to some extent)

#

Any way to get an NMS IRecipe from a bukkit recipe?

rapid lance
#

Alright so I’m making item stacks and I’m trying to set custom model data

#

_itemMeta.setCustomModelData(data);

#

this isnt working tho

#

I have this PunishmentGUI.getPlugin().getGuiItems().getInt("ChatOffenseCustomModelData")

quick arch
#

🤔

upper hearth
#

When converting from 1.15.2 -> 1.16.1 is there anything I need to do besides just deleting the nether?

Should I make sure player's aren't in the nether, is there an actual proper way to convert, or is it that simple?

quick arch
#

oh, thought that was Persistent Data Containers ._.

rapid lance
#

and its supposed to take it from a config

#

haha lmao no

#

ping me

frigid ember
#

Could anyone help with the voting plugin stuff like I got all the basics down but when I press add server when creating the thing on minecfraftservers.org, it always says "Your server is not running" when the server is clearly running?

opal heron
#

did you checked the console if its running?

frigid ember
#

yes I can even join the server too

opal heron
#

Maybe the message is just bugged?

#

if everything is working fine then just ignore it.

frigid ember
opal heron
#

Hm, is your server a 24/7?

frigid ember
#

what?

opal heron
#

24/7, does it run 24 hours

frigid ember
#

yes

opal heron
#

Hm, strange.

#

try restarting the server and add it again.

frigid ember
#

already did

quick turtle
#

How can I make it so tnt explosions launch u up just like tnt jumping on Hypixel Bedwars

opal heron
#

What?

#

@quick turtle Have you tried searching a plugin for that?

quick turtle
#

I dont want a plugin, I'm coding a minigame for private use

opal heron
#

Mhm

south talon
#

maybe apply velocity if damage cause is tnt ??

opal heron
#

wouldnt the velocity apply to every players?

#

O nvm, that wont work

bronze acorn
#

dlg

#

explosions are just created with either a particle or an actual explosion then i believe it just changes it your velocity

rapid lance
#

can any1 help me with custom model data?

opal heron
#

custom model data

rapid lance
#

yee

#

trying to make a configurable item stack so people can set custom model data, but its giving me compiling errors

bronze acorn
#

for spigot side, simply ItemMeta#setCustomModelData

#

what are the rrors

rapid lance
#

java: cannot find symbol

bronze acorn
#

there has to be more than that, wat

rapid lance
#

nah thats it

#

_itemMeta.setCustomModelData(data);

bronze acorn
#

huh lol

rapid lance
#

heres what im using lol

#

im trying to take it from a config with this PunishmentGUI.getPlugin().getGuiItems().getInt("ChatOffenseCustomModelData")

#

@bronze acorn do u have any idea lol?

bronze acorn
#

theres not that much context to the error, could you post more

rapid lance
#

java: method createItemFromConfig in class me.medusa.punishmentgui.Inv.Items cannot be applied to given types;

#

also get this for the actual itemstack creation part

bronze acorn
#

do you use getItemStack

rapid lance
#

I think? Lemme look at my code tomorrow I just took a break

bronze acorn
#

alright

tardy wadi
#

I have been encountering a bit of an issue, and was wondering of some people more experienced with Spigot might have a clue as to how to fix it.

#

I recently started hosting a Spigot server via Ngrok for some of my friends, but have noticed that many commands from vanilla Minecraft, such as /gamerule, /gamemode, and even /op, do not function at all. Even in the server command line, it simply returns stating that the command is not recognized.

rapid lance
#

lmao you dont need the /

#

just do gamerule, op, gamemode etc

tardy wadi
#

Dear lord.

#

Thank you very much.

#

It is not the same for the normal Minecraft .jar, so I was a bit confused.

storm vessel
#

Guys, does anyone know how my entire server directory just dissapeared

#

anything that could cause that?

frigid ember
#

hey! I've tried using getConfig().set("test.test", "test");

#

but it doesnt work

#

any1 knows?

#

i did that

#

public void loadConfig() {
getConfig().options().copyDefaults(true);
saveConfig();
}

fleet crane
#

It is not the same for the normal Minecraft .jar, so I was a bit confused.

#

pretty sure it is

frigid ember
#

?

ivory pewter
#

would anyone know why my console is spamming this?
https://pastebin.com/k0FWFaaH
my plugins list is ```

[21:19:10] [Server thread/INFO]: Plugins (19): LuckPerms, WorldEdit, OreAnnouncer, EpicWorldGenerator, AdvancedNMotd, mcMMO, Vault, ProtocolLib, CoreProtect, dynmap, Spartan, Wild, Quests, Essentials, EssentialsChat, Chunkmaster, LiteBans, EssentialsSpawn, Harbor

frigid ember
#

i saw it in that

#

still doesnt write anything in the file

balmy sentinel
#

Watch CodeRed custom config tutorial @frigid ember

frigid ember
#

enabled a lot of optimization

#

now my plugins don't work

#

not even world edit

#

only followed this guide

#

i just want the default config file tho

balmy sentinel
#

same principles apply doesn't mater if it's the default config or a custom one

idle parrot
#

anyone know why my 1.16.1 spigot server keeps timing out for no reason?

spark phoenix
#

Hey, what's up boys. I just opened a small server and found out that it has serious performance issues. Ran it with 17 players and it was unplayable. Things that I already did:
1- Pre-generated the world.
2- Tweaked bukkit.yml | spigot.yml to reduce entities.
3- Verified timings report to verify that my plugins are not highly affecting my server performance.

I don't know what else to do. As a side-note, RAM consumption is just fine. Problem seems to be with my server processor. It peaks up to 100% usage. My server has a 8 cores 3.3ghz processor tho, I don't think the server should have performance issues with that specs (and this amount of players)...

Timings report with around 17 players: https://timings.spigotmc.org/?url=zaletoyimo
Timings report with around 10 players: https://timings.spigotmc.org/?url=awaxadeduv

#

I would really appreciate if someone can throw me a tip 😅

#

No, Linux dedicated server

#

OVH re-seller

#

We have another gameservers and ping is not a issue with them, not ping peaks or something

#

only happens with minecraft

#

Well I don't know lmao

#

Is that not common?

#

Yeah, the thing is I don't know how. Those are my current settings:

    entity-tracking-range:
      players: 40
      animals: 40
      monsters: 40
      misc: 16
      other: 50
    max-tick-time:
      tile: 20
      entity: 40
    entity-activation-range:
      animals: 12
      monsters: 24
      raiders: 34
      misc: 4
      tick-inactive-villagers: false

    ticks-per:
      hopper-transfer: 24
      hopper-check: 24```
#

also bukkit.yml

ticks-per:
  animal-spawns: 400
  monster-spawns: 20
  water-spawns: 20
  water-ambient-spawns: 20
  ambient-spawns: 1
  autosave: 6000```
#

and network-compression-threshold=512 in server.properties. That's all I modified so far

#

Reduced entities by half of it's default values

#

Well I modified things that timings report by itself suggested me, to values that I believe are not gonna change the gameplay that hard... I think Mob Stacker would not work since I use Lorinth's RPG Mobs

wheat mirage
#

When setting a custom result for preparecraftitemevent, if any items are remaining in the matrix once the craft is complete, their amount is doubled. Anyone got any ideas how to fix?

tough kraken
#

@spark phoenix if possible, lower or even disable the autosave time. for my 6core 24gb server, the autosave caused MASSIVE lags, and with massive i really mean massive

#

if you need your worlds, i would say to lower it to about every hour, should be enough

spark phoenix
#

Hey, thanks for the answer bud. I'll try it out, it's a dedicated server so it shouldn't suffer a sudden shutdown... Where can I lower that setting?

tough kraken
#

also bukkit.yml

ticks-per:
  animal-spawns: 400
  monster-spawns: 20
  water-spawns: 20
  water-ambient-spawns: 20
  ambient-spawns: 1
  autosave: 6000```

@spark phoenix the autosave, in ticks. 1 second means 20 ticks. if you want to convert ticks, use this
http://mapmaking.fr/tick/

tiny pebble
#

If I want a compass to point towards a player, how would I make it always point towards the player rather than point towards the player's last location? For example I have it right-click and it sets it to the player's last location. How can I make it so it right-clicks and it always dead-set on the player's current location?

#

Would the most optimal way to be an infinite loop...? shrug

tough kraken
#

ehm, i would say a runnable, but maybe there are better ways, never made a player tracker

spark phoenix
#

I really don't code in Java, but sounds like you have to do a loop that probably ends when you are not using the compass anymore, checking the last player location everytime

tiny pebble
#

aight ill try it out with a runnable

spark phoenix
#

ty @tough kraken, I'll try. In your experience is that entity count too high for the amount of players?

tough kraken
#

this fucking autochecker, seems like it doesnt work on 1.16

#

which entity count?

spark phoenix
grim halo
#

animal spawns 400 is def rly high

#

and monster spawn 20 is very low

tough kraken
#

0.61% 2,647.51% 2.65 s 1,323.75 ms 0.0 0.0k World Save

that says what is the problem

grim halo
#

oh wait its not the amount

#

its ticks per spawn check

spark phoenix
#

yep

grim halo
#

Then its fine. Assuming you got the spawn limit set

tough kraken
grim halo
#

Also you should increase ambient spawns. Its not very important to check 20 times per second if a bat should spawn or not

#

@tough kraken How is that even possible. Do you only have one core?

tough kraken
#

its his report

spark phoenix
#

^

tough kraken
#

i have 6core 24gb :^)

spark phoenix
#

8 cores 3.3ghz here

tough kraken
#

no flex xd

spark phoenix
#

16gb ram

tough kraken
#

its just that the autosave is really performance-sucking

grim halo
#

Should be plenty. Then you have some bad settings in the spigot or bukkit yml

tough kraken
#

ehh

#

think i have the defaults

#

only edited the autosave

spark phoenix
#

I modified everything that I stated above, and I believe modified this ones too:

spawn-limits:
  monsters: 50
  animals: 10
  water-animals: 10
  water-ambient: 15
  ambient: 10```
grim halo
#

The backup save should be done async so no idea where this comes from

tough kraken
#

well i set it to -1 before, and since that, my server has no laggs anymore

#

only on random teleports, or entering a not-loaded nether/end

grim halo
#

Anonimo it looks like you have around 1.8k entities on the server with 20 ppl on. You need to limit their mob farms.

spark phoenix
#

It's literally a fresh server, they don't even have mob farms

grim halo
#

Although i see that it only takes 14ms av so the server should be able to handle ~2k
Still stupid high for a "new" server.

spark phoenix
#

Pre-generated map tho

grim halo
#

But the main problem remains as world saving

spark phoenix
#

Alright, I'll change that out and see if it boost the performance a bit. Thanks for the help

grim halo
#

@spark phoenix And also send me what you got under chunk gc in your bukkit.yml

spark phoenix
#
chunk-gc:
  period-in-ticks: 300```
#

Decreased it a bit as well

grim halo
#

Dont decrease it

#

will make it worse

spark phoenix
#

I mean

grim halo
#

Also make sure to set "save-structure-info" in your spigot.yml to false

spark phoenix
#

well yeah, increased the period of time it has to pass

#

that's what I meant to say

#

lol

wheat mirage
#

When setting a custom result for preparecraftitemevent, if any items are remaining in the matrix once the craft is complete, their amount is doubled. Anyone got any ideas how to fix?

grim halo
#

Sounds like you also need to do some work in the InventoryClickEvent.

wheat mirage
#

I've done some magic

#

got it working

grim halo
#

how?

wheat mirage
#

Basically that

#

Given it a dummy recipe

#

So it calls CraftItemEvent

#

Then do some logic in therre

#

Cancel it and do the craft myself

grim halo
#

There are no api methods that are being called. Its all in the background

wheat mirage
#

@frigid ember What about getCraftingManager().craft?

sage summit
#

what is the best way to store player data in json/yml files?

#

should it be a file for each player or 1 file for everyone?

keen compass
#

depends really

#

but you would be better off with something like SQLite

sage summit
#

i need it without a database

keen compass
#

SQLite doesn't require anything additional

#

no more then what yaml requires

sage summit
#

whats the best way to store player data without a database basically

keen compass
#

or JSON

#

Basically you want to know out of the least efficient ways which is better?

sage summit
#

some people dont want to setup a database or cant