Persistent Particles
Persistent Particles
Section titled “Persistent Particles”Persistent particles are automatic, condition-based particle effects that apply to Pokemon when specific criteria are met.
Overview
Section titled “Overview”Unlike manually applied particles, persistent particles:
- Activate automatically when conditions match
- No player interaction required
- Server-wide effects that apply to all Pokemon
- Priority-based when multiple configs match
- Performance optimized with smart rendering
How They Work
Section titled “How They Work”Lifecycle
Section titled “Lifecycle”- Each Tick: Every Pokemon entity is evaluated
- Condition Matching: Pokemon is checked against all persistent particle configs
- Priority Selection: Highest priority matching config is selected
- Rendering: Particles spawn at configured intervals
- Cleanup: Effects are removed when Pokemon despawns or conditions change
Configuration Structure
Section titled “Configuration Structure”Persistent particles are configured in config/glamour/persistent_particles/*.json:
{ "id": "unique_identifier", "particleResourceId": "cobblemon_particle_id", "priority": 100, "settings": { "intervalTicks": 40, "durationTicks": 10, "particleCount": 3, "radius": 1.0, "offsetX": 0.0, "offsetY": 2.0, "offsetZ": 0.0, "followEntity": true, "maxDistance": 32, "onlyWhenVisible": false, "requiresLOS": false }, "conditions": { // Condition fields... }}Condition Types
Section titled “Condition Types”Pokemon Conditions
Section titled “Pokemon Conditions”Species
Section titled “Species”Match specific Pokemon species:
"conditions": { "species": ["pikachu", "raichu", "cobblemon:mew"]}- Accepts plain names (
pikachu) or full resource IDs (cobblemon:mew) - Multiple species can be specified
- Case-insensitive
Forms and Aspects
Section titled “Forms and Aspects”Match Pokemon with specific forms or aspects:
"conditions": { "forms": ["alolan", "galarian"], "aspects": ["red_stripe"], "anyAspects": ["blue", "green"], "excludeAspects": ["yellow"]}- forms: Pokemon must have one of these forms
- aspects: Pokemon must have ALL listed aspects
- anyAspects: Pokemon must have AT LEAST ONE listed aspect
- excludeAspects: Pokemon must NOT have any listed aspects
Match Pokemon by type:
"conditions": { "types": ["fire", "dragon"]}Pokemon must have at least one of the specified types.
Shiny Status
Section titled “Shiny Status”Match only shiny or non-shiny Pokemon:
"conditions": { "isShiny": true}Level Requirements
Section titled “Level Requirements”Match Pokemon within level ranges:
"conditions": { "level": { "exact": 100 }}Or:
"conditions": { "level": { "min": 50, "max": 100 }}Environment Conditions
Section titled “Environment Conditions”Biomes
Section titled “Biomes”Activate only in specific biomes:
"conditions": { "biomes": ["plains", "forest", "desert"]}Uses Minecraft biome IDs.
Dimensions
Section titled “Dimensions”Activate only in certain dimensions:
"conditions": { "dimensions": ["minecraft:overworld", "minecraft:the_nether"]}Time of Day
Section titled “Time of Day”Activate during specific times:
"conditions": { "timeOfDay": ["day", "night", "sunrise", "sunset"]}Options: day, night, sunrise, sunset
Weather
Section titled “Weather”Activate during specific weather:
"conditions": { "weather": ["clear", "rain", "thunder"]}Options: clear, rain, thunder
State Conditions
Section titled “State Conditions”Ownership
Section titled “Ownership”Match wild vs owned Pokemon:
"conditions": { "isWild": true}Or:
"conditions": { "isOwned": true}Health Percentage
Section titled “Health Percentage”Match Pokemon with specific health levels:
"conditions": { "healthPercent": { "min": 0, "max": 25 }}Shows particles when health is between 0-25%.
Battle Status
Section titled “Battle Status”Match Pokemon in or out of battle:
"conditions": { "isBattling": true}Stationary Status
Section titled “Stationary Status”Match stationary (shoulder-mounted or in specific states):
"conditions": { "isStationary": true}Priority System
Section titled “Priority System”When multiple configurations match a Pokemon, the highest priority wins.
Example Priority Hierarchy
Section titled “Example Priority Hierarchy”// Generic shiny effect - low priority{ "id": "shiny_sparkle", "priority": 100, "conditions": { "isShiny": true }}
// Legendary Pokemon - medium priority{ "id": "legendary_aura", "priority": 150, "conditions": { "species": ["mewtwo", "lugia", "rayquaza"] }}
// Shiny legendary - high priority{ "id": "shiny_legendary_epic", "priority": 200, "conditions": { "species": ["mewtwo", "lugia", "rayquaza"], "isShiny": true }}A shiny Mewtwo would use shiny_legendary_epic (priority 200).
Particle Settings
Section titled “Particle Settings”Timing Settings
Section titled “Timing Settings”| Setting | Description | Default |
|---|---|---|
intervalTicks | Ticks between particle spawns | 100 |
durationTicks | How long each particle lasts | 20 |
Spatial Settings
Section titled “Spatial Settings”| Setting | Description | Default |
|---|---|---|
particleCount | Particles spawned per interval | 1 |
radius | Spawn radius around center point | 1.0 |
offsetX | X-axis offset from Pokemon center | 0.0 |
offsetY | Y-axis offset from Pokemon center | 0.0 |
offsetZ | Z-axis offset from Pokemon center | 0.0 |
Entity Attachment
Section titled “Entity Attachment”| Setting | Description | Default |
|---|---|---|
followEntity | Attach particles to entity (true) or world position (false) | true |
followEntity: true - Particles move with the Pokemon followEntity: false - Particles spawn at world coordinates where Pokemon was
Performance Settings
Section titled “Performance Settings”| Setting | Description | Default |
|---|---|---|
maxDistance | Max render distance in blocks | 32 |
onlyWhenVisible | Use view-cone heuristic | false |
requiresLOS | Require line-of-sight (expensive) | false |
Performance Optimization
Section titled “Performance Optimization”Distance Culling
Section titled “Distance Culling”maxDistance determines how far players can be from the Pokemon to see particles:
"settings": { "maxDistance": 24}Lower values = better performance.
Visibility Checks
Section titled “Visibility Checks”onlyWhenVisible - Cheap view-cone check:
"settings": { "onlyWhenVisible": true}Particles only render if Pokemon is roughly in player’s field of view.
requiresLOS - Expensive raytrace check:
"settings": { "requiresLOS": true}Particles only render if player has direct line-of-sight (no blocks between). Uses global LOS budget and caching to maintain performance.
Interval Tuning
Section titled “Interval Tuning”Higher intervalTicks = better performance:
- 20 ticks (1 second): Very frequent, higher load
- 40 ticks (2 seconds): Balanced
- 100 ticks (5 seconds): Infrequent, low load
Example Configurations
Section titled “Example Configurations”Shiny Sparkle Effect
Section titled “Shiny Sparkle Effect”{ "id": "shiny_sparkle", "particleResourceId": "sparkle", "priority": 100, "settings": { "intervalTicks": 40, "durationTicks": 10, "particleCount": 3, "radius": 1.0, "followEntity": true, "maxDistance": 32 }, "conditions": { "isShiny": true }}Legendary Aura
Section titled “Legendary Aura”{ "id": "legendary_aura", "particleResourceId": "aura", "priority": 150, "settings": { "intervalTicks": 20, "durationTicks": 20, "particleCount": 5, "radius": 2.0, "offsetY": 1.0, "followEntity": true, "maxDistance": 48, "onlyWhenVisible": true }, "conditions": { "species": ["mewtwo", "lugia", "rayquaza", "dialga", "palkia"] }}Nighttime Ghost Effect
Section titled “Nighttime Ghost Effect”{ "id": "ghost_night_aura", "particleResourceId": "purple_flame", "priority": 80, "settings": { "intervalTicks": 30, "durationTicks": 15, "particleCount": 2, "radius": 1.5, "followEntity": true, "maxDistance": 32 }, "conditions": { "types": ["ghost"], "timeOfDay": ["night"] }}Low Health Warning
Section titled “Low Health Warning”{ "id": "low_health_warning", "particleResourceId": "red_sparkle", "priority": 50, "settings": { "intervalTicks": 10, "durationTicks": 5, "particleCount": 1, "radius": 0.5, "followEntity": true, "maxDistance": 16 }, "conditions": { "healthPercent": { "max": 25 } }}Commands
Section titled “Commands”Reload Configurations
Section titled “Reload Configurations”/persistentparticles reloadReloads all persistent particle configs without restarting the server.
View Statistics
Section titled “View Statistics”/persistentparticles statsShows:
- Active persistent particles
- Render counts per tick
- Performance metrics
- Global limits
Debug Configuration
Section titled “Debug Configuration”/persistentparticles debug <config_id>Displays detailed information about a specific configuration including all settings and conditions.
Best Practices
Section titled “Best Practices”- Start with High Priority: Reserve high priorities (200+) for very specific conditions
- Test Performance: Monitor with
/persistentparticles stats - Use Visibility Checks: Enable
onlyWhenVisiblefor expensive effects - Reasonable Intervals: Start with 40-100 tick intervals
- Limit Particle Count: More particles = more client rendering load
- Distance Culling: Use appropriate
maxDistancefor effect type
Troubleshooting
Section titled “Troubleshooting”Particles Not Appearing
Section titled “Particles Not Appearing”- Check conditions match with
/persistentparticles debug <id> - Verify
particleResourceIdexists in Cobblemon’s particle pack - Ensure player is within
maxDistance - Check if a higher priority config is overriding
Performance Issues
Section titled “Performance Issues”- Review stats with
/persistentparticles stats - Increase
intervalTicksglobally - Reduce
particleCountin configs - Enable
onlyWhenVisiblefor expensive effects - Lower
maxDistanceon high-frequency effects