I used this code for my backpack when I was looking for light values and it works fine.
instead of you patching. You can do this. <3
private void OnLevelFinalize()
{
try
{
BackPack = Capi?.World?.Player?.InventoryManager.GetOwnInventory(GlobalConstants.backpackInvClassName);
BackPack?.SlotModified += BackPack_SlotModified;
}
catch
{
// just keep on
}
}
public void BackPack_SlotModified(int slotid)
{
var itemstack = BackPack?[slotid]?.Itemstack;
if (itemstack != null)
{
if (itemstack.Collectible is ItemEGlider || itemstack.Collectible is ItemGlider)
{
//Do something here
}
}
}
I used this code for my backpack when I was looking for light values and it works fine.
instead of you patching. You can do this. <3