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
  • Container in Item
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
frankiecav

Container in Item

By frankiecav, August 5, 2020 in Modder Support

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

Recommended Posts

frankiecav    3

frankiecav

frankiecav    3

  • Tree Puncher
  • frankiecav
  • Members
  • 3
  • 36 posts
Posted August 6, 2020

except... it did. the sheath was able to hold an item and worked as expected.

  • Quote

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1798 posts
Posted August 6, 2020

what you are doing there is creating a new ItemStackHandler that is not on the item

  • Quote

Share this post


Link to post
Share on other sites

frankiecav    3

frankiecav

frankiecav    3

  • Tree Puncher
  • frankiecav
  • Members
  • 3
  • 36 posts
Posted August 6, 2020

I realize that, but you know what:

That constructor is only used for registering the container. The ItemStackHandler doesn't do anything except fill out the super because of the second constructor, the one which I use.

That's how I understand it, anyway.

Thanks for your help, and everyone on the thread.

One more thing, before you leave:

If I wanted to make this item switch textures depending on what was in it, any advice? I should be able to tackle this one on my own, but since I have you on the thread...

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7610

diesieben07

diesieben07    7610

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7610
  • 55159 posts
Posted August 7, 2020
10 hours ago, frankiecav said:

If I wanted to make this item switch textures depending on what was in it, any advice? I should be able to tackle this one on my own, but since I have you on the thread...

Look at how the bow or compass change texture (look for IItemPropertyGetter and where it is used and look at their respective model json files).

 

Note also that this will now require you to send your inventory to the client (or rather you'd have to send the data about which texture to show). You can do this via getShareTag and readShareTag in your Item class. Note that these are hard to use, read the JavaDocs carefully. Also note that for this problem to show up you need to be on a dedicated server, because single player networking uses some clever hacks that make this problem not appear.

  • Quote

Share this post


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

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

    • Arthurmeade12
      Error Conecting to My Minecraft Server

      By Arthurmeade12 · Posted 36 minutes ago

      My minecraft server and client start up normally with the same forge version, the same mods, and the same wi-fi. When I connect to my server it gives me an error about NBT tags. I have no Idea how to fix this error. Thank you for the help!   Latest and Debug logs for both client and server are attached.  client-debug.log client-latest.log server-debug.log server-latest.log
    • poopoodice
      [1.16.5] GameOverlay

      By poopoodice · Posted 53 minutes ago

      Last time I checked is still there, AbstractGui.fill()
    • Draco18s
      [1.16.4] Why recipe result calculated on server side?

      By Draco18s · Posted 1 hour ago

      The server would have to do all the same calculations the client did in order to approve.
    • Arthurmeade12
      Forge Server

      By Arthurmeade12 · Posted 1 hour ago

      I am running my forge server on MacOS Catalina. Will it work correctly if I update to MacOS Big Sur? Thanks!
    • Woodside
      [SOLVED][1.15.2]ServerWorld.spawnParticle excluding specific player

      By Woodside · Posted 1 hour ago

      Oop, I was looking at sendPacketWithinDistance. I didn't realize I could grab the list of players and send each one a packet on a whim. I misunderstood the code at first!
  • Topics

    • Arthurmeade12
      0
      Error Conecting to My Minecraft Server

      By Arthurmeade12
      Started 37 minutes ago

    • Luis_ST
      3
      [1.16.5] GameOverlay

      By Luis_ST
      Started Yesterday at 12:21 PM

    • S-Spirit
      5
      [1.16.4] Why recipe result calculated on server side?

      By S-Spirit
      Started Yesterday at 09:43 PM

    • Arthurmeade12
      0
      Forge Server

      By Arthurmeade12
      Started 1 hour ago

    • Woodside
      4
      [SOLVED][1.15.2]ServerWorld.spawnParticle excluding specific player

      By Woodside
      Started 17 hours ago

  • Who's Online (See full list)

    • st4s1k
    • AzizD
    • FloweyTF
    • IPSZ
    • UltramoxX
    • loordgek
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Container in Item
  • Theme

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