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/1.15] Save List on player clientside
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Tupaç

[1.14/1.15] Save List on player clientside

By Tupaç, March 31, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Tupaç    0

Tupaç

Tupaç    0

  • Tree Puncher
  • Tupaç
  • Members
  • 0
  • 18 posts
Posted March 31, 2020

Hi, is it possible to save a resourceLocation List on the player (or similar) clientside? if so, how?

 

i have a gui with a list of names and i want to keep those names after the client is closed and open.

 

thanks

  • Quote

Share this post


Link to post
Share on other sites

DavidM    179

DavidM

DavidM    179

  • World Shaper
  • DavidM
  • Members
  • 179
  • 1821 posts
Posted March 31, 2020

You can write a file to disk. When you need it simply read the file.

Capabilities would also work, and would probably be a bit simpler to implement.

  • Quote

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Share this post


Link to post
Share on other sites

Animefan8888    741

Animefan8888

Animefan8888    741

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 741
  • 6157 posts
Posted March 31, 2020 (edited)
2 minutes ago, DavidM said:

Capabilities would also work, and would probably be a bit simpler to implement.

Capabilities wouldn't save the data if the mod is meant to be client side. At least not on dedicated servers. So @Tupaç is better off writing the file to disk themselves.

Edited March 31, 2020 by Animefan8888
  • Like 1
  • Quote

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Share this post


Link to post
Share on other sites

Tupaç    0

Tupaç

Tupaç    0

  • Tree Puncher
  • Tupaç
  • Members
  • 0
  • 18 posts
Posted March 31, 2020

Ah, i see. ok
is there a suggested method for saving data on disk? or you recommend anyone in special?

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    741

Animefan8888

Animefan8888    741

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 741
  • 6157 posts
Posted March 31, 2020
9 hours ago, Tupaç said:

Ah, i see. ok
is there a suggested method for saving data on disk? or you recommend anyone in special?

Either to a JSON file via the GSON library(good if you want to easily be able to read the data with your eyes) or using CompoundNBT and CompressedStreamTools.

  • Quote

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Maxi90909
      Forge 1.16.5 - 36.0.9 start up crash

      By Maxi90909 · Posted 13 minutes ago

      OK Thank you. I had 2 Random Patches datas in my mods folder.
    • matthyit
      my 1.16.5 modded game crashes after a while of playing

      By matthyit · Posted 13 minutes ago

      so i need to update java?
    • Luis_ST
      [1.16.5] Enchantments can Apply to all Tools

      By Luis_ST · Posted 17 minutes ago

      but eclipse say i have to set the cast
    • diesieben07
      [1.16.5] Enchantments can Apply to all Tools

      By diesieben07 · Posted 21 minutes ago

      Sure. Although you should not need that cast.   Actually. I looked again. No, that does not make sense. Why are you trying to cast the iterator.
    • Luis_ST
      [1.16.5] Enchantments can Apply to all Tools

      By Luis_ST · Posted 22 minutes ago

      than this while (enchantmentIterator.hasNext()) { Enchantment enchantment = (Enchantment) enchantmentIterator; if (!enchantment.isCompatibleWith(enchantmentIterator.next())) { enchantmentIterator.remove(); } }  
  • Topics

    • Maxi90909
      4
      Forge 1.16.5 - 36.0.9 start up crash

      By Maxi90909
      Started 1 hour ago

    • matthyit
      4
      my 1.16.5 modded game crashes after a while of playing

      By matthyit
      Started 2 hours ago

    • Luis_ST
      22
      [1.16.5] Enchantments can Apply to all Tools

      By Luis_ST
      Started Yesterday at 07:21 AM

    • Zockerbua
      1
      I need help

      By Zockerbua
      Started 52 minutes ago

    • domi0908
      6
      fix hitbox red baby mobs version forge

      By domi0908
      Started Tuesday at 03:04 PM

  • Who's Online (See full list)

    • Tavi007
    • ianiiaannn
    • domi0908
    • matthyit
    • Puma_MGP
    • xX_deadbush_Xx
    • Maxi90909
    • ozi
    • diesieben07
    • Ray99
    • Zemelua
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.14/1.15] Save List on player clientside
  • Theme

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