Tags
Creators
Details
0.0.1+build.14
Compatibility
Required content
Changes
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.
Optional dependencies
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:TvEEJARF:AKq2zbwr"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:TvEEJARF:AKq2zbwr"
}

