Saltar al contenido principal

spawn_corrupted_mob

Spawn Corrupted Mob — misc entry.

Entry Information

PropertyValue
Entry IDspawn_corrupted_mob
TypeMisc
ColorRed
Iconfa6-solid:skull

Description

Creates a dynamic corruption zone at a specific location. / @Entry("create_corruption_zone", "Create Corruption Zone", Colors.DARK_PURPLE, "fa6-solid:biohazard") class CreateCorruptionZoneActionEntry( @Help("Center position of the zone") val center: Position = Position.ORIGIN, @Help("Radius of the zone in blocks") val radius: Double = 10.0, @Help("Corruption level (1-10)") val level: Int = 1, @Help("Source of corruption") val source: String = "ENVIRONMENTAL", override val id: String = "", override val name: String = "", override val criteria: List<Criteria> = emptyList(), override val modifiers: List<Modifier> = emptyList(), override val triggers: List<Ref<TriggerableEntry>> = emptyList(), ) : ActionEntry { override fun ActionTrigger.execute() { val manager = KoinJavaComponent.get<CorruptionManager>(CorruptionManager::class.java) val corruptionSource = try { CorruptionSource.valueOf(source.uppercase()) } catch (_: Exception) { CorruptionSource.ENVIRONMENTAL } manager.createZone(center, radius, level, corruptionSource) } } /** Purifies a corruption zone at a specific location. / @Entry("purify_corruption_zone", "Purify Corruption Zone", Colors.GREEN, "fa6-solid:sparkles") class PurifyZoneActionEntry( @Help("Position to purify (finds nearest zone)") val position: Position = Position.ORIGIN, @Help("Purification amount (0-100)") val amount: Double = 10.0, override val id: String = "", override val name: String = "", override val criteria: List<Criteria> = emptyList(), override val modifiers: List<Modifier> = emptyList(), override val triggers: List<Ref<TriggerableEntry>> = emptyList(), ) : ActionEntry { override fun ActionTrigger.execute() { val manager = KoinJavaComponent.get<CorruptionManager>(CorruptionManager::class.java) val location = org.bukkit.Location( org.bukkit.Bukkit.getWorld(position.world.identifier) ?: return, position.x, position.y, position.z ) val zone = manager.getZoneAt(location) ?: return zone.purificationProgress = (zone.purificationProgress + amount).coerceIn(0.0, 100.0) } } /** Spawns a corrupted mob from BTC Mobs.

Fields

FieldTypeDescription
mobTypeStringMob type to spawn (BTCMobs internal name)
corruptionLevelIntCorruption level (affects stats)

Usage Example

- entry: spawn_corrupted_mob
name: "Spawn Corrupted Mob"
mobType: ""
corruptionLevel: 0