I need to create a temporary container (which won't exist in the world) and show it to a player. Looking at this plugin and disassembled code, I came up with this code
var container = new ItemContainer
{
entityOwner = player,
capacity = 1,
isServer = true,
allowedContents = ItemContainer.ContentsType.Generic
};
container.GiveUID();
timer.Once(0.5f, () => {
var loot = player.inventory.loot;
loot.Clear();
loot.PositionChecks = false;
loot.entitySource = player;
loot.itemSource = null;
loot.AddContainer(container);
loot.SendImmediate();
player.ClientRPCPlayer(null, player, "RPC_OpenLootPanel", "generic");
});It seems to be partially working: my inventory opens, "loot" area appears but then it is almost immediately replaced by quick craft. So how do I show it correctly?