Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

Expansion for MCEntityType

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

Methods

Deprecated
Scheduled for removal in 1.17: use this#addLootModifier(MCEntityType, String, ILootModifier) instead.

Adds an IItemStack to the drops of this entity.

Return Type: void

script.zs
MCEntityType.addDrop(uniqueId as string, stack as IItemStack) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
stack
Type
IItemStack
Description
The stack to add to the drops.
Deprecated
Scheduled for removal in 1.17: use this#addLootModifier(MCEntityType, String, ILootModifier) instead.

Adds a list of IItemStacks to the drops of this entity.

Return Type: void

script.zs
MCEntityType.addDrops(uniqueId as string, stacks as IItemStack[]) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
stacks
Type
IItemStack[]
Description
The stacks to add to the drops.

Adds an ILootModifier to the current entity.

Return Type: void

script.zs
MCEntityType.addLootModifier(name as string, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
modifier
Type
ILootModifier
Description
The loot modifier to add to the entity.
Deprecated
Scheduled for removal in 1.17: use this#addPlayerOnlyLootModifier(MCEntityType, String, ILootModifier) instead.

Adds an IItemStack to the drops of this entity, but only if the entity was killed by a player.

Return Type: void

script.zs
MCEntityType.addPlayerOnlyDrop(uniqueId as string, stack as IItemStack) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
stack
Type
IItemStack
Description
The stack to add to the drops.
Deprecated
Scheduled for removal in 1.17: use this#addPlayerOnlyLootModifier(MCEntityType, String, ILootModifier) instead.

Adds a list of IItemStacks to the drops of this entity, but only if the entity was killed by a player.

Return Type: void

script.zs
MCEntityType.addPlayerOnlyDrops(uniqueId as string, stacks as IItemStack[]) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
stacks
Type
IItemStack[]
Description
The stacks to add to the drops.

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

Return Type: void

script.zs
MCEntityType.addPlayerOnlyLootModifier(name as string, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
modifier
Type
ILootModifier
Description
The loot modifier to add to the entity.
Deprecated
Scheduled for removal in 1.17: use this#addWeaponAndPlayerOnlyLootModifier(MCEntityType, String, IItemStack, ILootModifier) instead.

Adds an IItemStack to the drops of this entity, but 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

script.zs
MCEntityType.addWeaponAndPlayerOnlyDrop(uniqueId as string, weapon as IItemStack, stack as IItemStack) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
stack
Type
IItemStack
Description
The stack to add to the drops.
Deprecated
Scheduled for removal in 1.17: use this#addWeaponAndPlayerOnlyLootModifier(MCEntityType, String, IItemStack, ILootModifier) instead.

Adds a list of IItemStacks to the drops of this entity, but 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

script.zs
MCEntityType.addWeaponAndPlayerOnlyDrops(uniqueId as string, weapon as IItemStack, stacks as IItemStack[]) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
stacks
Type
IItemStack[]
Description
The stacks to add to the drops.

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

script.zs
MCEntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
modifier
Type
ILootModifier
Description
The 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

script.zs
MCEntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
matchDamage
Type
boolean
Description
Whether to consider damage or not when identifying the weapon.
Parameter
modifier
Type
ILootModifier
Description
The 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

script.zs
MCEntityType.addWeaponAndPlayerOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
matchDamage
Type
boolean
Description
Whether to consider damage or not when identifying the weapon.
Parameter
matchNbt
Type
boolean
Description
Whether to consider NBT data or not when identifying the weapon.
Parameter
modifier
Type
ILootModifier
Description
The loot modifier to add to the entity.
Deprecated
Scheduled for removal in 1.17: use this#addWeaponOnlyLootModifier(MCEntityType, String, IItemStack, ILootModifier) instead.

Adds an IItemStack to the drops of this entity, but 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

script.zs
MCEntityType.addWeaponOnlyDrop(uniqueId as string, weapon as IItemStack, stack as IItemStack) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
stack
Type
IItemStack
Description
The stack to add to the drops.
Deprecated
Scheduled for removal in 1.17: use this#addWeaponOnlyLootModifier(MCEntityType, String, IItemStack, ILootModifier) instead.

Adds a list of IItemStacks to the drops of this entity, but 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

script.zs
MCEntityType.addWeaponOnlyDrops(uniqueId as string, weapon as IItemStack, stacks as IItemStack[]) as void
ParameterTypeDescription
Parameter
uniqueId
Type
string
Description
A unique id for the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
stacks
Type
IItemStack[]
Description
The stacks to add to the drops.

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

script.zs
MCEntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
modifier
Type
ILootModifier
Description
The 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

script.zs
MCEntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
matchDamage
Type
boolean
Description
Whether to consider damage or not when identifying the weapon.
Parameter
modifier
Type
ILootModifier
Description
The 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

script.zs
MCEntityType.addWeaponOnlyLootModifier(name as string, weapon as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier) as void
ParameterTypeDescription
Parameter
name
Type
string
Description
The name of the loot modifier.
Parameter
weapon
Type
IItemStack
Description
The weapon that needs to be used to kill the entity.
Parameter
matchDamage
Type
boolean
Description
Whether to consider damage or not when identifying the weapon.
Parameter
matchNbt
Type
boolean
Description
Whether to consider NBT data or not when identifying the weapon.
Parameter
modifier
Type
ILootModifier
Description
The loot modifier to add to the entity.