promotional bannermobile promotional banner

Chain Mining Reforged

A command mod for fabric 1.21.4
Back to Files

Chain Mining Reforged-0.0.1+build.14

File nameChainMiningReforged-0.0.1+build.14.jar
Uploader
Redstone2337Redstone2337
Uploaded
Mar 27, 2025
Downloads
16
Size
60.3 KB
Mod Loaders
Fabric
File ID
6353724
Type
B
Beta
Supported game versions
  • 1.21.4

Curse Maven Snippet

Fabric

modImplementation "curse.maven:chain-mining-reforged-1226152:6353724"

Learn more about Curse Maven

What's new

Added new instruction 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

  1. Command Registration:

    • Registered via CommandDispatcher
    • Requires permission level 2
    • Uses Brigadier's argument system
  2. Particle System:

    • Creates heart particles (ParticleTypes.HEART)
    • Particles arranged in a circle around targets
    • Server-side only (no client mod required)
  3. Effect Management:

    • Tracks active effects via HeartParticleEffect class
    • Automatic cleanup when duration expires
    • Global tick handler updates all active effects

Key Classes

  1. SexCommand:

    • Main command class
    • Handles parsing and execution
    • Manages active effects list
  2. 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

  1. Command parsed recursively through nested arguments
  2. All targets collected into single list
  3. Duration and execution flag validated
  4. Effects instantiated and added to active list
  5. Feedback message constructed using translation system
  6. 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

  1. Basic single target:
/sex sexas @p 100 true
  1. Multiple targets:
/sex sexas @p sexas @e[type=cow,distance=..5] 200 true
  1. Infinite duration:
/sex sexas @e[type=sheep] -1 true
  1. 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.

This mod has no additional files