Builder to create an 'EntityScores' loot condition.

This condition checks the LootContext for an MCEntity that matches the targeted one, specified via TargetedEntity, and then tests its scoreboard properties against a set of values.

The condition passes if and only if there exists a valid entity to target and all the specified scoreboard entries are within the given bounds.

A valid 'EntityScores' loot condition has to specify a targeted entity. A well-formed 'EntityScores' condition must also specify at least one scoreboard property to check against. Not specifying any scoreboard values makes the condition simply act as a way to check for the presence of an entity of the given type.

Импорт класса

Link to импорт-класса

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.

ZenScript
Copy
import crafttweaker.api.loot.conditions.vanilla.EntityScores;

Implemented Interfaces

Link to implemented-interfaces

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

Name: withExactScore

Adds the scoreboard property name to the ones that should be checked, making sure that the values matches exactly the given one.

If the scoreboard property had already some bounds specified, then the bounds will get overwritten.

This parameter is optional.

Returns: This builder for chaining.
Return Type: EntityScores

ZenScript
Copy
EntityScores.withExactScore(name as string, value as int) as EntityScores
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the scoreboard property to check.
Параметр
value
Тип
int
Описание
The exact value the scoreboard property must have.

Link to withMaximumScore

Name: withMaximumScore

Adds the scoreboard property name to the ones that should be checked, setting its maximum accepted value to max.

If the scoreboard property had already some bounds specified, then the maximum value of the bound will be overwritten with the new value specified in max. On the other hand, if the scoreboard property didn't have any specified bounds, the maximum value is set, leaving the lower end unbounded.

The maximum value is inclusive, meaning that a value that is equal to max will pass the check.

This parameter is optional.

Returns: This builder for chaining.
Return Type: EntityScores

ZenScript
Copy
EntityScores.withMaximumScore(name as string, max as int) as EntityScores
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the scoreboard property to check.
Параметр
max
Тип
int
Описание
The maximum value the scoreboard property can have.

Link to withMinimumScore

Name: withMinimumScore

Adds the scoreboard property name to the ones that should be checked, setting its minimum accepted value to min.

If the scoreboard property had already some bounds specified, then the minimum value of the bound will be overwritten with the new value specified in min. On the other hand, if the scoreboard property didn't have any specified bounds, the minimum value is set, leaving the upper end unbounded.

The minimum value is inclusive, meaning that a value that is equal to min will pass the check.

This parameter is optional.

Returns: This builder for chaining.
Return Type: EntityScores

ZenScript
Copy
EntityScores.withMinimumScore(name as string, min as int) as EntityScores
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the scoreboard property to check.
Параметр
min
Тип
int
Описание
The minimum value the scoreboard property can have.

Name: withRangedScore

Adds the scoreboard property name to the ones that should be checked, setting both its minimum and maximum accepted values respectively to min and max.

If the scoreboard property had already some bounds specified, then the bounds will get completely overwritten with the new values.

Both minimum and maximum values are inclusive, meaning that a value that is equal to either min or max will pass the check.

This parameter is optional.

Returns: This builder for chaining.
Return Type: EntityScores

ZenScript
Copy
EntityScores.withRangedScore(name as string, min as int, max as int) as EntityScores
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the scoreboard property to check.
Параметр
min
Тип
int
Описание
The minimum value the scoreboard property can have.
Параметр
max
Тип
int
Описание
The maximum value the scoreboard property can have.

Link to withTargetedEntity

Name: withTargetedEntity

Sets the entity that should be targeted by the loot condition.

Refer to TargetedEntity for a full list and their respective meaning.

This parameter is required.

Returns: This builder for chaining.
Return Type: EntityScores

ZenScript
Copy
EntityScores.withTargetedEntity(entity as TargetedEntity) as EntityScores
ПараметрТипОписание
Параметр
entity
Тип
TargetedEntity
Описание
The entity that should be targeted.