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.15.2] How to make an entity save data
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
someRandomKid

[1.15.2] How to make an entity save data

By someRandomKid, November 22, 2020 in Modder Support

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • Next
  • Page 2 of 2  

Recommended Posts

diesieben07    7583

diesieben07

diesieben07    7583

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7583
  • 54911 posts
Posted November 23, 2020
11 minutes ago, diesieben07 said:

ou must only only set data manager values on the server, currently you are doing it on both logical sides.

 

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 23, 2020 (edited)

So then how do I fix it?

So far I have fixed the tick function.

Edited November 23, 2020 by someRandomKid
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7583

diesieben07

diesieben07    7583

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7583
  • 54911 posts
Posted November 23, 2020
2 minutes ago, someRandomKid said:

So far I have fixed the tick function.

No, you have not. You are still setting the value in the data parameter on both logical sides.

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 23, 2020

then how would I do it server side?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7583

diesieben07

diesieben07    7583

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7583
  • 54911 posts
Posted November 23, 2020

https://mcforge.readthedocs.io/en/latest/concepts/sides/

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 23, 2020

so I would use if(!world.isRemote)?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7583

diesieben07

diesieben07    7583

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7583
  • 54911 posts
Posted November 23, 2020

Correct.

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 23, 2020

ok so I did that, now what?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7583

diesieben07

diesieben07    7583

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7583
  • 54911 posts
Posted November 23, 2020

If it still does not work, you need to post a Git repo of your mod so I can debug this locally.

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 23, 2020

I guess that's fine, I was planning on making this mod open-source anyway

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 23, 2020

the value is not updating anymore 

  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted November 30, 2020 (edited)

so after taking a break from modding (sorry for not responding!)

 

I finally figured out the problem. 

The problem is that this.movedDistance doesn't get updated on the server, but is getting updated on client.

How would I fix that?

 

EDIT:

The data manager can't get the correct value to sync because this.movedDistance only gets updated on client.

So I think I have to make a packet for this to all work.

Edited November 30, 2020 by someRandomKid
  • Quote

Share this post


Link to post
Share on other sites

someRandomKid    0

someRandomKid

someRandomKid    0

  • Tree Puncher
  • someRandomKid
  • Members
  • 0
  • 44 posts
Posted December 4, 2020

SOLVED:

instead of using this.movedDistance I used this.distanceWalkedModified and it works fine.

  • Quote

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • Next
  • Page 2 of 2  

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

    • Greenshark3D
      Minecraft forge server login problem

      By Greenshark3D · Posted just now

      I made a forge server (forge-1.16.5-36.0.0). The server starts but I can't login. I had a paper server befor on the same ip/port and it worked just fine. Server log: https://pastebin.com/yT9K9qms
    • XenoPyax
      GUI Button has weird image

      By XenoPyax · Posted 4 minutes ago

      Oh I see thanks!
    • cadbane86140
      Minecraft: An End of an Era!

      By cadbane86140 · Posted 34 minutes ago

      Hello there! We got 2 videos for you guys today and to start it out I talk about my thoughts on the hive shutting down, I never thought I would say that just because whenever I saw the hive I saw people on it but I explain it more in my video so I hope you all enjoy the video and if you did don’t forget to like and sub for more!  
    • Draco18s
      GUI Button has weird image

      By Draco18s · Posted 48 minutes ago

      Yeah, because you're passing in a height value that's 2.5 times taller than the vanilla Button renderer expects. It expects that all UI buttons are only 20 pixels tall and the sprite sheet reflects that. So what you're seeing is other areas of the UI sprite sheet.   (Is the vanilla code broken? Yes. Does Mojang care? No)
    • DaemonUmbra
      Any good exploration mods for 1.16.3?

      By DaemonUmbra · Posted 1 hour ago

      Why limit yourself to 1.16.3? Especially since 1.16.5 just came out and fixes crash bugs that could be abused to render a server unusuable.
  • Topics

    • Greenshark3D
      0
      Minecraft forge server login problem

      By Greenshark3D
      Started Just now

    • XenoPyax
      2
      GUI Button has weird image

      By XenoPyax
      Started 1 hour ago

    • cadbane86140
      0
      Minecraft: An End of an Era!

      By cadbane86140
      Started 35 minutes ago

    • PotatoEz1
      1
      Any good exploration mods for 1.16.3?

      By PotatoEz1
      Started 1 hour ago

    • DrakenXI
      3
      [1.16.4] setBlockState with out send update event.

      By DrakenXI
      Started 21 hours ago

  • Who's Online (See full list)

    • Dzuchun
    • Greenshark3D
    • XenoPyax
    • kiou.23
    • LadyZhen0606
    • JackRaidenPH
    • yoTazuna
    • Cyrus_Blaze
    • Pl00py_R
    • LexManos
    • MetalMetagross
    • Beethoven92
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2] How to make an entity save data
  • Theme

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