Minecraft Data Packs / Other

Parchment - A PaperMC Detection Library

  • check_circle Functions
  • 1,970 views, 2 today
  • 48 downloads, 0 today
  • 17
  • 14
  • 14
FighterX9's Avatar FighterX9
Level 10 : Journeyman Goblin
3
Parchment is currently an Early Release! If you face any issues or want changes, feel free to leave a comment about them

Parchment is a datapack library that aims to detect if the pack is being run on PaperMC upon load

PaperMC has proven annoying for many large datapacks as its various tweaks and changes to how minecraft works may break various mechanics they rely on. Things such as not allowing non-player entities on scoreboards and removing empty teams are enabled by default and end up ruining various datapacks that take advantage of them. Parchment aims to warn users about these issues incase they risk incompatibilities when running Paper


To implement the Parchment Library, all you need to do is drag the parchment folder and the minecraft folder from Parchment into your own datapack. From there you can configure it using the guide below:


Configuring Parchment
Adding your Own Functions/Messages: You can change the functions run by adding your own in the detected.json and undetected.json tag files located in data/parchment/tags/functions/...

Sample functions for using Parchment have been provided in data/example/functions/...

Removing Parchment's Sample files: It's recommended that you remove the Sample files from the Tag lists and have your own Functions run instead. They are only examples, and if multiple packs change them they may conflict.

I'm rather new to making datapacks, this being my first public one. If there's anything that goes wrong or should be changed, I'll try to do my best to fix it.

There's no need to give Credit if you use this Library, though it would be much appreciated!


Special Thanks to:
Hashs, mmmeh, 'Biscuits', hhumanoid, the Minecraft Commands Discord, the Datapack Center Discord and the rest of the TCC Discord for greatly helping out with making the datapack
Also to Stoupy51 and Luish54 for having identified and having provided fixes for various issues
CompatibilityMinecraft 1.18
toMinecraft 1.19
Tags

6 Update Logs

Parchment v0.2.3 : by FighterX9 07/24/2022 9:56:07 pmJul 24th, 2022

Literally just changed the mcmeta version from 9 to 10. That's it
I TOOK 2 MONTHS TO CHANGE A SINGLE NUMBER
LOAD MORE LOGS

Create an account or sign in to comment.

2
05/24/2022 6:20 pm
Level 44 : Master Engineer
Luish54
Luish54's Avatar
I've been working to try to integrate the library into my data packs, but there's a problem: If multiple installed data packs have the paper_detect function modified differently, Minecraft will only process the function of the last data pack to be loaded (the first in the list of the world's data packs). I would recommend removing the commands from the messages and doing what I said below, and I would also recommend adding an example:paper_detected function as an example for developers of how to use the tag, and you should prohibit developers from integrating it into their data pack from modifying the functions. 😉

Once again sorry for my english.
2
05/25/2022 2:05 am
Level 10 : Journeyman Goblin
FighterX9
FighterX9's Avatar
That's a good point and an excellent idea. I hope you'll be happy with the implementation in the next update

btw your English is great and I feel you made it really easy to understand what to do

If anything needs to be changed or just isn't up to par with what it should be, just let me know and I'll be happy to change it
2
05/25/2022 8:33 pm
Level 44 : Master Engineer
Luish54
Luish54's Avatar
And another suggestion, I would recommend placing the functions parchment:example/... to example:... (to a separate folder), so that we only have to copy the parchment folder and paste it into the data pack without removing anything, only editing the tags. You should also add "replace": false to the tags to avoid future inconveniences of compatibility with multiple data packs.
2
05/25/2022 8:19 pm
Level 44 : Master Engineer
Luish54
Luish54's Avatar
I found a bug: When starting the server it will always be detected as if you were not using Paper, because at the time of running the function no player is connected and the marker cannot be spawned.

Edit: Here is the solution. I changed the second line (the first command) with these three:
execute store success storage parchment:store forceloaded int 1 run forceload query 0 0
execute unless data storage parchment:store {forceloaded:1} run forceload add 0 0
summon minecraft:marker 0 0 0 {Tags:["parchment.spawn"]}

...and after the command that kills the marker I put this:execute unless data storage parchment:store {forceloaded:1} run forceload remove 0 0
I guess this will fix it. 😉👍
1
05/31/2022 12:43 am
Level 10 : Journeyman Goblin
FighterX9
FighterX9's Avatar
A solution (hopefully) has been found! As world-spawn chunks are always loaded, summoning a Marker there lets detection run even players are offline

This may cause incompatibilities with mods that disable spawn chunks, however. I think ksyxis and even Optifine's Smooth world may break it, so I might have to do something about that...
2
05/26/2022 2:16 am
Level 10 : Journeyman Goblin
FighterX9
FighterX9's Avatar
I actually knew of this bug beforehand, but didn't know you could actually Forceload chunks. That's why I ended up sending the marker to a player to make sure it was in a Loaded chunk.

The solution you provided is a really good one and I want to thank you alot for it. However, I ended up coming across 2 Issues: During my testing I realized that 1) Loading a Fresh server up with the datapack usually didn't work, and 2): Forcing Chunks to load can cause Incredible lag spikes

The First problem was solved by Scheduling the command several seconds ahead instead of 45ticks (big leap, i know). But the Second problem caused up to 10 seconds of no response from Aternos servers, which I don't think is drawback worth taking.

I'm currently thinking of a workaround to this (Something like running the original function off of someone when they join the server, which despite not running at the start of the server, would still give the message without much lag)
3
05/24/2022 12:41 pm
Level 44 : Master Engineer
Luish54
Luish54's Avatar
Very good and original idea! But, for better compatibility between data packs and better accessibility, could you have a function tag run when detecting Paper? (such as #parchment:detected) so we could add functions to that tag to disable specific areas of our data packs that have problems with Paper.

Sorry for my english.
2
05/19/2022 5:48 pm
Level 36 : Artisan Engineer
kaimedina
kaimedina's Avatar
Great idea!!
2
05/19/2022 9:28 am
Level 28 : Expert Modder
osfanbuff63
osfanbuff63's Avatar
Since this is a library, am I allowed to modify this so that, instead of telling a player, using a workaround for Paper servers?
1
05/19/2022 11:17 am
Level 10 : Journeyman Goblin
FighterX9
FighterX9's Avatar
I have absolutely no idea what that meant, but you are definitely allowed to modify this to your heart's content!
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome