EntityLootModifiers

Expands

This class expands crafttweaker.api.entity.EntityType<crafttweaker.api.entity.Entity>, meaning that the content found on this page can be called on that type directly.

Description

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

Members

addLootModifier(name as string, modifier as ILootModifier)
Adds an ILootModifier to the current entity.
script.zs
myInstance.addLootModifier(myString, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addPlayerOnlyLootModifier(name as string, modifier as ILootModifier)
Adds an ILootModifier to the current entity that fires only if the entity was killed by a player.
script.zs
myInstance.addPlayerOnlyLootModifier(myString, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier)
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.

script.zs
myInstance.addWeaponAndPlayerOnlyLootModifier(myString, myIItemStack, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
weapon Type: IItemStack - The weapon that needs to be used to kill the entity.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as bool, modifier as ILootModifier)
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.

script.zs
myInstance.addWeaponAndPlayerOnlyLootModifier(myString, myIItemStack, myBool, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
weapon Type: IItemStack - The weapon that needs to be used to kill the entity.
matchDamage Type: bool - Whether to consider damage or not when identifying the weapon.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as bool, matchNbt as bool, modifier as ILootModifier)
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.

script.zs
myInstance.addWeaponAndPlayerOnlyLootModifier(myString, myIItemStack, myBool, myBool, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
weapon Type: IItemStack - The weapon that needs to be used to kill the entity.
matchDamage Type: bool - Whether to consider damage or not when identifying the weapon.
matchNbt Type: bool - Whether to consider NBT data or not when identifying the weapon.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addWeaponOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier)
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.

script.zs
myInstance.addWeaponOnlyLootModifier(myString, myIItemStack, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
weapon Type: IItemStack - The weapon that needs to be used to kill the entity.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as bool, modifier as ILootModifier)
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.

script.zs
myInstance.addWeaponOnlyLootModifier(myString, myIItemStack, myBool, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
weapon Type: IItemStack - The weapon that needs to be used to kill the entity.
matchDamage Type: bool - Whether to consider damage or not when identifying the weapon.
modifier Type: ILootModifier - The loot modifier to add to the entity.
addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as bool, matchNbt as bool, modifier as ILootModifier)
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.

script.zs
myInstance.addWeaponOnlyLootModifier(myString, myIItemStack, myBool, myBool, myILootModifier);

Parameters:

name Type: string - The name of the loot modifier.
weapon Type: IItemStack - The weapon that needs to be used to kill the entity.
matchDamage Type: bool - Whether to consider damage or not when identifying the weapon.
matchNbt Type: bool - Whether to consider NBT data or not when identifying the weapon.
modifier Type: ILootModifier - The loot modifier to add to the entity.