The current hack to get on the `on_player_receive_fields` function is quite likely to break with instrumented code. This also changes the workaround to get custom inventory callbacks by using `minetest.override_item`.