One of my core plugins prevents trapped chests from being opened normally with sounds and the chest opening animation altogether. I'm trying to create a workaround to this issue, though the aforementioned plugin also prevents Skript from detecting the opening of trapped chests.
My current solution has three known flaws:
- Multiple trapped chests can appear to be opened if more than one is in the player's line of sight
- Sounds are only played to the player opening the trapped chest
- Chest will not close if the player's line of sight changes after opening the trapped chest
Current Addons:
Skellett, skRayFall
code_language.skript:
on inventory open:
if event-inventory's display name contains "Chest":
loop blocks in front of the player's eyes:
if loop-block is a trapped chest:
play "BLOCK_CHEST_OPEN" to player at volume 3
play chest open animation at loop-block for all players
on inventory close:
if event-inventory's display name contains "Chest":
loop blocks in front of the player's eyes:
if loop-block is a trapped chest:
play "BLOCK_CHEST_CLOSE" to player at volume 3
play chest close animation at loop-block for all players
My current solution has three known flaws:
- Multiple trapped chests can appear to be opened if more than one is in the player's line of sight
- Sounds are only played to the player opening the trapped chest
- Chest will not close if the player's line of sight changes after opening the trapped chest
Current Addons:
Skellett, skRayFall