Data Packs Game Mechanic

True XP Drop (Players drop all of their experience)

  • 13.8k views 0 today
  • save_alt 3k downloads
Compatibility
Minecraft 1.18
Changes include
  • Advancements
  • Functions
  • 78
  • 66
  • 14
Astrune
Lvl 65High Grandmaster Programmer
205
Players now drop all of their experience

You can change if the amount of experience they lost is announced in chat by changing the scoreboard objective astn for #announceXpLost
/scoreboard players set #announceXpLost astn 1 - on
/scoreboard players set #announceXpLost astn 0 - off

3 Update Logs

Update #3 : by Astrune 02/18/2022 6:02:24 pmFebruary 18, 2022 @ 11:02 pm UTC

November 14th, 2021

THIS IS NOW AN ALTERNATIVE TO THE FULL XP DROP DATAPACK
This datapack is now a much simpler version of the full xp data pack
Removed requirement for Astrune Library to function.
Removed command to check xp since it was mostly redundant.
Removed option to customize the percentage of xp that would drop because default xp dropping interferes with the calculation and a percentage other than 100% is unpopular.
Changed method of disabling xp death message to changing the scoreboard objective 'astn' for #announceXpLost
/scoreboard players set #announceXpLost astn 1 - creates message saying how much xp and levels a player lost when they die
/scoreboard players set #announceXpLost astn 0 - does not show any additional message about xp when a player dies
XP death message now only shows if the player had at least 1 xp
XP calculation system is now HIGHLY OPTIMIZED at the expense of not being able to work if xp is changed through commands or prior versions.
This means it will work perfectly in a normal vanilla world, but anything that changes xp (other than death and picking up orbs) through other data packs or plugins may cause issues.
THE DATA PACK WORKS BEST IN NEW WORLDS CREATED IN VERSIONS CLOSE TO 1.18 ISSUES MAY OCCUR IN OLDER WORLDS OR IF A PLAYER HAS XP BEFORE THE DATA PACK IS INSTALLED
XP scoreboard value (xp.txpd) now has a colored display name, so it can be put under player names and look good if desired
LOAD MORE LOGS

More like this

  Have something to say?

IndigoGollum
05/07/2022 5:21 pm
Level 12 : Journeyman Explorer
When I died with 38 levels I respawned and picked up 102 from my corpse. I had some of this before I installed the datapack.
drive.google.com/file/d/1_FLwGs7PqcifwB4qVWDO0BedCGjWZVPl/view?usp=drivesdk
1
pink_pariah
03/20/2022 2:04 pm
Level 44 : Master Princess
Unfortunate you removed the option to change the drop percent as that is exactly what I was looking for
1
Matustracas
09/10/2021 5:56 pm
Level 20 : Expert Cake
It works for 1.16? Pls ;-;
1
Dark_Matter1
01/04/2021 5:21 pm
Level 1 : New Miner
I downloaded this datapack and tested it out in a single player world along with the graves datapack from vanilla tweaks. When I died with levels over 150, it would not give me all my levels back. it gives maybe two thirds, i didnt do the exact math. Is this a bug? or is this something to do with the fact I have the graves datapack on?
1
Astrune
01/10/2021 11:12 am
Level 65 : High Grandmaster Programmer
I fixed the bug with xp not dropping correctly if over a certain level (102 to be exact). It should work now. As for the compatibility with the graves data pack, I have reached out to the creator for information on how the system works. If he doesnt respond, then I will have to try to understand it myself which could take a while.
1
Astrune
01/05/2021 5:05 pm
Level 65 : High Grandmaster Programmer
history
I tested it up to levels in the thousands and it worked fine, but it may have problems at specific values. It may also not work if you gained levels shortly before dying. The graves data pack could also be a factor. I have not worked on making it compatible yet.

EDIT: I fixed the level issue, the creator of the Graves data pack plans to release their own full xp drop data pack that is compatible
1
Barrie_and_Dave
12/27/2020 2:28 pm
Level 1 : New Miner
I LOVE THIS DATAPACK!

But the guys on my server think it is OP, is there a way to set it to 50% exp return???
1
Astrune
12/27/2020 10:11 pm
Level 65 : High Grandmaster Programmer
I am planning on adding a feature like this soon
2
EpicnicityWasTaken
12/18/2020 10:28 pm
Level 1 : New Miner
I play an SMP with my friends but I have the graves datapack on, I had 20 levels but when I took the stuff out of the grave, it only gave me the usual seven levels.
1
Astrune
12/19/2020 8:00 pm
Level 65 : High Grandmaster Programmer
I dont know how that data pack works and I have not made it compatible
1

Welcome