A Library for watching containers using a LootTable trick.
Download from releases and drop the .zip
file directly into your datapacks folder
Warning
May cause visual flickering of Items inside container.
Important
- This datapack works for
chest_minecart
andhopper_minecart
- Pack can watch upto 65535 containers at once.
- Run by the player when they open a watched container
- The UUID of opened container (in string form) is present in storage
senti:api uuid
during this function tag call, use a macro to reference it.
- Run by open watched containers that have a change in their contents
- Contents of previous tick in storage
senti:api old
- All players with the watched container open may be targetted by the tag
senti.viewer
during this function call
- Run by all Open watched containers every tick
- All players with the watched container open may be targetted by the tag
senti.viewer
during this function call. - This runs after
#senti:container/changed
in case a change happens.
- Run by the player who closed a watched container
- Run by the container after all players have closed it.
- Run by the server when it detects a player logging out while having a container open.
- Player's name available during this function call at storage
senti:api player.name
- Player's UUID (int form) available during this function call at storage
senti:api player.uuid
- Run by players, who logged out while having a container open, upon joining back.
Executing as the container, run the function below
execute as <container> run function senti:start
Executing as the watched container, run the function below
execute as <container> run function senti:stop
Important
Please use the stop watching function when you want to get rid of a container, so that it's ID can be recycled.