メインコンテンツまでスキップ

custom_biome_list_variable

Returns a list of registered custom biomes — variable entry.

Entry Information

PropertyValue
Entry IDcustom_biome_list_variable
TypeVariable
ColorGreen
Iconmdi:format-list-bulleted

Description

Variable that returns the player's current biome name. / @Tags("variable") @Entry( "current_biome_variable", "Returns the player's current biome name", Colors.GREEN, icon = "mdi:pine-tree" ) class CurrentBiomeVariableEntry( override val id: String = "", override val name: String = "", @Help("Format for the output: ID returns 'namespace:key', NAME returns readable name") val format: BiomeFormat = BiomeFormat.NAME, ) : VariableEntry { override fun <T : Any> get(context: VarContext<T>): T { val player = context.player val biome = player.location.block.biome val result = when (format) { BiomeFormat.ID -> biome.key.toString() BiomeFormat.NAME -> BiomeResolver.readableName(biome) BiomeFormat.KEY -> biome.key.key BiomeFormat.NAMESPACE -> biome.key.namespace } return context.cast(result) } enum class BiomeFormat { @Help("Returns the full key (e.g., 'minecraft:plains')") ID, @Help("Returns a human-readable name (e.g., 'Plains')") NAME, @Help("Returns just the key part (e.g., 'plains')") KEY, @Help("Returns just the namespace (e.g., 'minecraft' or 'typewriter')") NAMESPACE, } } /** Variable that returns information about a specific biome property. For vanilla biomes, uses Bukkit API for temperature/downfall. / @Tags("variable") @Entry( "biome_property_variable", "Returns a property of the player's current biome", Colors.GREEN, icon = "mdi:thermometer" ) class BiomePropertyVariableEntry( override val id: String = "", override val name: String = "", @Help("Which property to return") val property: BiomeProperty = BiomeProperty.IS_CUSTOM, ) : VariableEntry { override fun <T : Any> get(context: VarContext<T>): T { val player = context.player val biome = player.location.block.biome val registry: CustomBiomeRegistry = org.koin.java.KoinJavaComponent.get(CustomBiomeRegistry::class.java) val definition = registry.getDefinition(biome.key) val result = when (property) { BiomeProperty.IS_CUSTOM -> BiomeResolver.isCustomBiome(biome).toString() BiomeProperty.TEMPERATURE -> definition?.temperature?.toString() ?: "N/A" BiomeProperty.DOWNFALL -> definition?.downfall?.toString() ?: "N/A" BiomeProperty.BASE_BIOME -> definition?.baseKey?.toString() ?: biome.key.toString() } return context.cast(result) } enum class BiomeProperty { @Help("Returns 'true' if in a custom biome, 'false' otherwise") IS_CUSTOM, @Help("Returns the temperature value (custom biomes use definition, vanilla uses Bukkit API)") TEMPERATURE, @Help("Returns the downfall/humidity value (custom biomes use definition, vanilla uses Bukkit API)") DOWNFALL, @Help("Returns the base biome key") BASE_BIOME, } } /** Variable that returns the list of custom biomes.

Fields

FieldTypeDescription
separatorStringSeparator between biome names (default: ', ')
formatCurrentBiomeVariableEntry.BiomeFormatFormat for each biome: ID or NAME

Usage Example

- entry: custom_biome_list_variable
name: "Returns a list of registered custom biomes"
separator: ""
format: ""