Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Player Statistics
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
Babatunde

Player Statistics

By Babatunde, November 28, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Babatunde    0

Babatunde

Babatunde    0

  • Tree Puncher
  • Babatunde
  • Members
  • 0
  • 15 posts
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

Share this post


Link to post
Share on other sites

Beethoven92    69

Beethoven92

Beethoven92    69

  • Dragon Slayer
  • Beethoven92
  • Members
  • 69
  • 560 posts
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

A little fun project: https://www.curseforge.com/minecraft/mc-mods/two-players-one-horse

Share this post


Link to post
Share on other sites

Babatunde    0

Babatunde

Babatunde    0

  • Tree Puncher
  • Babatunde
  • Members
  • 0
  • 15 posts
Posted November 28, 2020

You cant get the amount of deaths using the Stats class :(

  • Quote

Share this post


Link to post
Share on other sites

Beethoven92    69

Beethoven92

Beethoven92    69

  • Dragon Slayer
  • Beethoven92
  • Members
  • 69
  • 560 posts
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

A little fun project: https://www.curseforge.com/minecraft/mc-mods/two-players-one-horse

Share this post


Link to post
Share on other sites

Babatunde    0

Babatunde

Babatunde    0

  • Tree Puncher
  • Babatunde
  • Members
  • 0
  • 15 posts
Posted November 28, 2020

I don't think there is a way to get the number of deaths with ServerPlayerEntity#getStats either :(

  • Quote

Share this post


Link to post
Share on other sites

Beethoven92    69

Beethoven92

Beethoven92    69

  • Dragon Slayer
  • Beethoven92
  • Members
  • 69
  • 560 posts
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

A little fun project: https://www.curseforge.com/minecraft/mc-mods/two-players-one-horse

Share this post


Link to post
Share on other sites

Babatunde    0

Babatunde

Babatunde    0

  • Tree Puncher
  • Babatunde
  • Members
  • 0
  • 15 posts
Posted November 28, 2020

Ye, I've tried everything I could think of and I have done hours of research.

  • Quote

Share this post


Link to post
Share on other sites

Sr_endi    0

Sr_endi

Sr_endi    0

  • Tree Puncher
  • Sr_endi
  • Members
  • 0
  • 13 posts
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      My modpack takes years to load

      By diesieben07 · Posted 3 minutes ago

      Post the debug.log.
    • diesieben07
      [1.16.4] Custom item enchantability

      By diesieben07 · Posted 4 minutes ago

      A better way would be to use a Set (probably ImmutableSet in this case).
    • AzizD
      [1.16.4] Custom item enchantability

      By AzizD · Posted 22 minutes ago

      @Override public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { Enchantment[] enchantments = { Enchantments.SHARPNESS, Enchantments.LOOTING, Enchantments.FIRE_ASPECT, Enchantments.UNBREAKING, Enchantments.KNOCKBACK, Enchantments.MENDING, }; for(int i=0;i<enchantments.length;i++){ if(enchantments[i] == enchantment){ return true; } } return false; }   I wrote this and it worked. Thx.
    • BBoi69
      My modpack takes years to load

      By BBoi69 · Posted 46 minutes ago

      So i wanted to play ATM6, but cuz my laptop cant handle all that, i made my Lite version with like half the mods. it ran a couple times already but then i decided to add just one more mod and now, it takes 7 years to load up. The nether background and MOJANG STUDIOS text is there and the white bar is about 8/10 full and it goes fast until that. the numbers in the left corner are moving digit by digit and it has been like this for the last hour. yes i restarted it already.
    • AGENTO_PATENTO
      (1.16.4) Avalon, The Ragnarok is Here mod help.

      By AGENTO_PATENTO · Posted 1 hour ago

      Cześć gdzie moge owy mod  POBRAĆ    
  • Topics

    • BBoi69
      1
      My modpack takes years to load

      By BBoi69
      Started 46 minutes ago

    • AzizD
      6
      [1.16.4] Custom item enchantability

      By AzizD
      Started 11 hours ago

    • SixSix
      1
      (1.16.4) Avalon, The Ragnarok is Here mod help.

      By SixSix
      Started December 24, 2020

    • Luis_ST
      6
      [1.16.5] Help with custom Glass Block

      By Luis_ST
      Started Friday at 07:35 AM

    • awkx
      0
      Server can't keep up - good hardware, 2 players

      By awkx
      Started 2 hours ago

  • Who's Online (See full list)

    • diesieben07
    • kiou.23
    • AzizD
    • Choonster
    • Nitrix
    • BBoi69
    • MrLoop95
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Player Statistics
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community