TeamREPENTOGON / TeamREPENTOGON/REPENTOGON

MC_ENTITY_TAKE_DMG damage loop with worm-like enemies

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

Nobody has claimed this yet.

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

Description

REPENTOGON modifies MC_ENTITY_TAKE_DMG to allow you to return a table to modify damage, damage flags, and damage countdown. Specifically if you increase the damage dealt to worm-segmented enemies (Pin, Chub, Wormwood, etc), it makes them start to infinitely loop the damage dealt to them. Doesn't happen if you decrease or return the same amount of damage. This is all of the code involved:


local TestMod = RegisterMod("TestMod", 1)

function TestMod:BonusDucks(entity, amount, flags, source, countdownFrames)
    return {Damage = amount + 1}
end

TestMod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, TestMod.BonusDucks)

https://github.com/user-attachments/assets/24639f86-1da1-415b-a1b5-375f307612d9

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

Start by reproducing the minimal Lua MC_ENTITY_TAKE_DMG callback with a worm-segmented enemy and increased damage. Trace the damage callback handling and verify that returning increased damage no longer causes an infinite damage loop, while decreased or unchanged damage behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.