
Chain Mining Reforged
A commamds Mod for Fabric 1.21.4
Оцените первым
2.8K
1
Список изменений
Add a sex command.
/sex Command Technical Documentation
Overview
The /sex command is a custom Minecraft server command designed to create heart particle effects around specified entities. It features a flexible nested syntax and supports multiple targets with configurable duration.
Command Syntax
/sex sexas <target> [sexas|sexat <nextTarget> ...] <duration> <execute>
Parameters:
sexas: Subcommand to add a target (appends to list)sexat: Alternative subcommand to add a target (same as sexas)<target>: Entity selector (@p, @e, etc.)<duration>: Duration in ticks (0 to stop, -1 for infinite)<execute>: Boolean (true/false) to confirm execution
Technical Implementation
Core Components
-
Command Registration:
- Registered via
CommandDispatcher - Requires permission level 2
- Uses Brigadier's argument system
- Registered via
-
Particle System:
- Creates heart particles (ParticleTypes.HEART)
- Particles arranged in a circle around targets
- Server-side only (no client mod required)
-
Effect Management:
- Tracks active effects via
HeartParticleEffectclass - Automatic cleanup when duration expires
- Global tick handler updates all active effects
- Tracks active effects via
Key Classes
-
SexCommand:- Main command class
- Handles parsing and execution
- Manages active effects list
-
HeartParticleEffect:- Per-target effect instance
- Handles particle spawning
- Tracks remaining duration
Translation System
The command uses Minecraft's standard translation system with these keys:
| Key | Default English Text | Parameters |
|---|---|---|
command.sex.success.single | "Made %s surrounded by heart particles" | 1: Entity name |
command.sex.success.multiple | "Made %s and %s surrounded by heart particles" | N: Entity names |
command.sex.not_executed | "Command not executed" | None |
command.sex.duration_ticks | "%s for %s ticks" | 1: Base message, 2: Duration |
command.sex.conjunction | " and " | None |
Technical Details
Execution Flow
- Command parsed recursively through nested arguments
- All targets collected into single list
- Duration and execution flag validated
- Effects instantiated and added to active list
- Feedback message constructed using translation system
- Effects updated each server tick
Performance Considerations
- Particle effects are server-side only
- Each target creates 10 particles per tick
- Active effects list automatically cleans up finished effects
- No persistent data storage (effects vanish on server restart)
API Integration
- Uses standard Minecraft/Brigadier APIs
- Compatible with vanilla clients
- No external dependencies
Example Use Cases
- Basic single target:
/sex sexas @p 100 true
- Multiple targets:
/sex sexas @p sexas @e[type=cow,distance=..5] 200 true
- Infinite duration:
/sex sexas @e[type=sheep] -1 true
- Stop effects:
/sex sexas @e[type=sheep] 0 true
Limitations
- Maximum particle range follows server view distance
- No visual effect customization (always heart particles)
- No persistence across server restarts
- No per-effect cancellation (only duration-based)
This implementation provides a robust, localized command that integrates seamlessly with Minecraft's existing command and particle systems while maintaining good performance characteristics.
Файлы
ChainMiningReforged-0.0.1+build.14.jar(60.27 KiB)
ОсновнойМетаданные
Канал релиза
Beta
Номер версии
0.0.1+build.14
Загрузчики
Fabric
Версии игры
1.21.4
Загрузок
40
Дата публикации
27.03.2025
