Jump to content

Reduce durability in chest


Maisteri

Recommended Posts

I was wondering if it would be possible to reduce item durability when its placed in a chest. For example food would get molden after a certain amount of time. But would it be difficult to reduce the durability while the chunk where the chest is isn't loaded? If it is I would like to know how could you detect the moment when you place an item in a chest and then reduce it's durability instantly.

Thanks in advance!

Link to comment
Share on other sites

1. You either would need to access the onTick method for the chest tileentity (which wouldn't work unless you explicit tell it that it should tick) and thus make base-edits (very bad) or make a coremod (complicated) or make a TickHandler, search for all chests, read their content, check for your items and reduce durabillity, but this is a HUGE performance eater!

2. Problem with all those methods is that the chunks need to be loaded in order to have the chests tick / search for them. You could force chunks to stay loaded, but again that would result in a HUGE performance decrease.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

All in all:

 

Bad all around.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.