promotional bannermobile promotional banner

ContainerFix

ContainerFix fixes a common issue with Containers not closing properly

ContainerFix fixes a common issue with many mods that doesn't close

the Gui of a Container, even if that container is destroyed or removed somehow.

 

 

This mod is supposed to be used in conjunction with other mods.

This bug was discovered by Darkosto.

 

For modders:

If you want to fix this issue for your mod, override Container#canInteractWith. In there, you would do a check if the TileEntity of the container still exists in the world, and if the player is close enough to the Block. This would mimic vanilla behavior.

 

Example:

@Override
public boolean canInteractWith(EntityPlayer player)
{
return te.world.getTileEntity(te.getPos()) == te && player.getDistanceSq(te.pos.add(0.5, 0.5, 0.5)) <= 64;
}

 

The ContainerFix Team

profile avatar
Owner
  • 387
    Followers
  • 29
    Projects
  • 279.5M
    Downloads

More from TschippView all

  • Carry On project image

    Carry On

    • 195.7M
    • Mods

    Carry On allows you to pick up Tile Entities and Mobs and carry them around!

    • 195.7M
    • December 27, 2025
    • Mods
    • +1
  • Fakename project image

    Fakename

    • 1.1M
    • Mods

    Fakename adds Commands to change the display name

    • 1.1M
    • May 3, 2025
    • Mods
  • fakename-port project image

    fakename-port

    • 73.7K
    • Mods

    Fakename adds a simple way to change your Display name ingame.

    • 73.7K
    • November 28, 2024
    • Mods
    • +1
  • Callable Horses project image

    Callable Horses

    • 25.2M
    • Mods

    Callable Horses allows players to call their horse from anywhere, like in popular RPG games

    • 25.2M
    • August 30, 2023
    • Mods
  • Carry On project image

    Carry On

    • 195.7M
    • Mods

    Carry On allows you to pick up Tile Entities and Mobs and carry them around!

    • 195.7M
    • December 27, 2025
    • Mods
    • +1
  • Fakename project image

    Fakename

    • 1.1M
    • Mods

    Fakename adds Commands to change the display name

    • 1.1M
    • May 3, 2025
    • Mods
  • fakename-port project image

    fakename-port

    • 73.7K
    • Mods

    Fakename adds a simple way to change your Display name ingame.

    • 73.7K
    • November 28, 2024
    • Mods
    • +1
  • Callable Horses project image

    Callable Horses

    • 25.2M
    • Mods

    Callable Horses allows players to call their horse from anywhere, like in popular RPG games

    • 25.2M
    • August 30, 2023
    • Mods