Expansion for EntityType
Additional methods for easier modification of entity-related loot tables.
Methods
Adds an ILootModifier to the current entity.
Return Type: void
EntityType.addLootModifier(name as string, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
Adds an ILootModifier to the current entity that fires only if the entity was killed by a player.
Return Type: void
EntityType.addPlayerOnlyLootModifier(name as string, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
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.
Return Type: void
EntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parameterweapon | TypeIItemStack | DescriptionThe weapon that needs to be used to kill the entity. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
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.
Return Type: void
EntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parameterweapon | TypeIItemStack | DescriptionThe weapon that needs to be used to kill the entity. | 
| ParametermatchDamage | Typeboolean | DescriptionWhether to consider damage or not when identifying the weapon. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
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.
Return Type: void
EntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parameterweapon | TypeIItemStack | DescriptionThe weapon that needs to be used to kill the entity. | 
| ParametermatchDamage | Typeboolean | DescriptionWhether to consider damage or not when identifying the weapon. | 
| ParametermatchNbt | Typeboolean | DescriptionWhether to consider NBT data or not when identifying the weapon. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
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.
Return Type: void
EntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parameterweapon | TypeIItemStack | DescriptionThe weapon that needs to be used to kill the entity. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
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.
Return Type: void
EntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parameterweapon | TypeIItemStack | DescriptionThe weapon that needs to be used to kill the entity. | 
| ParametermatchDamage | Typeboolean | DescriptionWhether to consider damage or not when identifying the weapon. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. | 
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.
Return Type: void
EntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier) as void| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe name of the loot modifier. | 
| Parameterweapon | TypeIItemStack | DescriptionThe weapon that needs to be used to kill the entity. | 
| ParametermatchDamage | Typeboolean | DescriptionWhether to consider damage or not when identifying the weapon. | 
| ParametermatchNbt | Typeboolean | DescriptionWhether to consider NBT data or not when identifying the weapon. | 
| Parametermodifier | TypeILootModifier | DescriptionThe loot modifier to add to the entity. |