Expansion for EntityType

Link to expansion-for-entitytype

Additional methods for easier modification of entity-related loot tables.

Name: addLootModifier

Adds an ILootModifier to the current entity.

ZenScript
Copy
EntityType.addLootModifier(name as string, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addPlayerOnlyLootModifier

Name: addPlayerOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed by a player.

ZenScript
Copy
EntityType.addPlayerOnlyLootModifier(name as string, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addWeaponAndPlayerOnlyLootModifier

Name: addWeaponAndPlayerOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed by a player with the given weapon.

Additional parameters that further specify the weapon, such as NBT, count, or damage, are ignored.

ZenScript
Copy
EntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
weapon
Тип
IItemStack
Описание
The weapon that needs to be used to kill the entity.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addWeaponAndPlayerOnlyLootModifier

Name: addWeaponAndPlayerOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed by a player with the given weapon, optionally considering its damage.

Additional parameters that further specify the weapon, such as NBT, or count, are ignored.

ZenScript
Copy
EntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
weapon
Тип
IItemStack
Описание
The weapon that needs to be used to kill the entity.
Параметр
matchDamage
Тип
boolean
Описание
Whether to consider damage or not when identifying the weapon.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addWeaponAndPlayerOnlyLootModifier

Name: addWeaponAndPlayerOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed by a player with the given weapon, optionally considering its damage and NBT data.

Additional parameters that further specify the weapon, such as count, are ignored.

ZenScript
Copy
EntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
weapon
Тип
IItemStack
Описание
The weapon that needs to be used to kill the entity.
Параметр
matchDamage
Тип
boolean
Описание
Whether to consider damage or not when identifying the weapon.
Параметр
matchNbt
Тип
boolean
Описание
Whether to consider NBT data or not when identifying the weapon.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addWeaponOnlyLootModifier

Name: addWeaponOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed with the given weapon.

Additional parameters that further specify the weapon, such as NBT, count, or damage, are ignored.

ZenScript
Copy
EntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
weapon
Тип
IItemStack
Описание
The weapon that needs to be used to kill the entity.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addWeaponOnlyLootModifier

Name: addWeaponOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed with the given weapon, optionally considering its damage.

Additional parameters that further specify the weapon, such as NBT, or count, are ignored.

ZenScript
Copy
EntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
weapon
Тип
IItemStack
Описание
The weapon that needs to be used to kill the entity.
Параметр
matchDamage
Тип
boolean
Описание
Whether to consider damage or not when identifying the weapon.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.

Link to addWeaponOnlyLootModifier

Name: addWeaponOnlyLootModifier

Adds an ILootModifier to the current entity that fires only if the entity was killed with the given weapon, optionally considering its damage and NBT data.

Additional parameters that further specify the weapon, such as count, are ignored.

ZenScript
Copy
EntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier)
ПараметрТипОписание
Параметр
name
Тип
string
Описание
The name of the loot modifier.
Параметр
weapon
Тип
IItemStack
Описание
The weapon that needs to be used to kill the entity.
Параметр
matchDamage
Тип
boolean
Описание
Whether to consider damage or not when identifying the weapon.
Параметр
matchNbt
Тип
boolean
Описание
Whether to consider NBT data or not when identifying the weapon.
Параметр
modifier
Тип
ILootModifier
Описание
The loot modifier to add to the entity.