#folia-help
1 messages Ā· Page 36 of 1
Folia is only a win for very specific kinds of servers, and thats fine
What if everyone is in a single region?
Wouldn't that mean the regionizer has less work to do?
Then it's like a paper server but slower
Yes I know
But what if there were many players concentrated in far away parts? In groups of 20 for example?
As long as you get multiple regions you get a benefit
If you have everyone in their own region that's the maximum benefit but having 20 people in each region is still a win
especially if its something like towny/factions and you have multiple groups of players with large farms etc each
Your limit for how many can be in a region is similar to how many people could be on a paper server
Probably somewhat less since there are overheads but close enough
Is it really better for everyone to be alone? Every region requires at least one thread so I assume that having 5 groups of 20 players is better than having 100 groups of a single player even if they were perfectly spread out
They don't all get their own thread
Number of threads is autodetected based on system core/thread count or whatever you override in the config, it's a thread pool
That's the best case scenario?
20 regions doesn't mean they all tick in parallel, you might only get like 4-8 ticking at once
its one where Folia can have some pretty good performance advantages vs Paper, cause each farm or whatever will only affect that region
But folia doesn't have its own config?
It's just paper
Is paper-global.yml extended?
That's actually what I was sort of going for
under global config, threaded-regions.threads
That's from the readme
main challenge is making sure the players stay away from each other there though.
e.g. if you have someone walking from town A to town B, that might lead to both those regions merging if you are unlucky
I was still very impressed with paper coming from fabric. The chunk gen speed and the amount of chunks it can send and the mspt is very good. The tradeoff is the depth of the mods you can install but I'm happy with the performance even with folia's overhead
Is 900 blocks enough for the towns?
Wall to wall?
Or is that the minimum distance to create a new region?
its not really a fixed value
The server is greedy about merging regions but less so about splitting them again later
What would a good distance be, based on your experience?
To make sure that even with people travelling from one town to the other from time to time, the regions don't merge
I don't think I've ever even started a folia jar
There are only like 6 public users of it afaik
Damn
Who knows how many are using it and not saying
I mean theres 600 servers and ~20k players according to bStats
I think pretty much everyone publicly using it are using a custom fork too
Damn
How come command blocks* haven't been figured out yet?
Are they impossible?
I can use them myself but command blocks don't work
scoreboard is pretty much impossible, the rest I dunno
Command blocks are definitely impossible
Oh
How do plugins work on folia then? I thought paper plugins don't have as much access to minecraft's internals like fabric / forge
Why do commands require global state?
Aren't they inherently regionalized
Command blocks have an output that is generally how many things they affected, getting that value would require blocking to wait for all of the regions to run the command but for reasons I had straight in my head at some point there is likely no way to do that without a deadlock
If you had more than one command running at a time it would definitely be a deadlock
not that I know of? just a length limit
there is scheduling API plugins can use to ensure their code runs on the correct thread for an entity/block/etc
Why can't commands just only refer to the region they are in?
kill @e would only kill the entities in that region
tp x player out of the region isn't recognized
that would work, but at that point just make a plugin doing this instead of modifying vanilla commands
Stuff like that
You'd be trading missing some vanilla functionality for breaking a ton of vanilla functionality
nobody using Folia in any serious way is going to use command blocks or datapacks anyways, cause their performance is awful
And you still wouldn't get scoreboards
?
That got answered
Oh yeah you're rifht
Paper plugins don't work on Folia, btw
You have to specifically write your plugin with Folia in mind and mark your plugin as folia compatible for it to even try to load it
I meant that they are made in a similar way + the caveats to work for folia
It's just that 99.9% of the time making a plugin work on Folia also makes something that works on Paper
Can I learn to make folia plugins without ever having done other modding?
Without ever doing any other modding? Sure. Without ever doing any programming? Uh, eventually?
Multithreaded programming is basically the final boss of programming š
I have done lots of programming and know java at an intermediate level
I just have never gotten into minecraft modding
I was about to start with fabric, got through some tutorials
But if I'm going to use folia that knowledge is not going to be very helpful
You can mostly just use the Paper API/documentation for learning how to make Folia plugins, you just have to make sure you use the schedulers if you ever want to access something that might not be in the same region your code is running in
Folia/Paper is imo easier than Fabric, as there is a documented API available for a lot of things. Fabric only has some small basic API and then expects you to do the rest with Minecraft internals
That's nice to hear
Like, in an event handler if you only touch things related to that event it's probably identical to Paper but if you want to make a command that can do something to all players you have to use the EntityScheduler for each player to run that logic on them
I think folia could work for the type of server I want to create
Thanks for your help
It's a simple idea
Just deleting all chunks outside of some designated squares every x days
And changing the seed
It might not even need to be a plugin
Likely much easier to do with the server stopped and some external tool (MCASelector) tbh
large-scale world operations are pretty difficult to do with a running server
That's not a problem
Wait
Actually it is
That means it's not going to be a plugin
Because the server won't be running
So i'll just write some rust code? Maybe?
Damn
I would still like to make plugins though
For fun
MCASelector has a CLI mode, you can probably just write a (very long) command for that and run that during your weekly server restart or similar
Good to know
Will probably be enough for my purposes
Does it run on linux?
I doubt it wouldn't
Anyway I'm getting off topic
Thanks again
Currently, there is only one public Folia-compatible plugin available, which you can find on Modrinth. Otherwise, you will most likely have to develop your own plugin.
Yeah after looking into it I decided that my server wouldn't really benefit from folia anyway as I never really pass 20 concurrent players.
Send a spark report
^
ok
Does locatorbar work on 1.21.6 of folia?
just updated my server not seeing it
set gamerule locatorbar true
no
lol 149 players in one region
only 4 regions you have
stick to paper bro

is the paper engine written for multithreading?.
the JVM supports multithreading. on paper, the world tick uses 1 designated thread referred to as the main thread. other operations are free to use non-main threads, such as chat and anything done with the async schedulers. folia, on the other hand, may use more than 1 thread to tick the world by breaking them into discrete regions
hope that answers your question
@vestal gulch when I wrote to someone that if I made a server with European modes, someone replied to me like this: I think that for so many players, Folia would be required, i.e. a custom engine for multithreading Then you can scale practically infinitely like regions + probably a few proxy servers to handle so many requests.
"practically infinite" is definitely not true, there are a limited number of hardware threads and so even with optimal regionizing there's an upper limit to the concurrency level
and on the topic of regionizing, it requires very particular conditions
if you just slapped folia onto some random SMP it would probably only use 1 region per world
@vestal gulch if I want to make a European server with many modes, what should I do to maintain an infinite number of players on each mode without a single lag, stutter, etc. from the beginning to the end of the edition ?.
tell me how to solve it.
There is no such thing.
You canāt have an āinfiniteā number of players on anything. The game just doesnāt work that way.
^ an approximate number would help
and just, server networks scale, the good ones anyways. you don't need an entire datacenter to get started
Wasabi I want to have, for example, 10,000 players in each mode.
that is a very large number. it will require either very high specs, aggressive optimization, or both
the thing is that if you want all 10,000 players to theoretically be able to interact with eachother, be in the same space even, it all has to be running on the same server and therefore the same machine
Do you have 10k players, right now?
Otherwise don't worry about it. Thats an insane number that only very few servers reach
but how to keep as many players as I mentioned in each mode without lags, stutters, backtracking etc. Give a solution.
you don't
Servers with that player numbers run networks with multiple proxies and hundreds of individual servers
I suspect it's my memory stick, currently DDR4, in the process of replacing it with DDR5. since my util is exceptionally high, the CPU in use at the time was a 7950X in the process of replacing it with a 9950X
Is it a problem with my system, the server system is Windows Server 2022
I mean, folia cares about player spread
if your players don't spread enough, they'll be stuck in a single region, and you won't have any of the advantages of folia
Windows will definitely be taking some performance, for such a high player count, if youāre running into CPU issues (looks like it) then switching to Linux may be beneficial
Plus, Linux is a lot easier to manage and is much more powerful
And generally better supported
ok thx i see
Windows is more familiar to me, Liunx I'm less familiar with I'm afraid of screwing up.
I want to use Ubuntu 22.04 do you know any available Gui tools?
There are a few options
So you want a GUI on the machine or in your browser
What kind of GUI tools are you looking for
browser
No, the machine is owned.
7950X DDR4 128G
if you have a dedicated machine to run your server, and you want it to use linux, it makes precisely 0 sense to run a graphical environment
you can SSH into it from another machine that does have a graphical environment
if you want some kind of control panel, you can install pterodactyl/similar and manage your server from your web browser
in terms of linux distros that dont come with a DE, any server distro should do fine. i personally favor the RHELs and particularly Rocky
Ubuntu servers are common too, Debian a bit more so I believe
ok thx u. I think I get it.
i assume -1 dynamically uses as many cores as it needs is it correct?
No, it calculates a number based on the # of CPU cores available
What can I do about spawn chunks? I want to remove them permanently, or at least kick all players and unload them before performing an action if I can't get rid of them
Currently, I can set gamereule spawnChunkRadius 0, stop the server to unload them, restart without spawnchunks, do the action and then stop the server again
I'd like to get it down to one restart
Is there some weirdness with setworldspawn?
It doesn't seem to be working
how does the calculation works though i have 16 cores is it normal that i got only %400 utilisation by default?
If less than 16 threads, you get 1 region thread
Otherwise, number of threads divided by 8 and rouded down. So, 32/8=4=400%
Hey! I'm using Folia 1.21.7@942017b, and I'm experiencing significant increases in MSPT when moving or loading new chunks. I've tested this on a server without plugins and the issue persisted. An MSPT increase is normal when loading new chunks, but it shouldn't increase when moving in a circle in loaded chunks. The problem is inconsistent, but I've managed to get 30 MSPT in a single region with 12 players flying in different directions. I don't know if anyone can help with this problem or relate to it, but 30 MSPT with 12 players is way too much. Here is my paper-global.yml config https://pastes.dev/VkWEfGSeFV
read it again, you have 140 players in one region, folia doesn't build like that for amount of player in one region. It means you are not using folia properly.
I am curious to try out Folia. Can I run it on localhost without any special hardware?
Well, yea, it's generally just server software
you'll just perform marginally worse than paper if it doesn't have the resources it needs
Cool. If anyone that can run Paper on localhost can also run Folia, I imagine that will make it more accessible to developers
and the investment in adopting it generally means that you probably want to actually have suitable hardware
One thing I was unclear on is if any Paper plugin (excluding Bukkit/Spigot plugins, so any plugin on Hangar) is Folia compatible, have heard mixed answers on this
No, plugins need to be explictly marked to be folia compatible
Hello, I was wondering if Folia would be suitable for a "theme park visit" server, especially when the map can get pretty large and concentrate lots of entities in some places (especially places that have a ride which uses entities, trains, particles). Some area basically makes the whole server lag anytime some area concentrates such lag sources such as entities ? Would Folia be a good way of managing regions individually to address lag independently ? Or should I stick to paper and try to optimize entity management in some other way ?
Depends on whether the attractions are very far away from each other and how often (and which path) a player takes to cross for one to another
This is pretty normal. Your test isnt controlled so itās going to be biased. Keep it in mind when generating chunks, it is not always going to be the same load. Certain biomes contain bigger and more complex structures and it spiking up is completely normal behavior due to this.
Pregenerating when you can is the only way to prevent this.
Hm, that's very strange. My chunks are already pregenerated. We already have 500 GB of world data, and I'm pretty sure the chunks we were in are pregenerated.
And the MSPT started to increase even when we were just moving within a 20-block radius. It wasn't a big increase, but we went from 1.0 to around 8 or 10 with just 10 players jumping around. I don't know if I'm missing something, but this isn't normal, is it?
Without seeing report I cannot really comment on it. Those numbers are still well below 50 so itās not an issue anyway.
That makes sense. Our server will be released in a few days, so we'll see what happens then. If anything noticeable happens, I will send a Spark report. However, I also think it's normal because the players I was testing with didn't notice the rising MSPT at all.
Hello, I am trying to use -Dcom.mojang.eula.agree for a new server but am getting the below error. Does anyone know what happened to this feature? This is my first time trying to use it on Folia. This is with Folia 1.21.6 on Windows.
Command Line: java -Xms1G -Xmx14G -Dcom.mojang.eula.agree=true -jar C:\serverfiles\server.jar --nogui
Error:Error: Could not find or load main class .mojang.eula.agree=true Caused by: java.lang.ClassNotFoundException: /mojang/eula/agree=true
Does every plugin requires a paper-plugin.yml to run on folia? - I mean, what plugins are allowed on folia
How can I use spark in folia
do I have to download the plugin or is it built in
I cant find the cmd
^
This is a few days later but a similar crash has occurred without any intervention from me. At least I think so. The server abruptly closed without any errors in the console so I suspect the same thing happened again.
My plugins are designed for use with Plugman and being hot swapped, it's not an issue I'm sure.
I'll do the jcmd thing later today and see if there's anything particularly suspect from the third party plugins I'm using
I've got two or three plugins that do dynamic library downloading and injection for (in my opinion) no real good reason so I wouldn't be surprised if it's one of them
Either that or as ya mentioned, someone's shoddy reflection not boding well with 400+ concurrent users
Plugman can 100% and very easily cause this issue
do not use plugman on a production server. Even that issue aside, there are plenty of other issues with Bukkit itself.
The ability to reload plugins at runtime should have never been added, its an absolute disaster
I've used plugman for work for years
I can assure you that's not the problem here
Especially considering it happened even without me running anything plugman today
We've had higher load days where I've reloaded the plugins I've written explicitly with the intent of being reloaded a dozen times without issues
Did you restart the server since you last used plugman?
Yes. We have daily reboots.
The server had been up for short of 12 hours
I understand there are numerous problems just plugman reloading random plugins Willy Nilly but there are design patterns that are perfectly doable for using it.
And that isn't the problem here
The jvm ran out of space for compiled classes
You would need to work out why you have so much loaded that it ran out
Yeah I'll see what classes are getting dumped into there, should be pretty clear
apparently it's just down to me misusing (?) lambdas or maybe some bad JVM settings
codeheap.txt by @vital path: https://pastes.dev/10O4ntKhBh
java -Xmx48G \
-Xms48G \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9040 \
-Dcom.sun.management.jmxremote.host=127.0.0.1 \
-Djava.rmi.server.hostname=127.0.0.1 \
-Dcom.sun.management.jmxremote.rmi.port=9041 \
-Dcom.sun.management.jmxremote.local.only=true \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-XX:+AlwaysPreTouch \
-XX:+DisableExplicitGC \
-XX:+ParallelRefProcEnabled \
-XX:+PerfDisableSharedMem \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseG1GC \
-XX:G1HeapRegionSize=8M \
-XX:G1HeapWastePercent=5 \
-XX:G1MaxNewSizePercent=40 \
-XX:G1MixedGCCountTarget=4 \
-XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1NewSizePercent=30 \
-XX:G1RSetUpdatingPauseTimePercent=5 \
-XX:G1ReservePercent=20 \
-XX:ConcGCThreads=3 \
-XX:InitiatingHeapOccupancyPercent=15 \
-XX:MaxGCPauseMillis=200 \
-XX:MaxTenuringThreshold=1 \
-XX:SurvivorRatio=32 \
-Dusing.aikars.flags=https://mcflags.emc.gs \
-Daikars.new.flags=true \
-jar folia.jar
I can see WebhookUtil is a problem, which makes some sense considering it's converting integer pixel data to PNGs, so maybe thats somehow causing the codeheap to explode (?)
.. I suppose it being a runnable lambda that's referencing runtime method params prob isn't helping
for reference, this is the method. will refactor a bit to be a little less runtime lambda dependent
test.java by @vital path: https://pastes.dev/3A2fbEjNuf
I'll also be using -XX:ReservedCodeCacheSize=512M from here on to help stave off the crashes until I'm certain it's sorted, but unsure if that's just generally a good idea for 400+ players or just a bad workaround
the size of the compiled code shouldn't really be higher with more players, unless you dynamically generate code
I'm not
there's nothing i'm doing afaik that would do that
other than maybe that particular method? but im not sure why
are you frequently unregistering/re-registering event handlers by any chance?
don't believe so
(or one of the plugins you're using)
Helper should register all of its listeners more or less at boot and I've never had any issues with it doing that before
A collection of utilities and extended APIs to support the rapid and easy development of Bukkit plugins. - lucko/helper
Other than that, I'm not personally registering/unregistering event listeners during normal operation
Actually - nvm. Upon some further investigation it turns out my crash from today spat out a hs_err_pid file which seems to blame the not-really-working version of Spark I had loaded.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000071705aeb4b79, pid=2262816, tid=2324367
#
# JRE version: OpenJDK Runtime Environment Corretto-21.0.5.11.1 (21.0.5+11) (build 21.0.5+11-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-21.0.5.11.1 (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C [spark-3feb06da661595-libasyncProfiler.so.tmp+0x28b79] Profiler::recordExternalSamples(unsigned long long, unsigned long long, int, unsigned int, EventType, Event*)+0xb9
#
Removing that :l make sense that could crash things
-# update your java binary too, you're like 2 minor versions behind
hi guys how to increse the maximum Utitisation
You need to allocate more CPU cores to your instance (if it's a vm) or change for a better CPU
i don't understand what's wrong in this statistics, why would someone want to maximize the utilisation ?
He want to have a usage that can be higher than 200% in Utilisation: part
oh okay, so he expects higher workloads so he's asking for how to get higher potential perf
okok ty
Hello everyone, I am new to folia, I want to use folia version 1.21.7 but I can't find it on the paper homepage. Is there any way I can download this version?
You can compile yourself
But yeah 1.21.7 needs to be self compiled
hello, does folia use bstats ? I'm wondering how much people use folia
thanks a lot !
Any ideas why the PlayerTeleportEvent won't be triggered? I looked at the code it looks like it's getting triggered but ingame it doesn't listen to it...
Some events do not work on Folia. That is one of them
the amount of people on outdated as hell version on such experimental software is concerning
Reminder that this is a help channel, not a random side convo channel @primal quail @scarlet ginkgo
fine...
Does anybody have an idea why some chunks get corrupted like this?
there should be some sort of error in the log when chunk corruption happens
though that really looks like WorldEdit or similar, usually chunks just become air
We don't have worldedit installed.
That's not Folia
Folia fork
That's what I said.
I thought it was a Folia issue, that's why I i asked in here. Sorry for disturbance š
Always report on your version provider discord. If it is a Folia problem, make a prove of concept (from 0) only with Folia and then report it here
Is there a deeper reason as to why this event doesnāt work on Folia? Iād imagine all youād have to do is make it asynchronous- But Iām wondering if thereās a bigger reason as to why itās broken in the first place
When you say "all you have to do is just" then it's usually dismissing a ton of stuff. There's a reason, and the reason is that it's very complicated and not easy to solve.
If it were, it wouldn't be missing. Folia itself is pretty complicated, so building that and the not solving this other problem means that problem is also complicated.
Thatās what Iād like to hear actually. Iām sure the reason is complicated and Iād like to know if anyone here has the knowledge. Iām interested to hear why this breaks on folia in the first place
Part of the reason: say the teleport was from a region to another, so from is different than to. Which region do you fire it from? Whichever is your answer, you cannot work with the other Location without running into threading headache
Interesting, thanks for the insight! I guess a solution could be to fire it from the global thread? But I donāt know all that much about Folia internals to begin with. I might go read through Folia src and see how teleportation is handled on it currently and thatāll probably give me more information as to why it breaks.
Hello, im trying to build folia 1.21.4, but it seems unable to clone Spigot build data. Im also unable to git clone the repo manually. Maybe someone had that issue?
Execution failed for task ':folia-server:cloneSpigotBuildData'.
> io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false fetch --depth 1 origin 3edaf46ec1eed4115ce1b18d2846cded42577e42
Spigot's having issues - see #build-tooling-help
But also, you don't want to be on 1.21.4. You want to be on 1.21.7.
Especially with Folia you want to be on the most recent build/version.
So just grab it from the site.
allright, thanks!
Hi, I wanted to know what the record is for the most players tested on a Folia server.
yo i donāt think thereās an official record yet but folia has been tested with like 1000+ players in dev tests and handled it pretty well since it runs regions on separate threads but it still depends on your hardware and how optimized your plugins are
And the spread of players obv
thx
Thereās a blog post someone made about a test they did. Should be searchable if you look around.
Youāre going to need really burly hardware for a lot of players.
and then you can't access either side of the teleport; The only solution to this is proper async events
The global region doesn't provide "global" access, it's just the global context hack thread is my understanding, it's where stuff with shared state is managed iirc
Hi, any tips?
The people can't split beacuse they can't se the chunks
https://spark.lucko.me/2nCpKfl0a0
@burnt plover please reach out to the fork you are using for support. This channel is for people using Folia
does anyone know why calling the PlayerDeathEvent gives a java.lang.NoSuchMethodError error?
PlayerDeathEvent deathEvent = new PlayerDeathEvent(player, drops, xp, deathMessage);
it works perfectly fine when on regular paper
Guessing it works on paper due to some spigot bytecode rewriting madness because that method doesn't seem to exist
Not sure how you got it to compile, what version of the API are you depending on?
Every single constructor, even the deprecated ones, takes a DamageSource as the second argument
Hopefully this isnāt ChatGPT generated code . . .
Unless they're using the old eclipse compiler and building in a special way I don't even know how they got that to work at all
It would be weird if AI guided them to such a thing
That constructor exists in like 1.20.6 but was seemingy removed in the 1.21.x series somewhere
ahh okay, thanks for telling me some more info about it. Pretty interesting stuff
I'm depending on the paper api, I probably should have switched to the folia api to see if the constructor existed before I asked here
is there a version of the constructor that would work for both paper and folia
oh that makes things even more confusing
i'm using the 1.20.4 dependency, but the server is running 1.21.4
That makes sense then
so it probably isn't related to folia/paper, it must just be a version issue
because I tested the plugin on a 1.20.4 paper server
It might even still work on paper 1.21.4+, so long as you aren't using paper-plugin.yml, due to spigot's bytecode patcher
Folia might be missing a part of that though
Oh, or you just tested different versions, lol
I don't think that event constructors have ever been part of the rewriting crap
yeah idk why i didnt realise i was testing on different versions
Event constructors are only sort of API so I guess Spigot wouldn't bother patching them
You aren't really supposed to be calling them yourself
yeah I know, I don't really have a choice unfortunately
interestingly the 1.21.4 constructor requires a damagesource whereas in 1.20.4 you can't include one
DamageSource is newer API
yeah I would've thought they would add some backwards compatibility
I guess that's a lot to ask for when you shouldn't really be calling it in the first place though
I mean, there is no means of backwards compatability there
iirc paper even marks all the constructors with @Internal
the information literally does not exist, and reconstructing it in any form of accuracy using the older bukkit representation of that stuff is just a joke
yeah I can't blame paper
So basically you need to choose, does your plugin work on 1.20.4 or 1.21.7?
It can't work on both without a giant headache
i'll find the oldest version that uses the new constructor and use that version I guess
it looks like the change was made in 1.20.6
everything works now with 1.20.6, thanks everyone for the help
FWIW you shouldn't really be looking for backwards compatibility with Folia anyway. No one running Folia should be running 1.20.6 - everyone should be pushing to get on 1.21.7, or AT LEAST 1.21.4.
I never thought about that but you're definitely right, I've never seen someone run folia below 1.21.4
With Folia in particular you want to be on the most recent version. There's a lot of stuff beign fixed/updated that isn't tied to the Minecraft version. The jump from 1.21 to 1.21.4 is pretty huge.
how much players on region???
This person is using a fork of Folia - so we aren't going to suppor tthem here.
wtf
Folia is freshy
Read the replies to their messages. If you're using a fork, you get support from whoever makes the fork, not here. We don't support software we don't make.
I'm surprised that there are forks for Folia
People tend to fork it and then disable a bunch of safety checks or add patches we donāt really think are safe.
Which is another reason we donāt support forks here.
Hello, error Playerguiadvanced
[04:56:59 ERROR]: Could not pass event InventoryClickEvent to PlayerGUIAdvanced v6.8.0
java.lang.IllegalArgumentException: Unsupported custom inventory size 43
at org.bukkit.craftbukkit.inventory.CraftContainer.getNotchInventoryType(CraftContainer.java:133) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at org.bukkit.craftbukkit.entity.CraftHumanEntity.openInventory(CraftHumanEntity.java:366) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at PlayerGUIAdvanced-6.8.0.jar/me.loving11ish.playerguiadvanced.y.a(ActionsMenu.java:123) ~[PlayerGUIAdvanced-6.8.0.jar:?]
at PlayerGUIAdvanced-6.8.0.jar/me.loving11ish.playerguiadvanced.r.a(MenuListeners.java:23) ~[PlayerGUIAdvanced-6.8.0.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[folia-api-1.21.6-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:71) ~[folia-api-1.21.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[folia-api-1.21.6-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3286) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:59) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:14) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:31) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.server.level.ServerPlayer.lambda$queuePacketTask$3(ServerPlayer.java:684) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.threadedregions.EntityScheduler.executeTick(EntityScheduler.java:243) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1659) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:546) ~[concurrentutil-0.0.3.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
well, talk to the developer of that plugin. 43 is not a valid inventory size
inventory sizes have to be multiples of 9
Aha, yes, I understand.
This same plugin, in this same version, worked fine in Folia 1.21.4 without any problems.
This problem became apparent when updating to 1.21.6
Maybe a check was added there
But that has never been a valid inventory size since Minecraft existed
(at least not for the container/chest inventory)
Gotta love how that free plugin is obfuscated so I can't even look at its code to see how it gets to 43 
okay it seems like it just creates an inventory with the size equal to the amount of online players or something. thats awful lol 
No, it was a Paper bug that was fixed here https://github.com/PaperMC/Paper/commit/00e79dfb22a92b33516663da221a3362a2c122ba. They need to update to 1.21.7, not 1.21.6, if they want fix.
In spigot and paper, every world tick on the same thread ? Only folia handles worlds on different threads thanks to its region system ?
Yes, every world ticks in the same thread in Paper. The possibility of ticking worlds in parallel is Folia-only
thanks š
Hey everyone, just a small technical question, is there any reason why most of players (150 our of 170) would be merged in the same region although being hundreds or thousands of blocks away?
Any way to reduce the distance required to merge?
I've seen this as well but in my case the world was 20k
are you sure they were that far away all the time? if one player walks from region A to B, if you are unlucky that causes them to merge
what was the distance between players to trigger region merging? I remember 2k blocks or 1k blocks
@white laurel
yes but it doesnt say how many blocks
below 5k blocks, bigger chance the region will merge
I think thats an example? But I remember somebody of the staff mentioning at least 1k or 2k
theres not really a fixed number. with a default grid-exponent value, its around ~900 blocks for a split at view-distance=10.
It was 1500, before this commit
imo if you have to worry about the actual numbers, your gamemode is probably not suited for Folia
Thanks for that, its good to know to find a proper tuning
I was thinking into splitting a world into multiple worlds and do a load balancer
The actual folia problem is related to the fact that can be only one world? I dont remember correctly but I remember something about worlds
folia doesn't support plugins loading worlds
and to create more worlds?
so by default nether and end are not generated?
They are
ah, I mean, if they are, why not possible to have multiple worlds?
Because unloading worlds is not supported due to the complexities involved
loading iirc is fairly easy to fix and there are libraries which do that
unloading is an entirely different beast
Unloading I mean I dont need it, or you talk about when server is stopping and worlds are ubloaded?
I mean at runtime
if you don't need unloading then there are already libraries to load worlds at runtime
ah cool thank you
I figured out how to do it properly
It is actually not just the unloading itself
The main problem was saving the world
who can help? I make plugin on folia and i think my code have problems with build.gradle. My plugin dont see bukkit
#folia-dev and show your project file tehre
what project file u need?
the one that is failing to import folia-api properly
ohh hmm my mspt so low but cpu so high, can someone help me...
You only allowed it to use a single CPU core (100%), that's not enough
So im curious, why did you guys start to share build versions of folia?
Because spottedleaf said so
Whether there is more reasoning behind it, I don't know 
there's also the fact that eventually sketchy third-party downloads would pop up so ĀÆ_(ć)_/ĀÆ
And besides, Folia has been downloadable from the downloads API since basically forever too. So people who somewhat know their stuff could get pre-build jars already anyways
Hey guys, I have a SMP server that needs to support more than 1,000 players. I'm strongly considering using Filia, but I wanted to understand the differences in terms of development that I would have to take (my server is entirely my own)
Can anyone help me? It could be with articles, topics, or even experiences.
Well, step 0 is layouting your server accordingly
Many SMP setups aren't favourable to that player count
But, in general, the difference is that in Folia development you always need to be operating in the right thread
So, you'll need to use the relevant schedulers for entity/block related tasks and be more careful with thread safety, especially if you have multiple regions accessing data in your code
so just chunk-related stuff, right?
in that case, should I separate the world without limiting it with a border, then?
Anything that belongs to or originates from a region thread has to be taken into account
Chunks, entities, events, any data your plugin might hold and that's not safe to be manipulated from other threads, etc
A border does make it more difficult to create different regions, you'll need to separate the players within the world
sure, thx
Folia will help if datapack have many mcfunctions?
I want to try "Incendium" datapack but when i see... 12k of files (and then, so many "server is overloaded message")
So I'm wondering if Folia can manage each function in each cpu thread.
Folia doesn't work like that, no
And it doesn't even support datapack functions at all
Will be implemented in the future?
It would be interesting for each player to load the functions in a certain radius in parallel
Probably not but if a datapack is able to slow down a single server it'd still slow down every region by that same amount
So it wouldn't really help anyway
Not sure why you'd use datapacks with functions when you can use plugins.
datapack functions kinda defeat part of the tenents of folia
Taste, I guess.
I would use the Terra plugin better for the world generation thing (it's compatible with folia).
And when it's on single core, I'd have to look for the one with the most GHz on single core.
As cat said, datapack functions go against the idea of why Folia was made. They're very poorly performing.
Just fyi Iāve never seem anyone running Incendium and not lagging. The pack is only really good for taking pretty screenshots. Not for public server with players
So... Incendium is unplayable on servers with many players...
datapacks have to go 10 miles around the block to perform a lot of operations that would be trivial otherwise
The terrain generation changes look neat but then they had to go and try to do custom structures and game mechanics and doing those with datapacks is slow
But, the entire point of Folia is to be able to break a world up into independent tickable regions, command functions and the commands they generally use assume global state
Search for the keyword on this discord. Itās reallly bad. Just want to let you know before you go too deep in general
If you just wanted the terrain generation you could strip it down and get something that performs fine (and works on Folia)
Or pre-gen the world on Paper and move it to Folia.
I understand, then it would be to pregenerate the world in Paper and move it to Folia, although I suppose that the datapack should stay installed (i understand that overwold breaks if datapack is deleted) and at least not load the chunks while.
Or the best thing to do would be to remove the functions that add enchantments and mobs and leave the most important things.
I would have to try it on a test server.
I'm not really sure how Terralith works - but in the past you'd pre-gen the world and then just move it over.
If it needs the datapack enabled then I probably wouldn't do that for Folia if the datapack requires functions.
In fact, I am pregenerating the world of Terraligth with some datapacks and I took care that each datapack has few functions, because I know that if it has too many functions, it would work very slow... And obviously with Incendium... well, look how much it has...
I mean for Folia you'd want something with no functions.
I understand, it would be preferable to get the best possible performance for a server.
Datapack functions don't work on Folia at all.
For Paper you want less functions for better performance.
For Folia you want none.
Oh, that makes sense.
I had a wrong idea and I thought that with Folia I could improve mainly because of the parallelism. But from what I see, I would have to look only for plugins that achieve the same goal and are compatible with Folia.
At least I am not on the wrong track on that point about Paper, I take care that it has few functions, it has already happened to me with enchantment datapacks, and well, I would not want the same thing to happen to me with Folia.
Thanks guys!
i got this when compile 1.21.7 server, how to fix ts please help
net.minecraft.ReportedException: Exception ticking world
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1838) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1667) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:546) ~[concurrentutil-0.0.3.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1447) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ReferenceArrayList.get(int)" because "this.wrapped" is null
at it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet$SetIterator.next(ReferenceOpenHashSet.java:520) ~[fastutil-8.5.15.jar:?]
at net.minecraft.server.level.ChunkMap$TrackedEntity.broadcast(ChunkMap.java:1235) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.level.ServerEntity.sendChanges(ServerEntity.java:230) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.level.ChunkMap.newTrackerTick(ChunkMap.java:1027) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.level.ChunkMap.tick(ChunkMap.java:1038) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.level.ServerChunkCache.tick(ServerChunkCache.java:512) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:773) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1833) ~[folia-1.21.7.jar:1.21.7-DEV-40402e4]
... 5 more
[02:02:25] [Region shutdown thread/INFO]: [RegionShutdownThread] Awaiting scheduler termination for 60s...
[02:02:25] [Region shutdown thread/INFO]: [RegionShutdownThread] Scheduler halted
[02:02:25] [Region shutdown thread/INFO]: Stopping server``` I recently received a crash that appears super generic on the latest version of Folia 1.21.7. It's so vague that I'm not entirely sure how or what to precisely patch. I'm somewhat aware that this is invoked by (often) a plugin; however, identifying that plugin has proven tricky, even through responses of URLs sent by electronic to related issues. This could be a core issue in Folia; however, that seems unlikely
Yeah... isn't multithreading fun?
Unless you figure out how to reliably reproduce that crash it is unlikely anything will ever be done about it
Do you know by any chance if an auto/manual save occurred before the crash
Wrong channel mb
How fun multithreading truly is⦠but not that Iām aware of. Everything seemed to operate as normal until the instance decided to dump itself. I applied a return and a null check where the code seemed to dump to hopefully mitigate the issue, since the crash provided such few information
Hello! I got an Epyc 9K84 server and would like to experiment Folia, how is the stability of Folia doing nowadays ? Also anybody know of a teams / factions / guild or similar plugin with claim system supporting Folia ? Thanks in advance
And also what would be the most stable current branche for Folia ?
Hi guys. I need to write an authorization system when entering a minecraft server via discord (the server core is on folia). I need to kick a player from the server after 30 seconds, but this code with a delayed task does not work for me
if (!dslogins.containsKey(playerId)) {
String authCode = String.format("%06d", new Random().nextInt(1000000)); // asynchronous?
cods.put(authCode, playerId);
player.sendMessage(ChatColor.YELLOW + "Enter the code " + authCode + " in our Discord bot for authorization!");
Bukkit.getScheduler().runTaskLater(plugin, () -> {
if (!dslogins.containsKey(playerId)) {
player.kickPlayer("Authorization time has expired!");
} else {
player.sendMessage(ChatColor.GREEN + "You have successfully authorized!");
}
}, 600L);
}
AI (grok) suggests me to write the following code, but I have problems with folia-api dependencies:
GlobalRegionScheduler.getScheduler(plugin).runDelayed(() -> {
if (awaitingAuth.containsKey(playerId) && awaitingAuth.get(playerId)) {
Player onlinePlayer = Bukkit.getPlayer(playerId);
if (onlinePlayer != null && onlinePlayer.isOnline()) {
onlinePlayer.kickPlayer(ChatColor.RED + "Authorization time has expired (30 seconds)!");
}
awaitingAuth.remove(playerId);
cods.remove(authCode); // Remove the code after expiration
}
}, 600L);
Thanks in advance for any help !
Tasks need to be run in the correct region thread
The first code is not correct because Folia doesn't use Spigot's scheduler system
Can you please advise how I should write it then?
Something like this should work... But you should note that dslogins should eventually be an ConcurrentHashMap (in case you currently use a normal one) and that depending on your remaining logic you should use it's atomic methods to make all your code threadsafe.
if (!dslogins.containsKey(playerId)) {
String authCode = String.format("%06d", ThreadLocalRandom.current().nextInt(1000000));
cods.put(authCode, playerId);
player.sendMessage(ChatColor.YELLOW + "Enter the code " + authCode + " in our Discord bot for authorization!");
player.getScheduler().runDelayed(plugin, task -> {
if (!dslogins.containsKey(playerId)) {
player.kickPlayer("Authorization time has expired!");
} else {
player.sendMessage(ChatColor.GREEN + "You have successfully authorized!");
}
}, null, 600L);
}
(In discord the method is very weirdly formatted, idk why)
Sorry, but I don't understand, I can't find the method player.getSchduler()
thank you
i find another method too with GlobalRegionScheduler
yes, but operations concerning the player should be run on the player's scheduler.
The GlobalRegionScheduler doesn't handle those things and you will receive erros in most cases when interacting with player through it.
There aren't many public claim plugins that are very good for folia atm
There are some chunk claiming plugins but that's about best available random option out there
I'll take it into account
can i run folia with 36gb and 10 cores
My message to you was to read the pins in here.
Not simply re-ask the same question.
Lots of info in here.
Hello guys, who can help me solve this problem? I dont understand why class world dont have function world.getRegionScheduler().
Path of my code:
for (World world : Bukkit.getWorlds()) {
world.getRegionScheduler().run(this, (worldTask) -> {
int removedCount = 0;
for (Enderman enderMan : world.getEntitiesByClass(Enderman.class)) {
org.bukkit.block.data.BlockData carriedBlock = enderMan.getCarriedBlock();
if (carriedBlock != null) {
enderMan.remove();
removedCount++;
}
}
getLogger().info(String.format("Removed %d EnderMen with items in world '%s'.", removedCount, world.getName()));
}, 0L);
}
because a region is linked to entities
Yes, but what i can use for solve problem?
once you get the entity, each entity has an EntityScheduler
declaration: package: org.bukkit.entity, interface: Entity
Hey, how can i assign more threads to folia?
I currently have 16 Cores (32 Threads) on my machine, but folia doesn't seem to take them into account...
by modifying the settings file
paper-global.yml iirc
i dind't set any limit?
and how does grid-exponent affect region size? (some googling let me think it has something to do with it?)
what is the current status of the worldborder in folia? From what i remember, for a very long time there was no native way to use a worldborder on folia, has this since changed? The Folia FAQ currently still mentions that the worldborder command is disabled https://docs.papermc.io/folia/faq/
wasn't there some workaround for it by first applying the world border in vanilla/paper and loading the world in folia?
^ bump?
I don't remember the exact logic but I'm pretty sure you can only make regions larger
Like increasing the number makes regions larger but I don't think you can decrease it?
Or maybe you could go down to 2
That doesn't cut region sizes in half though
I'd guess it's some factor of how the bitshifting for the regioniser logic works
If it's a shift increasing it would likely decrease the region size
So it works by some unknown means and increasing it either increases or decreases the size of regions š
The shift shifts up the size of the grid
lower values = your boxes in the grid are smaller
Is there anyway to get the old stacking raid farm 1.20 mechs on my Folia server?
Send a spark report for configs?
Okay one sec
Heyo, sometimes i'll get this error. Is this something you guys have been experiencing too? It's only me and it's a new world. ( a 1-2 months old )
[13:20:40 ERROR]: ------------------------------
[13:20:40 ERROR]: Current Thread: Region Scheduler Thread #2
[13:20:40 ERROR]: PID: 132 | Suspended: false | Native: false | State: TIMED_WAITING
[13:20:40 ERROR]: Stack:
[13:20:40 ERROR]: java.base@23.0.2/jdk.internal.misc.Unsafe.park(Native Method)
[13:20:40 ERROR]: java.base@23.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
[13:20:40 ERROR]: net.minecraft.util.thread.BlockableEventLoop.waitForTasks(BlockableEventLoop.java:150)
[13:20:40 ERROR]: net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:140)
[13:20:40 ERROR]: net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.managedBlock(ServerChunkCache.java:829)
[13:20:40 ERROR]: net.minecraft.server.level.ServerChunkCache.syncLoad(ServerChunkCache.java:122)
[13:20:40 ERROR]: net.minecraft.server.level.ServerChunkCache.getChunkFallback(ServerChunkCache.java:156)
[13:20:40 ERROR]: net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:330)
[13:20:40 ERROR]: net.minecraft.world.level.Level.getChunk(Level.java:1028)
[13:20:40 ERROR]: net.minecraft.world.level.Level.getChunkAt(Level.java:1017)
[13:20:40 ERROR]: net.minecraft.world.level.Level.getFluidState(Level.java:1396)
[13:20:40 ERROR]: net.minecraft.world.entity.Entity.updateFluidOnEyes(Entity.java:2009)
[13:20:40 ERROR]: net.minecraft.world.entity.Entity.baseTick(Entity.java:880)
[13:20:40 ERROR]: net.minecraft.world.entity.LivingEntity.baseTick(LivingEntity.java:451)
[13:20:40 ERROR]: net.minecraft.world.entity.Entity.tick(Entity.java:847)
[13:20:40 ERROR]: net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3252)
[13:20:40 ERROR]: net.minecraft.world.entity.player.Player.tick(Player.java:323)
[13:20:40 ERROR]: net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:996)
[13:20:40 ERROR]: net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:365)
[13:20:40 ERROR]: net.minecraft.network.Connection.tick(Connection.java:663)
[13:20:40 ERROR]: io.papermc.paper.threadedregions.RegionizedWorldData.tickConnections(RegionizedWorldData.java:522)
[13:20:40 ERROR]: net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1849)
[13:20:40 ERROR]: net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1667)
[13:20:40 ERROR]: io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407)
[13:20:40 ERROR]: io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418)
[13:20:40 ERROR]: ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:546)
[13:20:40 ERROR]: java.base@23.0.2/java.lang.Thread.runWith(Thread.java:1588)
[13:20:40 ERROR]: java.base@23.0.2/java.lang.Thread.run(Thread.java:1575)
[13:20:45 ERROR]: [io.papermc.paper.threadedregions.FoliaWatchdogThread] Tick region located in world 'Havok' around chunk '[123, 189]' has not responded in 10.983004s:" ```
Can you post the full log? Which build of Folia is this?
1.27.1
Yea I named my worlds...
Which build of Folia? And can you post the full log?
Well it's happened a couple times so far. Would it help if I took a video?
From what I observed it just happened when I teleported to spawn.
Yes
Yea, my main world could be run and tested on ( if you want me to make a separate test server with a new world ). This issue seems to happen randomly, but I'd like to think it has to do with when a player teleports to a new region. ~ When this issue happens the server freezes up, and it's crashed once before.
Anyone messed around with plugins for mmorpg style servers? None of my usual plugins are available on folia (denizen, itemsadder, mythicmobs) and I'm trying to figure out what to grab š ExecutableItems is looking like a solid start.
You can learn Java and make your own.
I know java and have written my own plugins in the past. It was just the hope that I don't have to reinvent the wheel if a solution exists already. If I was using paper or a standard fork, then the plugins mentioned above would be the already existing solutions.
Probably helpful to search around this channel. I donāt know about those specific plugins. Youād have to do some legwork on your own to find out.
But yeah this isnāt a helpful response.
I think making your own plugins is way more helpful in the long run than using public ones
Thatās not really a debate topic for this channel.
šš»
Part of the reality of folia is that it's not designed as a slap-in replacement for paper, etc
I'm surprised that as many plugins put in the effort to support folia as have done so
I agree in the case of doing something specialized, writing your own, tailored plugin will usually be better. I say usually because it depends how good of a programmer you are and how lag friendly you write it. The things I'm looking for publicly are much more generalized though. Mythicmobs is a core plugin to a lot of mmorpg servers that allow creation of custom mobs/items, abilities to be tied to those, and had a lot of handles for event triggers, built in stuff for handling adding custom based "elements" to the damage of mobs and weapons with strengths/weaknesses, etc. Its pretty well the gold standard for that style of server.
Denizen is more generalized than that, as its a scripting plugin originally meant for controlling the citizens plugin npc's to create quests, interactions, and whatever else. People started to find that its actually incredibly generalized though, and you can go through making entire minigames out of the thing if you want. Denizen is also useful for the reason that you can just reload the scripts with the server running and it works perfect every time. You don't have to go recompiling.
I don't expect to get off scott free without having to write plugins. Was just curious if anyone knew of any that fit some of that usefulness, which I found one in "executableitems", and now am in search of one for custom mobs before I decide to write it myself.
agreed there, quite a few for the short period of time folia has been active.
compared to the history of spiggot, bukkit, and paper, its pretty short.
especially for a lot of plugins needing near complete rewrites.
Where appear the folia config? I dont found any folia.yml after start the server :v
where i can configure?
There are none
what are you looking to configure?
How i can increase the utilisation?
I mean, 100% = 1 thread
did you even click the link I sent?
then why are you not reading it?
threaded-regions.threads
this is where its?
aaa
i have found
nothing
gg
threaded-regions:
grid-exponent: 4
threads: -1
this would be 400%
right?
-1 means that it uses some maths to work out the number of threads
and grid-exponent
?
i dont found nothing of grid-exponent in https://docs.papermc.io/folia/faq/#how-to-best-configure-folia
For 800 players what size of overworld you recommend?
at least 800.000m² if you want each player to have their own region
one block is one meter
so 800k of radius?
that's not what I said
there's no relation between player count and world border size
either your players are spread enough or not
actually sorry I think my math was off
it's 800 million m² xD
to put in server properties
XD
for folia? none, leave it default for best results
the more players are spread out, the more folia benefits
which would be a radius of around 15k but that's only if players are perfectly spread which you will never achieve
you don't pregen on folia, you'd have to pregen hundreds of millions of chunks
if you really want to limit it for some reason maybe use a radius of 100k or something large but pregenning doesn't make sense
folia has no wiki? what are you refering to?
"pre-gen" ;)
"First, it is recommended that the world is pre-generated so that the number of chunk system worker threads required is reduced greatly."
why'd you type it liek that
you tell me, English isn't my first language
i have now 20k of world pregenerated
So its not necesary to add more pregen
for 800 players?
just pre-generate as much as you think is necessary. generating more than the initial place people spawn doesn't make sense imo though
I mean, you can pregen like half of vanilla world border if you think it's worth it
imo it's not but hey, it's your time and resources ;)
also I kinda don't agree with the suggestion to pre-generate seeing as it will run on separate threads anyways and don't influence the server at all (in the ideal environment of CPU threads not being limited)
granted if you have 800 players all on their own thread then I doubt you have a CPU which can efficiently handle that lol
than 20k worldsize
with 20k world size don't bother with folia
however much you want
i will put then default
And simulation?
same as paper
but
some tips still apply, especially ones regarding ticking
that's what I'd use if I ever had the need to run folia
perfect
do keep in mind that if I were ever to run folia I'd get at least threadripper pro 7985
that thing likes threads
Piracy is not supported.
@subtle wasp for reference what is pirated there š?
How did you find out about this?)
player in your chat does not exist
what its the best form to see the stats of folia tps and more?
I now the /tps but its there a best option?
Spark has a Folia version
its the best option?
this?
don't think so
iirc its some branch or PR you build yourself
:c
š®
I think that jars are published on their CI server or something
Hi, we don't support offline mode servers. Please see our rules in #welcome - specifically rule #7.
ty
ah, you meant they were running a cracked server š¤£
Help channels aren't really the place for this kind of conversation. Also it's better to focus on your own stuff rather than a conversation between two different people.
my bad, sorry, there isn't a general discussion tab related to folia, just help and dev. I'll keep it direct in here from now on š
Hi, I am a developer and we are currently considering switching from Paper to Folia for a future large project. I saw that last month Folia got a stable release. I wanted to ask what you guys think about whether it's worth switching at the moment. Especially considering the fact that we are planning to modify many packets
I don't think it is a smart idea to plan a project for folia without having the needs for it yet
I would start on paper until it doesn't suffice anymore
And you actually hit a point where folia would be profitable
(Player spread and world size)
First of all, thanks for the quick answer :D;
What's about switching from Paper to Folia then? I'm talking about programming in particular. I know that you have to program thread-safe, but what do I have to consider with the Bukkit/Paper API? I also know about the schedulers. But if you start a big project now, can you somehow start to consider both softwares so that you can switch over faster?
That's more of a #folia-dev question but if you compile against paper and use the schedulers the biggest burden after that would be events availability
Alright. Thanks so I switch to #folia-dev then ;D
any way i can further optimise my netty to hold more players in a single region
struggling to hold more than 400 at my spawn at once
I mean Folia is not designed for many players in a single region. See the little factoid above. #folia-help message
well itās good for the general gamemode but when we host keyalls we see performance plummet
weāve got about 450-500 players spread across a 250k world border (ow) and 100k end worldborder and so on
no idea what keyall is, but assuming its some kind of event, maybe just host it on a separate server?
e.g. Paper with like everything you don't need for that event disabled
a keyall is essentially where we give every player online a couple of crate keys
so weāve got a ton of players all around the crates
Maybe then the solution is to just bring the crates to the players or something like that.
this feels like something that is more easily solvable in the area of game design than anything
but having something that forces players to be in one spot is just poison for Folia
perhaps youāre right, i could try & give them the rewards instead of the key so they donāt actually come to spawn
that likely is the easiest solution
i tried disabling clientboundsetentitymotionpacket which improved our netty perf but thatās the best iāve found so far
rather than "keys" a "lootbag" system where they can consume it wherever without a physical thing on the ground they have to click. That probably functions better in this case.
another possible good idea
yo so my servers only got 3 regions yet im running it on a 6c/12t server
anyone know why ?
regions is down to player spread, not the hardware
oh ok.
Why do my redstone machines lag as if the server had 5 tps but it is a constant 20? I am making a server for version 1.21.6
Client lag maybe
When I place blocks, they move back and half of them don't get placed. The first and last ones I placed work, but the ones in the middle seem to disappear.
my friend joined and when placing blocks, he moves them back halfway
but this is not about the lag machine, it is 5 pistons that are connected to the watch
and even when it is turned off, the blocks disappear
I mean, folia inherits spigots interaction limiter that will discard fast block placements in the most janky manner, but, probably not an issue
It's pretty hard to say what you're seeing because, well, we're not magicians
Do this, please.
ok wait
I can't find Spark on folia and it doesn't work without the plugin
Search this channel - it tells you how to get Folia for spark
If you're running Folia you want Spark installed.
Ah. We don't support offline mode servers here. Please see our rules in #welcome - specifically rule #7.
. . . deleting the report and flipping the server to online mode is not going to get you support.
thank you, I can handle it myself
So basically, it just needs one sent report with offline-mode false for u to not provide any support later on?
I was testing today my folia sharding plugin, and i set offline-mode to false, because i needed to use mineflayer to get 1500+ bots onto it to test balancing with netty under load, in that scenario i cant get any further support?
if its reasonably evident that thats actually what you did, and you are not running offline mode in production, I dont think people will mind
yeah but for example my guy @storm basalt just sent here the report, because he has some problems, in report we can see exactly my plugin "FoliaTestBalancer"
So idk why it is considered like not within the rules.
I understand if we would see like 150 online players, plugins, server-ready setup, like some commercial things there, and woow we need help with our cracked server.
I also consider the time-consumption of checking these things, but in my opinion its not relevant tbh.
This isn't the place to argue about this. I mean we really aren't going to argue about it at all. But eithr way - better to focus on your own server and your own server issues than what's happening with someone else.
Yeah but he is basically one of my team members which was having some troubles with redstone. Thatās why Iām asking. He sent spark from my server.
hey,
who are you hosting with ?
because they are using swap memory
we're hosting on hetzner on dedicated server
oh ok
in general Folia definitely needs some optimizations for when players are viewers of a lot of other players. The PPS per player quickly bogs down the server to an unnecessary degree when hundreds of players move at once. not sure what the best strategy would be to improve this (maybe distance based LOD once enough players are visible?) but I do think something should be done. this is the only thing preventing high player density, small regions from working in a lot of cases
I've thrown more threads at it myself to try and reduce issues but I'm not aware of how those threads are utilized in that scenario
distance based stuff already exists with the tracking ranges?
What Iām trying to do is for example creating 10 spawns with 10k distance from each other.
And basically creating sharding plugin which will store regions of spawn, mine, islands, etc.
Calculate player count and teleport player to appropriate region with empty slots.
I donāt think anything else is possible with many people in one place
not to a degree that keeps the netty threads from choking with like 400 people in one area
if all of those people can see eachother the server gets overwhelmed quite fast
Yep. Folia never set to solve that problem
400 people in one area defeats the purpose of folia
The first one ^
u can just get the benefit of each world ticking, not regionize
can someone help me with the TPS on the TAB plugin because i keep getting the error "Folia never updates MSPT and TPS values in the API, making %mspt% and %tps% return the default values (0 and 20)." can someone help?
just remove the tps from the tab?
i would but i want to keep it
Folia has different placeholders for regionized tps and averaged tps iirc
but if it doesnt work...
it was just because i didnt know the correct placeholder for it thats why i am here for help to see what Placeholder it is
best to ask the folks from TAB
Its in the wiki pages. I've seen it before. At work and cant look it up
If you have problem with TAB plugin displaying TPS, you hav to reach out to them for help
no it does work fine its just with folia it is a different placeholder
Again, that's all plugin stuff. You'd want to ask them.
ohh ok sorry
It's okay.
If you're having an issue or config problem with a plugin you always want to talk to the plugin folks.
okok
This is whqt i'd found prior, but havent tested yet https://github.com/Winds-Studio/Folia-Expansion
Sure, but it should eventually provide a solution to that problem. The answer long term isn't just "don't put everyone in one spot" - real world servers like to have everyone group up, and in survival scenarios people will just naturally do that.
I run an SMP across a large map and we've had users run events where 200+ 300+ people all gather for something. It's not unrealistic at all as a usecase and I'm not about to tell them they can't do that
The benefit of Folia's multithreading is allowing large amounts of players to feasibly play together in the same world without the downsides of a single tick thread with good performance. The performance gets worse as people gather, but that's inevitably going to happen in SMPs and just in general. If the server grenades itself during organic player behavior, I'd consider that a bug and something worth fixing. If that happened in Paper under otherwise sustainable conditions I think that'd be a no brainer.
this Folia Spread command has nothing to do with what I'm talking about, either.
So yes, Folia never set out to solve that problem, but it's nevertheless a problem someone contributing to Folia is going to have to deal with eventually. If it's me, then it'll be me, but it makes really no sense why a PR providing fixes for that scenario would be against the point of the project. That kind of improvement would only benefit Paper and Folia.
It's possible I'm just misreading this and it's just misguided advice being thrown my way. I'll need to come up with a solution for this anyways, just kind of curious if it's worth writing it intending to upstream it or not.
This is literally against the benefit / point of Folia. There is no PR you could write that would correct that which wouldnāt completely change the way Folia works.
This is optimizing the networking not per player tick
It's an issue for both Paper and Folia realistically
There's just less valid use cases for such a thing in paper
My advice for anything like this is the same to anyone else: feel free to fork and do your own thing. If you plan to submit some sort of PR youād be best off writing up a proposal first through an issue to see if itās in a direction Folia would want to take.
Otherwise you can spend a lot of time working on some stuff just to get the PR rejected. Just my suggestion.
I just think you're massively misreading me
My server can only exist as it does because of Folia, but the networking code is just inadequate to handle a few hundred players all seeing eachother and moving at once. The PPS gets insane and threads get overwhelmed. It's a legitimate bug
The same amount of entities moving is perfectly fine, players are just highly dynamic and cause unique problems
This is an issue other servers are facing - people don't move and it's fine, but as soon as people start jumping around in those scenarios, their ping shoots up massively and things start to break which is far from something I'd say is expected
On our Skyblock server, we had this problem when we exceeded a certain number (around 250) and to solve it we used the transfer protocol added in 1.20.5 and it literally solved our problem.
The proxies just couldn't hold the charge.
As far as I'm aware it's not the proxy choking
At least not in my situation
The best is that you try to troubleshoot with YourKit, you will be able to see which threads are overloaded or even blocking (like the io netty threads)
The whole server doesn't crash from this so I'd be a bit surprised if it was velocity
It's just a regional issue
Which makes me suspect folia far more than velocity since I'd assume everyone would lag out, not just the intensive regions users
I had exactly the same reasoning as you, except that I see the results given by our YourKit
I don't have a yourkit license so I'll have to just use Mission Control
Also, I noticed that plugins like Znpcs Plus also blocked netty io threads
There is a free trial period you can use
I've used it before so I can't do that unfortunately
This is an indication of what was happening on our YourKit when players had a lot of network latency, when we were using Velocity
After the error can be something else, I just provide you with our experience that we had on our server, if it can help you
I mean, the common issue is just that hopping off to dispatch the work into netty is expensive
either you reduce packets by not sending things like equipment stuff as often, which needs some care, or you break protocollib and improve the dispatch handling
maybe not
maybe it's an issue on the client! not on the server
have you confirmed the netty on server-side was "dying", and not the player's clients instead?
also, it's not really a paper issue.
at that point you're at, you have to tune in buffers, as well as give it more threads if necessary, netty can push a lot more than 300 people around each other, that's not even a question.
you should investigate and add metrics to all buffers to see if you're hitting something you don't want to
and verify if it could be your compression, or another plugin messing your pipeline
but I can pretty much tell it's either your plugins or the clients dying when around 300 players. our transmission rate on donutsmp is over 10.5M pps. we're doing just fine.
this is probally a dumb question and I suspect the awnser is yes, but, will raising the world height on a folia 1.21.5 server to 512 decrease performance significantly? I'm hoping it dosent because I dont see why it would but im assuming it would
you dont see why it would but you are assuming it will?
i think that might change some mob spawning related stuff but besides that i dont see how that would impact performance
Mob spawning and some lighting stuff will take longer
because theres no reason I would see it would but minecraft is the most dogshit poorly optimized game ever
thank you both for the awnsers!
It's really not, it just wasn't built for having hundreds of players on a server
Does anyone know how to find folia regions and identify them in game?
I think the internals of the regionizer are pretty isolated from a game-perspective, but you can get a list of some of the regions with higher mspt by running the /tps command
Why are you trying to find / identify them?
Im curious, isn't async region loading ripe with tick speed exploits? like having 2 hoppers facing eachother in 2 different regions causing item duplication when the tick speeds differ?
The regions will always merge if interaction "between" them would've been otherwise possible
As Kyle said, if you had two things that were possible to interact or where one player can see both of them, then they'd be in the same region. The regions would merge.
So no, you can't run into a scenario like that.
You are likely confusing the countless failed attempted that tried to do regional ticking. Folia has a very strict mechanism in place as other two pointed out.
Now i have another question. Do the regions merge when redstone signal is powered or if they are just connected and not powered ?
Regions merge when they get too close to another.
It's not really "redstone" specific, it's player specific.
A player will have a "region" around them, and anything they do is in that region. If another player is far enough away to have their own region and then they wander close to each other those regions will merge.
You can't send a redstone signal 1000 blocks because you won't have all those chunks loaded anyway.
This kinda sorta illustrates some of it.
Waiting for it to load. Thanks for a great answer!
Thank you for the in depth awnser ā¤ļø
I should really finish my visualization project, it's great for questions like these
I mean it is finished, but extremely ugly, a folia fork, and sometimes freezes the jvm
I've recently turned off compression on our Folia side and left that to Velocity which I'm sure has helped considerably with stability going forward. I'll have to do some further testing and track down the root cause, but, assuming it's still even happening, the real solution in most cases is going to be reducing per player PPS in that scenario on the paper/folia side. Unless Velocity is choking which I kinda doubt
It wouldn't be impossible considering that this scenario turns "plr * plrVisible" from like 4-8k to 80k, though I can also very easily see that bogging down the client as well
is there currently some way to get something like a spark profiler for a specific region only?
no
You can use the region profiler but that doesnt have any fancy online viewer to go along with it
Hello everyone, can anyone help me with installing worldguard for folia 1.21.4? I have already looked at several forks (for example https://github.com/Euphillya/WorldGuard-Folia or https://github.com/Folia-Inquisitors/WorldGuard-Folia), but I ran into a problem that these versions are written for minecraft 1.21.5 and for worldedit 7.3.9, due to a small amount of experience I can not understand how to rebuild the project for my version, if you can help with the right version I will be grateful
The one thing Iāll say is that you shouldnāt be running 1.21.4. Especially with Folia you want to be on the most recent version.
Maybe you are right, but I need to minecraft server on 1.21.4 version
is there any information on when Folia Stable is and when it will be available for the latest version?
We donāt have ETAs for anything basically ever. So not really, no.
How many players can be on a Folia server, i.e. how high can you scale it?
That depends on cpu/ram of the hosting server, as well as your settup as shown in the picture above. If you crowd everyone together, not a lot. If you spread them out, potentially hundreds.
Just like Paper, it depends on hardware, what the players are doing, your plugins, etc etc.
If players are spread out far enough and you have fast enough hardware people have done tests with multiple hundreds of players.
Bot tests arenāt really representative of reality.
You could probably get 1000+ people on a single instance with the right setup and hardware.
But probably not if you have a bunch of janky plugins.
Here is the version that works for 1.21.4, but I strongly advise you as ocelotpotpie suggested to upgrade to the next version: https://github.com/Euphillya/WorldGuard-Folia/releases/tag/7.0.14
However, the ender pearl patch is not there.
Yes it works, I use them on our skyblock
thank you ā¤ļø
hi
what is the best way to sort my tablist without scoreboard teams
The plugin TAB is ported to folia, isn't it?
Hey, I hope this is not a stupid question
So im starting to dev for flio as I want to scale my server
a lot of the plugins are fully custom by me
Do I need to do anything different on the backend for it to play nice?
and do I need to migrate to a different API
read the readme
I have a patch you can snag from my WG branch that works around the issue of ender pearls not being blocked
on the latest build i added "support", but doesn't work if we are outside the region https://github.com/Euphillya/WorldGuard-Folia/blob/patch/version/7.0.x/patches/plugins/0007-Fix-https-github.com-Euphillya-WorldGuard-Folia-issu.patch
This channel is not support for whatever fork/plugin/etc that is.
I just answer the person :/
Or #1083871828998635560-general
OR just use private messages or your own support
Does anyone have an idea on why fawe dropped Folia support?
Like what's the reason
is it such big of a challenge?
It requires a lot of breaking changes that we don't want to push into mainline at the moment just to support folia
plus missing apis/features for stuff like regen
theres a 2 year old PR that added experimental support for folia, i ported it to 1.21.4, but it is still very unstable.
the most basic functionality works, as in you can modify / place blocks, but basically anything regarding reading blocks/entities from the world i hvent gotten to work, and also it isnt able to load chunks which means you cant modify unloaded chunks (but this should not be very challenging to fix)
ong bro
Any chance you link me that PR?
Overview
Very Caution this PR is very unstable and had some bugs. Feel free to report it
Description
Thats a very unstable support for folia 1.20.1
I mad a own task board: https://themeinerlp.noti...
There is a #general channel. But we don't want to normalize people coming here to get support for software that isn't ours, like forks, plugins, etc. So not really something we want to do, no.
Hello, sorry for writing this here, but will Folia be updated to version 1.21.7? If so, do you know approximately when?
Guys, how to install 2+ res packs on server with Folia? 1.21.4
I'm looking at that myself as all the plugins for pack merging aren't folia supported. I just manually merged them and resolved any crossover myself.
the client can do multiple server RPs at once nowadays, you don't need to merge them anyways
Thanks!
Donāt cross post. Also donāt run 1.21.4
I don't understand why not run 1.21.4?
1 problem, 1 resource pack should be static, and the other one should be changing from github
Folia isnāt like a regular Minecraft server. You always want to be on the most recent version. Thereās a lot of changes and improvements that happen (and bug fixes) that arenāt tied to the Minecraft version.
So you should be at least the latest version of the website.
Or the 1.21.7 branch.
1.21.8 might build and run. Havenāt had a chance to test yet. Probably does since itās a minor version change.
Well, it sounds strange, I'm making a fairly large server in Minecraft on Folia and to solve the problem I must definitely transfer all plugins to 1.21.7+ to get help:)
Not strange - unfortunately expected. Anything built for Folia should be on 1.21.7/1.21.8 anyway.
If not youāll want to find alternatives to them regardless. But thereās not a huge amount of folia plugins and most of them stay updated.
Which one is better for running Folia, the 14900K or the 9950X?
9950x
Hi, guys, I have a plugin that create group in luckperms and add this group to player, but I need save in my lpc custom username color for groups, but when I add new group from plugin, I lost the old username color.How I can fix this problem without create a new plugin for chat?
They're both changing. One is betterhud and other is executableitems
Thanks š¤
Hello, do you know if there are any compatible plugins on Folia? Because there is a list on the page that says there are compatible plugins, but it doesn't work.
I already know the plugins comes from the bottom but its not walking
I have tried the plugins that they are on the page nothing works
Can you specify "nothing works"? What does that mean in your case
Additionally https://github.com/BlockhostOfficial/folia-plugins
Compatible plugins that are listed on the page does not work or block commands for example
that list annoys me
it is unmaintained and someone added some of my plugins there but the links are literally all wrong
i commited the correct links after someone told me about that and it never got merged š
Yeah, I've had that problem as well
But it's a decent start
I think we generally want to avoid people recommending random patches in this channel - especially patches from forks that have a lot of issues and unsafe/questionable stuff in them.
You yourself in the past have said that your margin for "safe" is different than others, so let's try to avoid recommending that kind of stuff here.
Someone asked about building Folia. Rpelying that it builds/run fine for you makes sense.
Saying "I have a bunch of non-Folia patches in my fork" makes sense.
Linking to a questionable fork does not make sense. Especially in the context of building / running Folia not forks of Folia.
Others would only experience this issue if they're using patches from that fork - which isn't software that's supported in this channel. If someone does have issues with that fork then they should seek to get support from whatever support forum that fork uses.
The issue you're linking to is closed, and has been for 2 weeks.
Honestly, I don't want a debate on this. Please stop linking random unsafe patches from random unsafe forks when in help channels.
will a ryzen 9 9700x (8 cores 16 threads) and 64 gb ddr5 be good to run an smp on folia with a player count of around 200?
The paper mc website says it recommended to have at least 16 cores but I just want to confirm it because there isnt much info
damn alright
Also make sure your use case fits Folia.
200 people widely spread out is fine. 200 people in one area is not.
So should I just use paper instead?
If your server doesn't fit within those requirements, yes.
alright thanks
[23:37:55] [Region Scheduler Thread #2/ERROR]: [io.papermc.paper.threadedregions.TickRegionScheduler] Region #-1 centered at chunk null in world 'null' failed to tick:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.orElseThrow(Optional.java:377) ~[?:?]
at io.papermc.paper.command.brigadier.MessageComponentSerializer.message(MessageComponentSerializer.java:23) ~[folia-api-1.21.6-R0.1-SNAPSHOT.jar:1.21.6-6-e4b0ae9]
at net.minecraft.commands.Commands.finishParsing(Commands.java:405) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.commands.Commands.performCommand(Commands.java:353) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.commands.Commands.performCommand(Commands.java:345) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.commands.Commands.performPrefixedCommand(Commands.java:336) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:435) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.threadedregions.RegionizedServer.globalTick(RegionizedServer.java:309) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.threadedregions.RegionizedServer$GlobalTickTickHandle.tickRegion(RegionizedServer.java:161) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418) ~[folia-1.21.6.jar:1.21.6-6-e4b0ae9]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:546) ~[concurrentutil-0.0.3.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
How do I prevent this error?
Sometimes, when you use the wrong command, it throws this error and shuts down.
How do I prevent the server from shutting down?
What's the full log? What command is causing the issue? From a plugin?
Why is the Folia scheduler only run 1 time per tick? Why not sooner
which one exactly
ellaborate. every scheduler that is not async scheduler will work on a tick basis
Because the entity and region schedulers are ticked in when the appropriate region they are in is ticked, which happens once per tick
speedvanilla just too good
<@&748618676189528155>
Gottem
I was wondering if anyone here has an estimate of how many players I could support on an AX42 server from hetzner, using folia, a pre generated 3.5k x 3.5k worldpainter map, and some lightweight custom plugins
You would use Folia for this.
Thatās far too small of a map.
But also: just like with Paper, it depends on the players, what theyāre doing, what plugins you have, your config, etc etc
Thereās no math for X CPU + Y RAM == Z player count
I see, so is folia not going to help much in my case, even though it still uses multiple regions?
When I ran /tps during testing, it showed/said that multiple regions were being used
Nether and end are disabled
If people were bunched up you might get a couple out of a world that size
Not for long I suspect
Players will be too close, and youāll end up with one region.
So, no, it wonāt help.
I see, so it will be the same as using paper then
If you end up with one region and the other dimensions disabled, then yeah
It would effectively be a Paper server.
With less plugin support and less API
Not without rewriting the server from scratch, more or less
And at that point I'd just thread the various phases of a tick instead of doing the region stuff
And if you did it would totally hose stuff if players could see each other and be in different regions.
Thereās a reason they merge when players get close.
Isn't that very dangerous
Not if you were writing the server from scratch with it in mind
But that wouldn't be Folia or Paper anymore so probably a discussion for #general
will there be a 1.21.8 folia?
there is
the website still shows 1.21.6 so I don't blame them
does spark currently work on folia?
it currently says their working on compatibility. Not sure if thats outdated or not.
wrd, thank you
there is one iirc but i donāt know how useful itāll be for you
with such a small map
the setting youāre looking for is grid-exponent
iirc you can change the region exponent
u can try setting it to 1 but yh, i assume paper would be better at this map size anyway
You can only shrink them to a certain point. This user already had their question answered two days ago. Pinging them again doesnāt really make any sense.
Should scheduling attribute additions and removals (in this case, we have a plugin that modifies the user's attributes if wearing a full set of X/Y/Z) be delayed by one tick instead of ran instantly?
We receive a quite rare crash report that looks something like this:
at it.unimi.dsi.fastutil.objects.ObjectOpenHashSet$SetIterator.next(ObjectOpenHashSet.java:575)
at net.minecraft.world.entity.LivingEntity.refreshDirtyAttributes(LivingEntity.java:1349)
at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3360)
at net.minecraft.world.entity.player.Player.tick(Player.java:324)
at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:1036)
at net.minecraft.server.players.PlayerList.remove(PlayerList.java:615)
at net.minecraft.server.players.PlayerList.remove(PlayerList.java:599)
at net.minecraft.server.network.ServerGamePacketListenerImpl.removePlayerFromWorld(ServerGamePacketListenerImpl.java:2245)
at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2221)
at net.minecraft.network.Connection.handleDisconnection(Connection.java:923)
at io.papermc.paper.threadedregions.RegionizedWorldData.tickConnections(RegionizedWorldData.java:567)
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1836)
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1626)
at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:452)
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:435)``` I corresponded the exception to `AttributeInstance` (since this is what the method modifies) and found that I do in fact already schedule the code; however, execute it instantly, instead of delaying it
Example code:
```java
public void removeAttributes(Player player) {
FreshPlugin.getInstance().scheduler().delayed(player, () -> {
for (Map.Entry<Attribute, AttributeModifier> entry : this.compiledAttributes.entrySet()) {
final Attribute attribute = entry.getKey();
final AttributeModifier modifier = entry.getValue();
if (attribute == null || modifier == null) continue;
final AttributeInstance instance = player.getAttribute(attribute);
if (instance != null) instance.removeModifier(modifier);
}
}, 1);
}```
We utilize a customary scheduling format which executes at the player, here .delayed(player, ()
when are you calling the removeAttributes? perhaps during player login / disconnect? also in your explanation you mention that you 'execute it instantly', whilst the code looks like it is actually scheduled into the future, which one is causing this problem?
because these disconnection related race conditions shouldnt really happen if youre on the player scheduler since itll be retired when the player disconncets
The only place removeAttributes is called is onUnequip (which is effectively scheduled) since the initial methid is:
public void onUnequip(@NotNull Player player, boolean full) {
this.removePotionEffects(player);
this.removeAttributes(player);
if (full) {
player.sendMessage(HexUtils.colour(this.props.unequipMessage()));
SetUtil.updateSetItemLores(player, this);
}
}```
Yeah and we pretty much handle this adequately, so it seems. This one is a little tricky to dive (deeper) into
what do you refer to with "effectively scheduled"?
ah, nevermind, i overlooked that removeattributes ends up scheduling it
Correct. I don't think any other plugins would considerably trigger this (given I reviewed all accessible source code I have and our resourcepack plugin is the most obvious contender)
So my last guess here is that this particular event (for whatever reason) needs a specified delay to prevent obscure race conditions. There could be a deeper issue but it doesn't entirely stand out
is your custom scheduler just a wrapper around the player scheduler?
Correct, yes
@NotNull
default ScheduledTask delayed(@NotNull Entity entity, @NotNull Runnable task, long delay, TimeUnit unit) {
return this.delayed(task, delay, unit);
}``` So it'd be this one
incase you havent found a fix for it by then, i can look into folia source tomorrow and see how this might potentially be caused
Ah sure that sounds good to me. This is pretty much the code that's triggered within source:
private void refreshDirtyAttributes() {
Set<AttributeInstance> attributesToUpdate = this.getAttributes().getAttributesToUpdate();
for (AttributeInstance attributeInstance : attributesToUpdate) {
this.onAttributeUpdated(attributeInstance.getAttribute());
}
attributesToUpdate.clear();
}```
i mean in regards to race conditions, i dont really see how this could even cause a race condition? the player being disconnected is handled on the region thats ticking it, the entity scheduler is running on the same thread thats responsible for ticking the region.. it seems kinda weird
im pretty sure that this is not caused by the code you provided. if your scheduler wrapper actually correctly schedules this on on the player scheduler, this cant happen. this is a concurrent modification on the attributesToUpdate. the stacktrace occurs whilst disconnecting, which is executed from the tickloop, meaning its defenetly on the players tickthread, the only real explanation for this would be that either your wrapper does not correctly schedule it (from what i saw, attribute modification doesnt do a tick thread check) or its caused by another plugin
I see. I guess I'll do some more diggin'
Could Folia theoretically be made to work across multiple machines? Mostly asking out of curiosity as I dont really have a use for that atm.
I wonder if 2B2T has also figured something out as I know they are a big user of folia
Ah ok
true
Donutsmp does this. They are running 50 servers iirc