TeamREPENTOGON / TeamREPENTOGON/REPENTOGON

MC_PRE_CHEST_OPEN (and MC_POST_CHEST_OPEN)

Open
#463 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
345
Forks
51
Avg merge
11h 2m
Merged PRs (30d)
4

Description

I suggest a pair of callbacks triggered whenever a chest is open. They'd use the following params
(EntityPickup chest, RNG rng,table SpawnedEntities). The AddCallback function would take PickupVariant as an additional parameter for only triggering on a specific kind of chest.

Returning any value doesn't affect the MC_POST_CHEST_OPEN callback, but the MC_PRE_CHEST_OPEN callback accepts the following table, with any combination of its values:
{boolean CanOpen whether or not a chest will actually open. If returned false, will prevent future instances of the callback from running.
table SpawnedEntities table with Type, Variant and SubType of entities spawned by it, with the following structure: {Type,(default = 0) Variant,(default = 0) SubType, (default = RandomVector()) Velocity}
boolean OpenCost whether or not opening the chest will consume any cost it usually has, such as dealing damage, or taking keys. Obviously doesn't work for regular, stone and red chests.
boolean Remain whether or not the chest will disappear on opening or keep a version of it with subtype of 1. By default is true but by default also becomes false if a collectible is present in the SpawnedEntities table
}.

Additionally, returning false is equivalent to returning {CanOpen = false, OpenCost = false}. Returning true or nil makes it behave as normal.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are identified in the issue. Start by locating the AddCallback API and the chest-opening event handling, then compare existing callback parameter and return-value conventions. Done means both callbacks support the specified filters, parameters, return values, and chest-opening behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
Domain
api, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.