Show HN: Pumpkin – A Modern Minecraft server written in Rust

15 hours ago (github.com)

The performance differences look pretty impressive from the benchmarks. I do notice that world generation and saving features are missing though, and these tend to be pretty expensive operations. Chunk gen especially can bring a weaker VPS to its knees. I'm sure the benchmarks were taken at an idle state, but I'd be curious to see how it compares once those features are included and being used.

I don't see it listed, but is there support for block breaking/placing yet? Presumably this would require light recalculation and a chunk update on the server.

Finally, do you plan to add advanced features like scoreboard, teams, or command block parsing in general? Mojang has at least open-sourced Brigadier for that.

Cool project. Hope to see it mature to the point of making servers easier to run on low-end hardware.

  • Chunk gen makes sense to implement last or never. If you want a performant Minecraft server you need to pregen all the chunks anyway. You can still later regen chunks that have never been visited to get new chunkgen on updates since chunks store the inhabited time.

    I think Minecraft server re-implementations are pretty neat and I like to see when a new one comes out. There are also specific purpose server impls like MCHPRS for doing fast redstone compilation for technical minecraft.

  • Hey. Im impressed with the benchmarks myself tbh.

    Yep block placing and breaking is already supported, but light currently don't so everything is dark :/, We are working on it. Yep, We want to add all cool features like scoreboards, teams and we already have a API which is similar to use to Brigadier for our Commands.

    Thanks, I would love to give players on low-end hardware the possibility to host servers. I think i may test Pumpkin on a raspberry PI or something one day

    • I remember Notch talking about the lighting calculations being one of the hardest parts to program, so I can understand that being a challenge.

      Mojang made large improvements to the lighting engine in 1.20, bringing it in line with the performance mods Phosphor[1] and Starlight[2]. Despite being deprecated now, they might still offer some useful insight into how to approach such a system in a performant way. You'll need to be mindful of the licenses, but it's likely easier than reverse-engineering Minecraft (even with mappings).

      [1] https://github.com/CaffeineMC/phosphor-fabric

      [2] https://github.com/PaperMC/Starlight

      1 reply →

Are there any benchmarks for it? How much faster is it than a vanilla server?

I know Minecraft servers tend to get extremely resource intensive as the player count creep and people run extremely beefy servers to handle the load and still offer poor TPS.

As someone who knew about this project from earlier (I had even joined their discord) (currently have just deleted my discord account for better state of mind) Its really made me happy that hackernews really liked this project (140 upvotes is pretty good in my opinion)

From what I remember , there was one other server as well which also was written in rust but I am not exactly sure

Also , the last time I was at it , it was really really alpha software but it was getting developed at good rate , so I am not sure about its current state (I was there when the author had gone to take his exams IIRC)

  • Hi. Im so happy there are so many people liking the project, The Project is still pretty WIP but im really working hard on this, i finished my exmans last week and currently in holidays so commits are again back to normal :D

Hello. I recently developed Pumpkin, Its a efficent and fast Minecraft server completely written in Rust from the ground up, Check it out :D

  • Cool! Would be interesting to understand how to multithreading works? Is it just the "easy" parts or actual operations related to the world as well?

    • Currently Pumpkin has not much multi-threading but we want to go all in. There is already a good structure for multi-threading, We want to make everything multi-threaded what benefits from it

  • > What Pumpkin will not

    > Be a drop-in replacement for vanilla or other servers

    It seems to me that unless it's a drop-in replacement its not a Minecraft server? Akin to how say an Uno deck isn't a drop-in replacement for a Hearts deck but still both card games but not both Uno decks.

    Or is it just meaning that Pumpkin (besides the network) do things differently than vanilla and so you might not be able to open a vanilla created world using Pumpkin?

    • The common problem with Minecraft server implementations is that they are not bug-for-bug compatible, which will lead to certain techniques (especially redstone contraptions) breaking. The technical Minecraft community depends on many implementation details which not all servers support

      5 replies →

    • Minecraft has a lot of bugs or otherwise surprising behaviours that parts of the community have come to rely upon. This means that most non-vanilla minecraft servers aren't 100% drop in replacements. You have to make a decision what behaviours you want vs the performance and simplicity gains you will gain.

      For example there there are tricks that allow you to delete bedrock blocks. Which then lets you either get onto the roof of the nether, or drop below the bottom of the world. Not all of these tricks will then work depending upon the specific minecraft server.

      Another example is that in vanilla you can "bomb" people with experience orbs, the sheer number of orbs on the screen will grind their game to a halt since there are too many objects to track and render. Some minecraft servers work around this by grouping up experience orbs into a single bigger orb. That way you have fewer orbs on screen at once.

      1 reply →

Are you sharding the main thread into regions (ie. Like paper folia) or is this just breaking of non block-entities to their own threads.

I will give it a try, Thanks for this project. The performance of pure vanilla server jar is so bad. Thats one thing I wish mojang would improve. I know new chunk generation is multithread at least. I also wish they'd officially support some basic control for SMP servers. Something as basic as areas defined by two corner coordinates and basic permissions like place, break, interact. Just a basic config file is fine I can manage the requests/updates ot it using other tools - or a simple commandline utilities in game to ops. Something that lets me not have to always only use an excluse whitelist. I know Paper/waterfall and the others have plugsins for this but theres just something nice about staying pure vanilla. Ive been keep servers alive for a long time now.

Just waiting for Minecraft to be so reverse engineered as to be its own protocol with multiple server and client implementations that just work.

  • it already is, the entire protocol is reverse engineered, there are tools to automatically deobfuscate the code and there is already a full reimplementation of minecraft that also supports servers

    • If that's the case, how come nobody seems to be writing improved Minecraft clients?

      Ever since I started playing it in the beta days I've been frustrated with how poorly Minecraft performs relative to what it's showing on the screen. (Not that that stopped me from pouring hundreds of hours into the damn thing.)

      1 reply →

What does "modern" mean in this context?

  • "Modern" seems to be used a loose adjective these days for "I rewrote $thing [in Rust]". Minecraft was created in 2011, and is Wikipedia says the last version of the 'classic' edition was released in 2017. So anything after 2017 is now defunct.

    I don't mind people rewriting things in <insert-name-of-tech-I-like> but "modern" as a value seems pretty loose, and it's often at least arguable whether it's objectively better!

    • > "modern" as a value seems pretty loose, and it's often at least arguable whether it's objectively better!

      Well, there is research on this!

      https://security.googleblog.com/2024/09/eliminating-memory-s... writes:

      > vulnerabilities decay exponentially. They have a half-life. [...] A large-scale study of vulnerability lifetimes² published in 2022 in Usenix Security confirmed this phenomenon. Researchers found that the vast majority of vulnerabilities reside in new or recently modified code

      Where ² goes to https://www.usenix.org/conference/usenixsecurity22/presentat...

      A study limitation is that they looked only at security-relevant bugs (vulnerabilities). As someone who writes code, I would tend to think that this also goes for bugs without a direct security impact, but I don't have the data to back that notion up

      1 reply →

    • “Modern” more usually means some new JavaScript thing. In JS land, they consider anything that hasn’t had a commit on main branch in over 3 days to be a dead old project in need of being replaced with something new and “modern” that is up to date with the latest trends and breaking changes from the previous 24 hours of their world.

      Usually the hyperbolic superlative for Rust projects is “blazing fast”. Of course, any kind of benchmarks or comparisons with other implementations are completely optional. It is simply enough to “cargo init” and start hammering out code. You don’t even need to consider the characteristics of the algorithms you choose to use! If it’s Rust, it’s “blazing fast”.

      5 replies →

    • Sorry, I may should not used the term Modern, Lets say the foundation is newer and more optimized than from the Original Minecraft server. Mojang developers have strict deadlines and do not care about performance (like basicly any big Studio today). This results in bad ugly code which only purpose it is to work nothing more. Minecraft was created 2009 btw

      2 replies →

  • Its written from the ground up and has a clean foundation (which is not the case in vanilla minecraft server code). We also want to use cool modern features like multi-threading or the rust language which is a modern language designed to fix mistakes from older languages

It has now been 0 days since a new minecraft server was written in Rust https://dayssincelastrustmcserver.com/

  • Hilarious site but a little unjustified. Out of those, only Valence is a real "this already exists" argument. There's 7 total and the first 3 are dead and the latest 3 (incl pumpkin) are all 2024. And all of the 2024 ones explicitly differentiate themselves from Valence which is more of a framework that focuses on modularity. These latest 3 all look like healthy competitors that are all amicable towards each other

      |          | released | stars | last_update |
      |----------|----------|-------|-------------|
      | feather  | 19aug    | 2,614 | 2 years ago |
      | mchprs   | 20jun    | 1,632 | last month  |
      | graphite | 22jun    | 160   | 2 years ago |
      | valence  | 22sep    | 2,731 | 3 days ago  |
      | hyperion | 24mar    | 361   | today       |
      | pumpkin  | 24jul    | 965   | today       |
      | ferrumc  | 24sep    | 673   | today       |

  • It's pretty funny how many of these are "Is it a Minecraft server? No. It's a framework with which you can build your own rewrite of Minecraft server."

  • Lmao it is funny how we have daysinceX websites. is there a list of all such websites of daysinceXofY like dayssincelatestframeworkofnode I guess?

See also https://github.com/valence-rs/valence A "clean room" implementation of the Minecraft server written in Rust

  • Hi, Valence is a framework (similar to Minestom in Java). You have to build everything you self. Pumpkin is not a framework :D. Also Valence is bit unactive (look commits)

    • That's why I said "clean room implementation". Any reason why Pumpkin does not build on top of Valence? Would be great to see a more cohesive ecosystem for Minecraft servers in the rust community rather than reinventing the wheel

Just to be clear this sever only works with the current vanilla version of Minecraft? I've been interested in playing again, but on the older Beta builds (1.7.3) prior to the full release versions. These versions aren't supported are they?

Love the idea. Especially as a learning example. Always fun to learn a language by implementing a popular game.

Am confused by these two lines. Maybe it is just difference between the 'goal' and the 'current state'.

Goal:

"Compatibility: Supports the latest Minecraft server version and adheres to vanilla game mechanics. "

But NOT:

"Be a drop-in replacement for vanilla or other servers "

Will it be a replacement for Vanilla or not?

  • Compatibility: refers to the ability for client of the latest mincraft server version to be able to connect to the server (pumpkin) unmodified with all mechanics working.

    Drop-in replacement: refer to the ability of a server operator to simply exchange the current installation/executable of the server (be vanilla, paper, cuberite, etc...) for pumpkin while maintaining data, configuration, scripts and mods installed.

    edit: grammar

    • Tell you the truth, that doesn't help clarify to me much.

      If it is compatible, then can't I 'drop it in'.

      They sound like they are saying the same thing.

      It is compatible so clients can connect to the server and be fully operational, and thus, I should be able to drop in this server, and use it as a server?

      How can it be compatible if it doesn't maintain data, configuration, etc..

      Edit: or is this about Pumpkin files. Pumpkin will maintain it's own files, data, configuration. So it can't just use existing Minecraft data files.

      So if it was a new world, Pumpkin would generate new pumpkin formatted files. But couldn't just 'drop it in' on an existing world and use the existing Minecraft data files.

      Not sure of long term viability as far as effort, but if it is files, couldn't a converter from MineCraft to Pumpkin file structure, make the server 'drop in'?

      12 replies →

  • Hey, With Compatibility i mean be compatible with existing Minecraft vanilla client's and also use vanilla logic. With "Be a drop-in replacement for vanilla or other servers" i mean that if you just replace the existing server file with pumpkin, pumpkin will not load configs/plugins from vanilla/other servers

    • > i mean that if you just replace the existing server file with pumpkin, pumpkin will not load configs/plugins from vanilla/other servers

      Will it ever though? Is this a goal?

i wish minecraft was open source, i'd be able to fix their inefficient protocol

  • Downvoter, go check this: https://wiki.vg/Protocol, let me know if that's a good way to sync a lot of fast moving entities across a TCP network

    This is why people struggle with their servers, not because the game was written in java

    • Huh, if this exists and there’s already so many servers, maybe I should build a client instead.

    • Basically any significant Java software uses disproportionate amounts of RAM. My server can easily run a web server, database server, ftp server, memory cache, etc., times a few copies because various containers have their own web server or whatnot, all at the same time. But a single copy of Minecraft is too much, even when everything else is shut down.

      That's why I struggle with the server: it's written in Java. Other game servers don't seem to have this problem. If the network protocol were all, that'd be great

      (I didn't downvote any of your posts in case you now wonder if that was me)

    • Curious what protocol you would use, or how you would do it differently? Are there small enhancements to the existing protocol you would do? Genuine open question for the sake of learning.

      1 reply →