Inverted

Builder to create an 'Inverted' loot condition.

This loot condition tests the given sub-condition, then inverts its result, effectively passing if and only if the sub-condition does not. Effectively, this means that the sub-condition gets a 'NOT' gate prepended to it. This loot condition thus acts as the vanilla counterpart of the Not loot condition. Differently from the one, though, the behavior of this loot condition may drift away from the raw 'Not' behavior if and when the base game alters its own condition.

An 'Inverted' condition requires a sub-condition to be built.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

import crafttweaker.api.loot.conditions.vanilla.Inverted;

Implemented Interfaces

Inverted implements the following interfaces. That means all methods defined in these interfaces are also available in Inverted

Methods

withCondition

Sets the inverted condition to the one created with the given LootConditionBuilder.

The builder must host a single loot condition. Builders with a different amount of conditions are not allowed. The builder will be used to generate a loot condition that will then be used as sub-condition.

This parameter is required.

Return Type: Inverted

Inverted.withCondition(builder as LootConditionBuilder) as Inverted
ParameterTypeDescription
constructorLootConditionBuilderThe builder to create a single ILootCondition.
withCondition

Sets the loot condition to invert.

This parameter is required.

Return Type: Inverted

Inverted.withCondition(condition as ILootCondition) as Inverted
ParameterTypeDescription
conditionILootConditionThe condition to invert.
withCondition

Creates and builds the sub-condition that will then be inverted.

Return Type: Inverted

Inverted.withCondition<T : ILootConditionTypeBuilder>(lender as Consumer<T>) as Inverted
ParameterTypeDescription
lenderConsumer<T>A consumer that allows configuration of the created condition.
TILootConditionTypeBuilderThe known type of the condition itself.