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
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.
Returns: This builder for chaining.
Return Type: Inverted
Inverted.withCondition(builder as LootConditionBuilder) as Inverted
Parameter | Type | Description |
---|---|---|
Parameter builder | Type LootConditionBuilder | Description The builder to create a single ILootCondition. |
Sets the loot condition to invert.
This parameter is required.
Returns: This builder for chaining.
Return Type: Inverted
Inverted.withCondition(condition as ILootCondition) as Inverted
Parameter | Type | Description |
---|---|---|
Parameter condition | Type ILootCondition | Description The condition to invert. |
Creates and builds the sub-condition that will then be inverted.
Returns: This builder for chaining.
Return Type: Inverted
Inverted.withCondition<T : ILootConditionTypeBuilder>(lender as Consumer<T>) as Inverted
Parameter | Type | Description |
---|---|---|
Parameter lender | Type Consumer<T> | Description A consumer that allows configuration of the created condition. |
Parameter T | Type ILootConditionTypeBuilder | Description The known type of the condition itself. |