#help-archived
1 messages · Page 193 of 1
Bukkit#getscheduler#scheduleSyncDelayedTask
1 tick is 50ms
Thanks @rare prairie
10 ms was an example
Hmmm what about a next tick?
I'll look it up I guess
Bukkit.getSchelduer().runTaskLater(plugin, () -> {your code}, 1);
And how would i turn a NMS loottable back into a bukkit loottable
i hate everything about this
everything
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?
you save the itemstack you just created check the inventory using .getInventory and .contains
save the itemstack you just created, how do I do that?
oh boy..
Inventory#contains
why do you want the vanilla loot table anyways?
you can get the bukkit one by just constructing a CraftLootTable
And how to remove the item from the inventory?
Inventory#removeItem
But if he had 64 items, he wanted to remove only 1, does this method remove all 64 from the inventory?
I think there's one that removes the itemstack by reference
use javadocs and find the method you want
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
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
Async thread are usually requires when you want to connect to database, like mysql
Would there really be any harm in that?
It reads from the database too, to check the IPs
Then you can usea async task
I think you're fine if you're just going to read the player ip
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
No, if you read/change something from/in database then you should make another thread
Store the banlist on startup
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
yes on plugin startup
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
If the isBanned does not contain any of database/long time request stuffs, then you don't need another thread
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!
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.
ASync pre login event is such a godsend
how do i create a gaurdian beam
N M S
anyone know why i keep getting warped out of the end and can't use /back to return to where i was
EssentialsX?
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 ?
contact the author
@hollow thorn World#spawnParticle or playEffect could help you
@wide cargo Actually nvm. There's a debug message in the
DragonControllerStrafeclass for what's being outputted to the console.
@frigid ember wait what
@wheat mirage I am the dev lol
@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
Yea I’m kinda new to testing my own plugins, this is the first big one I’ve made
Hello, is there a way to summon an entitiy and make it not despawnable?
YUeah, would doing something like setting the ageLived parameter ticks in a task work?
Oh
It's not declared an api version in plugin.yml
Does it have any effect in the plugin itself?
It's normal for plugins that work from 1.8-1.16
Oh, ait
?
If the server sees a plugin that does not declare an api version, the compatibility layer will be used for materials for that plugin
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
YUeah, would doing something like setting the ageLived parameter ticks in a task work?
@wheat summit persistanceRequired
Ok, thanks,. is that a method?
no its a tag
declaration: package: org.bukkit.entity, interface: LivingEntity
PersistanceRequired:1b
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?
@wheat summit This tag still doesnt prevent unloading when the chunk unloads
So unloading the chunk also has a chance to despawn it?
If the chunk gets unloaded then every entity there gets saved in the chunk... not sure what else you mean by despawn
Ok
Or do you want to prevent removal of the entity
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 ^
then maybe try setPersistent(true)
Does anyone know where I can find some server benchmarks?
want to see the performance diff between 1.12 spigot and 1.16
Thats rly hard to generally benchmark...
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
or for 'mah pvp'
chunks
that's their major slowdown
Literally every form of "i need this chunk" is slower
chunks
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.
I've noticed 0 issues with 1.16
then you also have the their collision logic which blows chunks in some cases, but, at least they're more accurate now
Like you say joining will cause lag but thats just, false.
yay accuracy
Thats what i always craved in mc. More precise collision detection 
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
Well, in a lot of cases, it's marginally slower to the point it's irrelevant
But why don't they care at all
issue is that any form of chunk load/gen bounces around the server a lot
We have a patch elsewhere to improve that
Paper?
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
"elsewhere"
Mojang, woooo
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
I mean, if you're already running spigot, outside of dupe fixes, nope
Is the performance superior for high playercounts?
Oh, and aikar overhauled entity activation range so it's not as arsy as the older one
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
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
Dont quite get what you mean?
But, spigot there is just hiding that your server is blowing chunks and rip entity consistency
So youd say for high playercount paper is 100% superior?
Isnt there a paper fork for high play count server?
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
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
did you throw them in plugin.yml?
yep
@chrome lark Would you say for high playercounts spigot is much superior?
no
Did you try throwing it in the trash and using acf?
ACF?
aikars command framework
oh
Annotation command framework
basically deals with a lot of the crud of command writing
bruh im just trying to register them not use tabcomplete
Its a bit harder to get started with but now i can just roll out commands with permissions and auto completion in 5min
But what errors do you get?
Are you suuuure you registered them all in plugin.yml?
suspicious NPE at PunishmentGUI.java:77 might indicate that
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
oh cat just got it
there is a server tick start event thing I think?
Only for paper
I'm currently running a 1 tick delay and it works fine, not sure if that's the best approach
No, spigot got a enabled one or something like that
the 1 tick delay is basically a legacy holdover
THANK YOU CAT
I can't seem to find an event 🤷♂️
there was one fucking letter at the end of a command
ServerLoadEvent
@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
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
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
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.
instanceof
yes
if you wanna check they're a Player, you check if they're an instanceof a Player
okay thanks
@chrome lark Thoughts on above? Is paper better without cost of gameplay?
e.getEntity() instanceof Player
@frigid ember thank you, however there must be smth like cron, can someone run the job now? xd
outside of duplication, I don't think that there is any real gameplay changes outside of things like EAR 2 tryna restore vanilla further
Thank you for help :)
@chrome lark EAR 2?
entity activation ranges
Is it lower or higher?
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
That seems potentially damaging to performance
saves you from having 200 entities around standing still
But makes sense I guess
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
That's essentials
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
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
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
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
ah I need a plugin dont I
https://www.spigotmc.org/resources/⭐-suggestion-blocker-hide-command-suggestions-⭐-tab-complete-blocker-1-13-1-15.72191/ does this seems like it could help?
That's CatServer not really supported here
@fickle pewter What are your specs?
Because your server should be able to handle 300 entities...
Also the hoppers are not the problem here
Same
all i know is we have 28444MB RAM
Then check if there is a CatServer discord... hope you speak chinese
^^
use Bing Translate
its Forge mods + Spigot ye thats right
isnt forge mod and spigot called sponge
o
It is a whole different api
Wait doesnt forgesponge support plugins+mods
Skript is only Spigot + other plugins that are good are only Spigot
Did you just imply that Skript is a good plugin?
@frigid ember there's already a sponge 1.14 version that you can compile yourself
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?
upload it to imgur or some other host and send us the link
dynamic map like this where map is divided
and people can choose plats
and iin game createby command
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.
this isn't doing anything. no console output or anything https://pastebin.com/SZvEyhNk
tad more context pls
so its a ban gui plugin
and this part is supposed to ban someone and say a certain message
But its passible to create on dynmap squares like this with numbers?
looks like InventoryClickEvent
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
just because it is deprecated doesn't mean you can't use it
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
getTitle() wasn't removed
pretty sure it was
it exists in InventoryView
or i was using it
i started using getInventory
not so sure about the
ahhh ok
thats smart asf
wym
or do these inventories change all the time?
nah i deleted and used (e.getInventory().equals(ChatInvCreator.ChatOffense))
they dont change lol
yes that is comparing inventory objects
yea thats what i changed too
@frigid ember didn’t print anything lmao
I need to figure out wtf is going on
Anyone knows a good alternative for a plugin called NameTagEdit?
Why do you need an alternate
TAB
Yes, its basically a plugin that provides prefix to the tablist.
Does it support permission per prefix/group?
Use TAB
i found this one called AnimatedNames, i dont wanna make it animated, i just really want the prefix lol
Sure ill try that one
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
ChatOffensevariable?
@frigid ember wym
oof ok
thanks
does anyone have a good base code for gui. I am new to java
write it urself
lmfo
if ur new to java learn java first lol
^^
I know some but i want to see how it is supposted to look so i don't make a fool of my selfe
I use a forked version of Inventory Framework
Learn Java First
Can I ask questions related to commands.yml in here?
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
huh ok
ok i need to figure this out lmao
Stream.of(new ClazzName(), new Dog(), new Kit()).forEach(c -> pm.registerEvents(c, this));
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)
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?
Objective#getScore(player.getName())
Are there any events for the smithing table usage etc?
declaration: package: org.bukkit.event.inventory, class: PrepareSmithingEvent
@keen compass thanks, google didn't turn up anything peculiarly
could just search on the javadocs
package index
?jd
not sure why you would need google to do a search on a site that provides searching itself
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
pog
😄
🍔 ✅ 😫 🌚 🇨🇳 👺 🧙♂️ 👨⚖️ 👍 🥰 🤪 💯 👆 🤚 👍 😹 😿 👽 🎃
This also got added today from a PR I made 😛 https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getRecipe(org.bukkit.NamespacedKey)
declaration: package: org.bukkit, class: Bukkit
is it intentional that in spigot 1.16 structure blocks are limited to 32*32*32 in save mode?
that'll be useful 🤔
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
I'm guessing that's something that hasn't been changed in spigot 1.16 by accident maybe
How do i build 1.16? I was using buildtools to build spigot and i got the 1.15
--rev 1.16.1
Oh yeah, you're right @tardy sky it does default to 32 on spigot
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
/data merge block ~ ~-1 ~ {sizeX:48,sizeY:48,sizeZ:48} when standing on top of it
Ohhh I see
anything bigger will force to 48 but if you click done in the structure block it resets to 32
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
oh i was told by a friend it worked in vanilla...
Dangit Mojang
[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
Also that's paper
oh okay
Well, I fixed it in Spigot lol, not sure if that would be something worth a PR though 🤔
Not worth a PR. Vanilla fixed it, will be removed shortly anyways. Not a game-breaking issue
- Which version?
- What are you trying to do?
- What are you doing so far / What have you tried?
Is it possible to change the title of an open inventory? if so, how?
No open a new one
Add your worldguard version
I mean that works too but it's easier to open a new one
ok, ill try
does someone know a 1.16 /discord plugin so that players get a link to my discord server when they type /discord?
If you want the palyer world use
World world = p.getLocation().getWorld();
for the players world
oh okay
How can i get a custom resource pack?
I looked into my server properties and found this
resource-pack=
and thats it
Put a direct download link there
Anywhere really
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 can i crank it in mediafire?
Yes
that works
It works with whatever as long as you can get a direct download link
how do i send a packet in 1.16.1
oh I highly recommend using Protocollib
or it will be annoying to maintain for all versions
ok
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.
@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?
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
Literally copy paste that in to the event and put your code inside of it
Or rather the run command part
When i do that, it highlights a bunch of errors
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
Yeah you need to replace the ...
here is what ive used last time
What do I replace the ... with?
@crimson sandal Yep even an air itemstack doesn't work, 😦
@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
@wheat mirage Is the item actually there or hidden away?
Yeh I’ve base64 encoded the Json
not hidden away, not updated**
One second, I’m just driving home 😛
Most of these spigot events need you to update the inventory yourself a tick later.
@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
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
No, that's not how it works @frigid ember
okay so, i didi it, i found the thing and edited it. now how do i recompile the edited jar?
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?
Cause bukkit, If you use paper in a few hours that will be handled by the server.
if i have the arguments in the other order it says that runTask is not applicable for "new Runnable(){},Main"
@bold anchor How do you mean? Are you a paper dev or something?
No, but paper changed the prepare events to actually notify listener of udpates.
That's what the plugin variable is
Smithing was just added in bukkit so that just needs to be adapted like anvil && grindstone
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
Lots of stuff doesn't, but oh well spgiot.
It's initialized in the constructor
how do i recompile a new spigot jar, after i edited some things?
@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
Pretty inactive compared to here
Okay so for the skin url, I'm base64 encoding in the json format shown here: https://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape
Yup, its working now
Thanks for your help and patience!
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" } } }
Oh I just realised, the timestamp might be the issue with it being set to 0
@crimson sandal Would you consider adding Paper's code to update the player of any changes the smithing result to your event?
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
@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
@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?
and i can't ask them support
rip
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.
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
No, latest spigot @frigid ember
So you're either wrong or my results are, I'll let you be the judge
Look at the CraftEventFactory
Note: when criticising others code, it is prudent to actually read it.
The event doesn't let you set the result
Why even have the methods then?
Look at the code in CraftEventFactory
wtf lmfao
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?
can you make text clickable in Scoreboard, or just in Chat?
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.
Pr what?
Oh dammit, I didn't push the newest Bukkit commit. setResult() does nothing.
notify listener of changes
I mean atm paper should already have a smthing event.
@bold anchor No I mean get the notification functionlaity over to regular spigot
Me and Choco decided it shouldn't do anything
Or by md_5 himself
I was so confused
Because I was using it
And it was all fine
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
Much appreciated, thx!
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 😄 😄 😄
Are you able to add recipes to the recipe book?
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
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);
}
@thick kiln i treat yamlconfiguration as a java object
Ah the cause is very very useful thank you
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
any idea what's different in 1.16 that this doesn't work? 🤔
I'm trying to get a BlockState of a sign and it's returning
Tile is null, asynchronous access?Tile is null, asynchronous access?
Its pretty obvious by the error dont you think?
All API methods have to be called from main thread
no async/sync
but why wouldn't my thing work anymore 🤔
@bronze acorn i really don't understand :/
if i restart the server; it is changing but reload/save methods not working for that
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
Is there any way to order recipes in the recipe book for the client?
My custom recipes are littered in the regular ones
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.
oh jeez
they made chatmodifier immutable
okay mojang
i'll remember you for this
finally
i fixed it
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.
why cant I used a setCancelled method in a PlayerDeathEvent when it extends EntityDeathEvent that extends EntityEvent?
@frigid ember I imagine that would work, I can handle Arrows seperately. (Arrows actually already are by something else)
why is there no DEBUFF/NEUTRAL/BUFF potion enums 🤔
general question
long conditions are messy
@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 🙂
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?
Nevermind, I found an api
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 :))
@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().
huh. I always thought the other hand was only "active" when there was an item placed there. this makes sense now. thanks!
Is there a way to get the AreaEffectCloud object from the EntityPotionEffectEvent? if it were the cause
AreaEffectCloudApplyEvent is the event I actually needed.
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'```
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
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
Someone speak spanish?
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.
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
Ehm
Just ran it again to see if it fucked up. give me a bit.
Do you use NMS?
& your problem just helped mine, yapper :p running -rev 1.16.1. Worked on Ubuntu.
Idk
Computers work perfectly every time. The perfect machine, ruled by imperfect machines 🥴
just say a gamma ray hit the RAM and broke the code
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
Lore: [ , º6Test, , º7Test]
Because if i == the size -1 of the list it will still add "|"
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?
it may not be accurate, but sure
that's why we have things like World#getChunkSnapshot()
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
yes original image https://i.imgur.com/2Dlpr9i.png
Is there anyway to get the result from a Brew Event pre call?
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
hi guys
world.spawnEntity(ConfigManager.getInstance().getLocation(loc, "Ejderha-Spawn"), EntityType.ENDER_DRAGON); not working, why?
it is working but dragon doesnt move
That's really weird. The # character didn't create a new line for but | did.
Give me a sec was testing adding\\|
@subtle blade same 😦
I have a feeling it's because of the way dragon ai is handled tbh
dragons are tied to the actual respawn process
@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
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/AreaEffectCloudApplyEvent.html says it has the method setCancelled but it is not present in my most recent spigot build after a decompile in IntelliJ Any Ideas?
Weird
@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.
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
Tried json. But it wasn't parsing the way I wanted. So I did it my own way with strings.
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
@tiny pebble in newer versions getTitle is moved
Thank you so much!
anyone know how to change the icon ip and the words under it that say A Minecraft Server???\
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
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
why not use the recipe api....
how can change the ip and let other people join?
but the prepare event should still fire
obviously the craft event wont fire because theres nothing to craft
but if i change it id doenst work
@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
ok any suggetions
shaped recipes can check for nbt
@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
I've come back to the presence of md_5 😮 😄
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.
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?
At that level you're way beyond plugin APIs
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
@crimson sandal Pretty sure APIs could support me here
But they're just not good enough I guess
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
@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.
Wait what do you want to achieve again?
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)
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
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 🙂
For my autocrafting I ended up creating a custom workbench inventory and then had to do the shaped and shapeless recipe checks myself
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
But I didn't need to use the actual Crafting inventory for that
@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 😛
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
I think there's a PR open about that atm if I'm not wrong
it seems like it should work so that would be good
where's the current repo? I'd like to find that
Actually I'm not sure, I think this is the PR I read https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/710/overview
oof I need an account besides the forum one... one sec lol
Ohhh yeah, you have to sign the CLA as well and wait to be approved to see PRs
ok... dang. does that pr seem like it's fixing the issue?
@wheat mirage I used this class for custom shaped recipes, although looking back at it now it could do with some tidying up https://github.com/JamesPeters98/ChestsPlusPlus/blob/fa9742b590329b95d7188c8c7d7954baa3bdd459/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/crafting/UserShapedRecipe.java#L12
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?
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")
🤔
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?
oh, thought that was Persistent Data Containers ._.
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?
did you checked the console if its running?
yes I can even join the server too
no I mean I am trying to add the server to the server list in minecraftservers.org
Hm, is your server a 24/7?
what?
24/7, does it run 24 hours
yes
already did
How can I make it so tnt explosions launch u up just like tnt jumping on Hypixel Bedwars
I dont want a plugin, I'm coding a minigame for private use
Mhm
maybe apply velocity if damage cause is tnt ??
dlg
explosions are just created with either a particle or an actual explosion then i believe it just changes it your velocity
can any1 help me with custom model data?
custom model data
yee
trying to make a configurable item stack so people can set custom model data, but its giving me compiling errors
java: cannot find symbol
there has to be more than that, wat
huh lol
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?
theres not that much context to the error, could you post more
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
do you use getItemStack
I think? Lemme look at my code tomorrow I just took a break
alright
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.
Dear lord.
Thank you very much.
It is not the same for the normal Minecraft .jar, so I was a bit confused.
Guys, does anyone know how my entire server directory just dissapeared
anything that could cause that?
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();
}
It is not the same for the normal Minecraft .jar, so I was a bit confused.
pretty sure it is
?
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
Watch CodeRed custom config tutorial @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
same principles apply doesn't mater if it's the default config or a custom one
anyone know why my 1.16.1 spigot server keeps timing out for no reason?
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
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?
@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
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?
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/
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
ehm, i would say a runnable, but maybe there are better ways, never made a player tracker
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
aight ill try it out with a runnable
ty @tough kraken, I'll try. In your experience is that entity count too high for the 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
this ones
0.61% 2,647.51% 2.65 s 1,323.75 ms 0.0 0.0k World Save
that says what is the problem
yep
Then its fine. Assuming you got the spawn limit set
wow, thats really big...
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?
its his report
^
i have 6core 24gb :^)
8 cores 3.3ghz here
no flex xd
16gb ram
its just that the autosave is really performance-sucking
Should be plenty. Then you have some bad settings in the spigot or bukkit yml
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```
The backup save should be done async so no idea where this comes from
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
Anonimo it looks like you have around 1.8k entities on the server with 20 ppl on. You need to limit their mob farms.
It's literally a fresh server, they don't even have mob farms
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.
Pre-generated map tho
But the main problem remains as world saving
Alright, I'll change that out and see if it boost the performance a bit. Thanks for the help
@spark phoenix And also send me what you got under chunk gc in your bukkit.yml
I mean
Also make sure to set "save-structure-info" in your spigot.yml to false
well yeah, increased the period of time it has to pass
that's what I meant to say
lol
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?
Sounds like you also need to do some work in the InventoryClickEvent.
how?
Basically that
Given it a dummy recipe
So it calls CraftItemEvent
Then do some logic in therre
Cancel it and do the craft myself
There are no api methods that are being called. Its all in the background
@frigid ember What about getCraftingManager().craft?
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?
i need it without a database
whats the best way to store player data without a database basically
or JSON
Basically you want to know out of the least efficient ways which is better?
some people dont want to setup a database or cant