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
  • [1.14.4] What is the best way of saving data on player?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
Babatunde

[1.14.4] What is the best way of saving data on player?

By Babatunde, January 9 in Modder Support

  • Start new topic

Recommended Posts

Babatunde    0

Babatunde

Babatunde    0

  • Tree Puncher
  • Babatunde
  • Members
  • 0
  • 15 posts
Posted January 9

Hi Modders, 

 

I'm working on a mod where a player starts with 1 heart and every time they die they gain a heart until they have 10 hearts.

 

But I struggling with how I save the amount a hearts the player has. If I put it in the player data, it will be deleted when the player dies. Same goes for capabilities.

I've tried it with a Hashmap but I know its not the best way of doing thing so I'd like some feedback from you guys. 

 

Thanks.

Share this post


Link to post
Share on other sites

diesieben07    7597

diesieben07

diesieben07    7597

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7597
  • 55128 posts
Posted January 9

1.14 is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Method to get the current durability?

      By diesieben07 · Posted 15 minutes ago

      ItemStack#getDamage
    • diesieben07
      [1.16.4] what difference between custom slots and EquipmentSlotType

      By diesieben07 · Posted 16 minutes ago

      You can use RangedWrapper to expose only a range of another IItemHandler.
    • diesieben07
      Minecraft.getMinecraft().thePlayer.swingItem(); wont attack

      By diesieben07 · Posted 18 minutes ago

      1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • diesieben07
      [1.16.4] License Issue..

      By diesieben07 · Posted 18 minutes ago

      The license property is a top level property, not one of the [[mods]] object.
    • diesieben07
      [1.16.4] How do I correctly sync capability data between Client and server?

      By diesieben07 · Posted 19 minutes ago

      Your serializeNBT method is completely broken, it keeps overwriting the same data every loop iteration.
  • Topics

    • Dr.Nickenstein
      1
      Method to get the current durability?

      By Dr.Nickenstein
      Started 1 hour ago

    • Klarks
      33
      [1.16.4] what difference between custom slots and EquipmentSlotType

      By Klarks
      Started Thursday at 06:22 AM

    • Gubipe
      3
      Minecraft.getMinecraft().thePlayer.swingItem(); wont attack

      By Gubipe
      Started 9 hours ago

    • TurtlesAreHot
      4
      [1.16.4] License Issue..

      By TurtlesAreHot
      Started 10 hours ago

    • LK1905
      26
      [1.16.4] How do I correctly sync capability data between Client and server?

      By LK1905
      Started December 31, 2020

  • Who's Online (See full list)

    • Novârch
    • LK1905
    • GhostSHAURMA
    • Choonster
    • diesieben07
    • P0SCH1T0
    • replayen
    • Klarks
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.14.4] What is the best way of saving data on player?
  • Theme

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