How about using some sort of callback?
I'm not sure how practical this is, but it would work with Lua
Code:
main()
{
UseBlockEntity( OpenChest, x, y, z );
}
void OpenChest( cBlockEntity* a_Entity, cPlayer* a_UsedBy )
{
Bla b = a_Entity->GetBla();
a_UsedBy->DoStuffWithBla( b );
}
I'm not sure how practical this is, but it would work with Lua