
Cobblemon force battles
I need to create a serverside mod that allows for players to right click another player and that forces a cobblemon battle
00—cobblemon-fabricServer1.21.1mod
Cobblemon Force Battles
- Server-side Fabric mod (MC 1.21.1, Cobblemon 1.7.1) that starts a Cobblemon 1v1 battle when you right-click another player with your main hand.
- Interaction is only handled on the server and respects Cobblemon's
battlePvPMaxDistancecheck, including line-of-sight validation. - Cobblemon's
BattleBuilderis used to start the fight; any validation errors (e.g., no healthy party, already battling) are relayed to both players. - On a successful trigger, both players get a short chat message confirming the forced challenge; no GUI prompts are required.
Usage
- Walk up to another player and right-click them with your main hand to immediately initiate a Cobblemon battle.
- If either player lacks a valid party or is busy/already battling, the battle won't start and the relevant Cobblemon error message is shown.
Notes & Limitations
- No cooldowns or permission checks are enforced; every main-hand right-click on another player will attempt to start a battle.
- Only player vs. player battles are triggered; other entity interactions are untouched.