Babatunde Posted November 28, 2020 Posted November 28, 2020 (edited) Hello Modders, Is there a way to get the number of deaths a player has from his statistics? MC version 1.15.2 I have been looking for a solution for hours but I cant find the answer. Edited November 28, 2020 by Babatunde Quote
Beethoven92 Posted November 28, 2020 Posted November 28, 2020 I think you can retrieve the player stats from ServerPlayerEntity#getStats. Note that in 1.15.2 the name of the method may not be the same. Take a look at the Stats class also Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
Babatunde Posted November 28, 2020 Author Posted November 28, 2020 You cant get the amount of deaths using the Stats class Quote
Beethoven92 Posted November 28, 2020 Posted November 28, 2020 59 minutes ago, Beethoven92 said: I think you can retrieve the player stats from ServerPlayerEntity#getStats Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
Babatunde Posted November 28, 2020 Author Posted November 28, 2020 I don't think there is a way to get the number of deaths with ServerPlayerEntity#getStats either Quote
Beethoven92 Posted November 28, 2020 Posted November 28, 2020 What makes you think that? Have you tried? Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
Babatunde Posted November 28, 2020 Author Posted November 28, 2020 Ye, I've tried everything I could think of and I have done hours of research. Quote
Sr_endi Posted November 28, 2020 Posted November 28, 2020 (edited) You can do: But this only works on logical Servers. int deaths = ServerWorld#getServer().getPlayerList().getPlayerStats(PlayerEntity).getValue(Stats.CUSTOM, Stats.DEATHS); Edited November 28, 2020 by Sr_endi Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.