Traveler's Backpack

Traveler's Backpack

39M Downloads

Mod compatibility question

thepwrtank18 opened this issue ยท 1 comments

commented

I'm making a mod that changes how keepInventory works - when you die, you lose a percent of durability on all of your items, determined by a gamerule. Is there an official way to interface with Traveler's Backpack so I can take the durability of the items in the backpack too?

Here's the source code for it: https://github.com/thepwrtank18/keepsomeinventory

commented

You should be able to access backpack via
CapabilityUtils#getBackpackWrapper
then you can use BackpackWrapper#getStorage and BackpackWrapper#getTools to access all items and tools inside backpack.

Make sure to access this in right moment before player dies so the backpack will still be equipped