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
  • Capability doesn't save when I quit the world
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Mikkolek

Capability doesn't save when I quit the world

By Mikkolek, November 3, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Mikkolek    0

Mikkolek

Mikkolek    0

  • Tree Puncher
  • Mikkolek
  • Members
  • 0
  • 3 posts
Posted November 3, 2020 (edited)

If I understand capabilities correctly, their state is supposed to be saved when the world is quit and reload when it's open again, but in my case, the capability just resets to 0 when I reload the world. I've just started getting into modding, so I'm sorry if I made some really simple mistake, but I can't figure out what I'm doing wrong. I based my capability mainly on this tutorial from McJty: https://youtu.be/W3SS7yP4B2s and I also read the page about capabilities on the forge docs, but it seems to be quite outdated. You can find my test mod here: https://github.com/Mikkolek/TestCapabilitiesMod. I also made a simple command called "/devmode" to check the capabilities it's state and change it. 

Edited November 3, 2020 by Mikkolek
  • Quote

Share this post


Link to post
Share on other sites

vemerion    56

vemerion

vemerion    56

  • Creeper Killer
  • vemerion
  • Members
  • 56
  • 220 posts
Posted November 3, 2020
6 hours ago, Mikkolek said:

If I understand capabilities correctly, their state is supposed to be saved when the world is quit and reload when it's open again, but in my case, the capability just resets to 0 when I reload the world. I've just started getting into modding, so I'm sorry if I made some really simple mistake, but I can't figure out what I'm doing wrong. I based my capability mainly on this tutorial from McJty: https://youtu.be/W3SS7yP4B2s and I also read the page about capabilities on the forge docs, but it seems to be quite outdated. You can find my test mod here: https://github.com/Mikkolek/TestCapabilitiesMod. I also made a simple command called "/devmode" to check the capabilities it's state and change it. 

It looks like you are not correctly registering the capability. Add this:

FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init);

to the constructor of your main mod class.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

Mikkolek    0

Mikkolek

Mikkolek    0

  • Tree Puncher
  • Mikkolek
  • Members
  • 0
  • 3 posts
Posted November 3, 2020

Thank you so much, this fixed the problem! 

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



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • __dwagon
      Forge keeps crashing

      By __dwagon · Posted 56 minutes ago

      Hey im back with information that not only 1.8.9 is crashing but also 1.16 as well. I don't know what to do I have redownoaded minecraft, forge, and java multiple times and nothing seems to work. Please help
    • piglinplayz
      is there a malisis door mod for 1.16.3 or grage door mod for 1.16.3

      By piglinplayz · Posted 1 hour ago

      i can find the it ij just says no 1.12.2 no 1.16.3
    • loordgek
      is there a malisis door mod for 1.16.3 or grage door mod for 1.16.3

      By loordgek · Posted 1 hour ago

      no search for your self it is not hard
    • piglinplayz
      is there a malisis door mod for 1.16.3 or grage door mod for 1.16.3

      By piglinplayz · Posted 1 hour ago

      or may i have the link?????????????????????????????????????????????????? Plz i need a respond ASAP because i need it for a moded smp 
    • Silivek
      is there a malisis door mod for 1.16.3 or grage door mod for 1.16.3

      By Silivek · Posted 1 hour ago

      Macaw's Doors may have one and there is a mod called Little Tiles that you can create one in.
  • Topics

    • __dwagon
      0
      Forge keeps crashing

      By __dwagon
      Started 56 minutes ago

    • piglinplayz
      7
      is there a malisis door mod for 1.16.3 or grage door mod for 1.16.3

      By piglinplayz
      Started 2 hours ago

    • piglinplayz
      9
      How do update a 1.12.2 mod to 1.16.3

      By piglinplayz
      Started 3 hours ago

    • BeastGamerYo
      1
      Urgent Help Forge Is Crashing!!!

      By BeastGamerYo
      Started 2 hours ago

    • __dwagon
      1
      1.8.9 keeps crashing

      By __dwagon
      Started 3 hours ago

  • Who's Online (See full list)

    • TheidenHD
    • ThatBearQuen
    • Ronshark
    • Caffeinated Pinkie
    • Choonster
    • CookieLukas
    • Honestgamer
    • st4s1k
    • Asleep365
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Capability doesn't save when I quit the world
  • Theme

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