-
Notifications
You must be signed in to change notification settings - Fork 18
Datapack: Wind Source
This datapack feature is available only in 21.x+. For 20.1, a reduced version of this option is available under server config.
Wind source is a matcher for blocks that produces updraft wind. By default, only fires and lit campfires can produce updraft. But datapacks can add wind sources for any blocks, with adjustable wind height, as well as modifying preexisting wind sources of fires and campfires.
Wind source JSON should be at location [datapack namespace]/paraglider/wind_sources/[wind source name].json. Name of the wind source does not affect any behavior. All JSON files under paraglider/wind_sources/ directory (or its subdirectory) will be read as wind source.
Wind source has one or more conditions that specifies matching blocks. Condition can be either block state based, or block tag based.
Block state conditions use block IDs and optional set of property values. The condition below matches glowstone block as wind source.
You can also match multiple blocks with array. The condition below matches both regular and soul fire block.
{
"block": [ // list of block IDs
"minecraft:fire",
"minecraft:soul_fire"
]
}Some blocks have some states that looks like it could produce updraft wind, while other states that makes little sense to do so. In such cases, you can use property matches to narrow down the specific states. The condition below only matches campfires that are lit. In other words, it only matches block state that has lit=true key-value pair.
{
"block": [
"minecraft:campfire",
"minecraft:soul_campfire"
],
"properties": { // key-value pair of block state properties
"lit": "true"
}
}Block tags may be used in the condition as well. The condition below matches all beds.
{
"tag": [ // list of block tags
"minecraft:beds"
]
}Note that, however, property matches cannot be used with tag conditions.
One wind source can contain multiple conditions. In this scenario, blocks that match any of the conditions will be considered part of the wind source. The wind source below matches lava block and lava cauldron block on separate condition to utilize property matches.
{
"conditions": [
{
"block": "minecraft:lava",
"properties": {
"level": "0" // only match source block
}
}
{
"block": "minecraft:lava_cauldron" // match any lava cauldron
}
]
}Height of the wind can be adjusted per file basis. If same block state is matched by two wind sources with different height, higher value is used.
Note that exceedingly tall height could lead to performance degradation, even if the tall wind source doesn't occur in the world at the moment. Higher maximum wind height means Paraglider needs to traverse more blocks to ensure no wind source is left unchecked, and thus increasing computational cost per increase in maximum height among wind sources.
Normally this check runs every 4 ticks, only server-side, only when player is actively paragliding, on a very small subset of the game world, using a not-that-inefficient-probably-maybe-hopefully logic, so my guess is your computer will probably be okay if you just want to crank up wind height to 2x. But consider this a warning before you try a half world sized wind column.
{
"conditions": { // wind source condition
"block": [
"minecraft:campfire",
"minecraft:soul_campfire"
],
"properties": {
"lit": "true"
}
},
"height": 10 // optional, default: 10
}
{ "block": "minecraft:glowstone" // block ID }