Altar Recipe Conditions
Conditions are used to restrict when a ritual can be started. All conditions are additive, meaning that if you add multiple conditions, all must pass.
NOTE
This page assumes that you know how to get an instance of the altar recipe builder. If you do not know how to do that or you didn't read about the general recipe structure yet, please read the recipe basics page.
- type:
List<LootItemCondition> - required: no
- default: empty list
- primary access:
conditions(...)
Condition Builder
The condition builder is exposed via the conditions function on the altar recipe builder. Once you call the function, the builder instance is passed to the callback you have to provide.
.conditions(c =>
// put conditions here
// you can use a different name than c
// c is just a suggestion
)Because it's a builder, you can chain all functions. See all available conditions below.
Biome
The biome check ensures the ritual is only started in the given biomes. If you specify multiple biomes, the ritual can be started in any of them. If you want to specify multiple entries, you have to wrap them in an array via [].
It's possible to either specify specific biomes or a single biome tag.
Functions:
biomes(HolderSet<Biome> biomes)biomes(TagKey<Biome> biomeTag)
.conditions(c =>
c.biomes(["minecraft:plains", "minecraft:desert"])
// or
c.biomes("#minecraft:is_badlands")
)Dimension
The dimension check ensures the ritual is only started in the given dimension. It's only possible to specify one dimension.
Function: dimension(ResourceKey<Dimension> dimension)
.conditions(c =>
c.dimension("minecraft:overworld")
)Facing Direction
The facing direction check ensures the ritual is only started if the altar is facing the given horizontal direction.
Function: facing(Direction direction)
.conditions(c =>
c.facing("north")
// or
c.facing(Direction.NORTH)
)Height
The height check ensures the ritual is only started at the given height. You can specify a range, an exact value, a minimum, or a maximum. If you use more than a single function to specify a height, the required value will be overridden.
Range
Function: height(Integer min, Integer max)
.conditions(c =>
c.height(10, 20)
)Exact
Function: height(Integer height)
.conditions(c =>
c.height(10)
)Minimum
Function: minHeight(Integer min)
.conditions(c =>
c.minHeight(10)
)Maximum
Function: maxHeight(Integer max)
.conditions(c =>
c.maxHeight(10)
)Light Level
The light level check ensures the ritual is only started at the given light level. The light level is the amount of light that is emitted by nearby blocks. You can specify a range, an exact value, a minimum, or a maximum. If you use more than a single function to specify a light level, the required value will be overridden.
Range
Function: lightLevel(Integer min, Integer max)
.conditions(c =>
c.lightLevel(10, 20)
)Exact
Function: lightLevel(Integer lightLevel)
.conditions(c =>
c.lightLevel(10)
)Minimum
Function: minLightLevel(Integer min)
.conditions(c =>
c.minLightLevel(10)
)Maximum
Function: maxLightLevel(Integer max)
.conditions(c =>
c.maxLightLevel(10)
)Moon Phase
The moon phase check ensures the ritual is only started at the given moon phase.
If you want to read more about moon phases and how they are calculated, check the official Minecraft wiki article.
Function: moonPhase(MoonPhase phase)
Available Options:
FULL_MOONWANING_GIBBOUSTHIRD_QUARTERWANING_CRESCENTNEW_MOONWAXING_CRESCENTFIRST_QUARTERWAXING_GIBBOUS
.conditions(c =>
c.moonPhase(SummoningMoonPhase.FULL_MOON)
// or
c.moonPhase("full_moon")
)Open Sky
The open sky check ensures the ritual is only started when the altar block has an open sky. This means that the block has to be exposed to the sky (no blocks above it). By default, it does not matter if the altar block has an open sky or not. This means that by passing false, you can ensure that the altar block does not have an open sky.
NOTE
This condition is not compatible with the waterlogged condition, as the water block will obstruct the Altar's access to the sky. This is Vanilla behavior and can't be changed.
Function: setOpenSky(Boolean openSky)
.conditions(c =>
c.setOpenSky(true)
)Smoked
The smoked check ensures the ritual is only started when the altar block is being smoked. This means that the block has to be covered by smoke particles. This behavior is similar to that of the vanilla Bee Hive. By default, it does not matter if the altar block is being smoked or not. This means that by passing false, you can ensure that the altar block is not being smoked.
Function: setSmoked(Boolean smoked)
.conditions(c =>
c.setSmoked(true)
)Structures
The structure check ensures the ritual is only started inside the bounds of the specified structure. If you specify multiple structures, the ritual can be started in any of them. If you want to specify multiple entries, you have to wrap them in an array via [].
It's possible to either specify specific structures or a single structure tag.
Functions:
structures(HolderSet<Structure> structures)structures(TagKey<Structure> structureTag)
.conditions(c =>
c.structures(["minecraft:desert_pyramid", "minecraft:pillager_outpost"])
// or
c.structures("#minecraft:mineshaft")
)Time
The time check ensures the ritual is only started at the given game time. The time is the amount of ticks that have passed during a day. A day has 24000 ticks. You can specify a range, a minimum, a maximum, or a predefined time range. If you use more than a single function to specify a time, the required value will be overridden.
If you happen to pass the exact same bounds which would correspond to a predefined time range, the predefined time range will be used instead.
Range
Function: time(Integer min, Integer max)
.conditions(c =>
c.time(1000, 2000)
)Minimum
Function: minTime(Integer min)
.conditions(c =>
c.minTime(1000)
)Maximum
Function: maxTime(Integer max)
.conditions(c =>
c.maxTime(1000)
)Predefined
Function: time(SummoningTime time)
Available Options (min, max):
DAY(0, 12000)NIGHT(12000, 24000)MORNING(0, 4000)NOON(4000, 8000)AFTERNOON(8000, 10000)EVENING(10000, 12000)MIDNIGHT(17000, 19000)
.conditions(c =>
c.time(SummoningTime.DAY)
// or
c.time("day")
// or
c.time(0, 12000)
)Waterlogged
The waterlogged check ensures the ritual is only started when the altar block is waterlogged. This means that the block has to be covered by water. By default, it does not matter if the altar block is waterlogged or not. This means that by passing false, you can ensure that the altar block is not waterlogged.
NOTE
This condition is not compatible with the openSky condition, as the water block will obstruct the Altar's access to the sky. This is Vanilla behavior and can't be changed.
Function: setWaterlogged(Boolean waterlogged)
.conditions(c =>
c.setWaterlogged(true)
)Weather
The weather check ensures the ritual is only started when the weather is the given weather. By default, it does not matter what the weather is.
Because there are different types of weather, this is configured via its own builder. You can obtain the builder instance by calling the weather() function.
Function: weather(...)
Available builder functions:
setRaining(Boolean raining)setThundering(Boolean thundering)
.conditions(c =>
c.weather(w => w.setRaining(true))
// or
c.weather(w => w.setRaining(true).setThundering(false))
)