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 script.zs
ILootModifier
to the current entity.myInstance.addLootModifier(myString, myILootModifier);
Parameters:
name: string
Type: string
- The name of the loot modifier. addPlayerOnlyLootModifier(name as string, modifier as ILootModifier)
Adds an script.zs
ILootModifier
to the current entity that fires only if the entity was killed by a player.myInstance.addPlayerOnlyLootModifier(myString, myILootModifier);
Parameters:
name: string
Type: string
- The name of the loot modifier. addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier)
Adds an
script.zs
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.
myInstance.addWeaponAndPlayerOnlyLootModifier(myString, myIItemStack, myILootModifier);
Parameters:
name: string
Type: string
- The name of the loot modifier. addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchComponents as bool, modifier as ILootModifier)
Adds an
script.zs
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.
myInstance.addWeaponAndPlayerOnlyLootModifier(myString, myIItemStack, myBool, myILootModifier);
Parameters:
name: string
Type: string
- The name of the loot modifier. matchComponents: bool
Type: bool
- Whether to consider components or not when identifying the weapon. addWeaponOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier)
Adds an
script.zs
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.
myInstance.addWeaponOnlyLootModifier(myString, myIItemStack, myILootModifier);
Parameters:
name: string
Type: string
- The name of the loot modifier. addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchComponents as bool, modifier as ILootModifier)
Adds an
script.zs
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.
myInstance.addWeaponOnlyLootModifier(myString, myIItemStack, myBool, myILootModifier);
Parameters:
name: string
Type: string
- The name of the loot modifier. matchComponents: bool
Type: bool
- Whether to consider components or not when identifying the weapon.