"Return under its owner's control with a +1/+1 counter": the counter is put by the spell's controller, not the permanent's controller (CR 122.6a)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start in ChangeZoneEffect.changeKnownOriginResolve, where the Destination$ Battlefield branch with WithCountersType calls table.put(activator, ...) around line 643, and check the other addCounter calls that pass the activator. The counter's putter should be the player the card enters under, per CR 122.6a. Run the failing test returnedWithCounterIsPutByItsController in forge-gui-desktop (forge.ai). Done when it passes and Stocking the Pantry gets its supply counter, while the existing counter tests still pass.
Written by the indexing model from the issue text.
Description
Describe the bug
When a card is returned to the battlefield under its owner's control "with a +1/+1 counter on it" by an opponent's spell (Otherworldly Journey, Parting Gust, ...), Forge records the opponent (the activating player) as the player who put the counter. The owner's "whenever you put one or more +1/+1 counters on a creature you control" abilities (Stocking the Pantry, and other CounterAddedOnce ... ValidSource$ You triggers) therefore do not trigger.
To Reproduce
- Player B controls Runeclaw Bear and Stocking the Pantry.
- Player A casts Otherworldly Journey targeting Runeclaw Bear.
- At the next end step the Bear returns under B's control with a +1/+1 counter.
- Stocking the Pantry does not trigger; it has no supply counter.
Expected behavior
CR 122.6: putting counters on an object includes "an object that's given counters as it enters the battlefield." CR 122.6a: "If an object enters the battlefield with counters on it, the effect causing the object to be given counters may specify which player puts those counters on it. If the effect doesn't specify a player, the object's controller puts those counters on it." The Bear's controller is B, so B put the counter and Stocking the Pantry triggers (B gets a supply counter).
Additional context
Master 2a3d3fd774, ChangeZoneEffect.changeKnownOriginResolve: for Destination$ Battlefield with WithCountersType, line 643 does table.put(activator, gameCard, cType, cAmount), so the source of the counters is the activating player rather than the controller the card enters under. The other WithCountersType paths (addCounter(cType, cAmount, activator, ...) at lines 781, 826, 835) use the activator the same way. When B casts the Journey on their own Bear, Stocking the Pantry does trigger (control test below passes), which isolates the putter as the cause.
Failing test (forge-gui-desktop, forge.ai; fails with expected:<1> but was:<0> on master):
@Test
public void returnedWithCounterIsPutByItsController() {
Game game = initAndCreateGame();
Player p = game.getPlayers().get(1);
Player opp = game.getPlayers().get(0);
fillLibrary(p, 10);
fillLibrary(opp, 10);
addCards("Plains", 2, p);
Card bear = addCard("Runeclaw Bear", opp);
Card pantry = addCard("Stocking the Pantry", opp);
Card journey = addCardToZone("Otherworldly Journey", p, ZoneType.Hand);
game.getAction().checkStateEffects(true);
SpellAbility sa = journey.getFirstSpellAbility();
sa.setActivatingPlayer(p);
sa.getTargets().add(bear);
AssertJUnit.assertTrue(ComputerUtil.playStack(sa, p, game));
playUntilNextTurn(game);
// the Bear is back under opp's control with one +1/+1 counter (checked), but:
AssertJUnit.assertEquals("Stocking the Pantry should get a supply counter", 1,
pantry.getCounters(CounterType.getType("SUPPLY")));
}
Found with the help of an AI coding agent (Claude Code); reviewed before posting.
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 1.1k
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 316
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Card-Forge/forge
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Card-Forge/forge#13173 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Card-Forge/forge#13092 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Card-Forge/forge#12877 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Card-Forge/forge#12710 ·
Maintainers usually reply within 1 day
-
Shandalar "The Drunken Plea" quest completes prematurelyMay be free again @Simisays claimed this 37 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Card-Forge/forge#12306 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in Card-Forge/forge
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
HexaHexes/neoforge-mod-template#124 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenLiberty/open-liberty#36410 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
erkamyaman/rust-anything#1153 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day