CoTItemAdvanced

A registered CoT Item. Used for advanced functionality. like onItemUse, onItemRightClick etc.

These functions should be run in CraftTweaker scripts, instead of ContentTweaker ones. And they are reloadable. You can get it via advanced item BEP.

This class was added by a mod with mod-id contenttweaker. So you need to have this mod installed if you want to use this feature.

Diese Klasse importieren

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import mods.contenttweaker.item.advance.CoTItemAdvanced;

Methoden

setInventoryTick

Sets what will happen when the item is ticked in an inventory.

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setInventoryTick(func as IItemInventoryTick) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemInventoryTickan IItemInventoryTick function
setItemColorSupplier

The item's color.

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setItemColorSupplier(func as IItemColorSupplier) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemColorSupplieran IItemColorSupplier, The tintIndex is layerX property of its model.
setOnHitEntity

Sets what will happen when a living entity attacks other entities with this item.

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setOnHitEntity(func as IItemHitEntity) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemHitEntityan IItemHitEntity function, the function return whether can attack or not.
setOnInteractWithEntity

Sets what will happen when a player interacts (right-clicks) an entity with this item.

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setOnInteractWithEntity(func as IItemInteractWithEntity) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemInteractWithEntityan IItemInteractWithEntity function, the function should return an ActionResultType
setOnItemRightClick

Sets what will happen when the player right clicks with the item. If the item is food, then you cannot use this method as the food mechanics also use this method.

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setOnItemRightClick(func as IItemRightClick) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemRightClickan IItemRightClick function, the function should return an ActionResultType
setOnItemUse

Sets what will happen when the player uses this item on a block

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setOnItemUse(func as IItemUse) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemUsean IItemUse function, the function should return an ActionResultType
setUsingTick

The Set function will be called each tick while using the item

Return Type: CoTItemAdvanced

ZenScript
Copy
CoTItemAdvanced.setUsingTick(func as IItemUsingTick) as CoTItemAdvanced
ParameterTypeBeschreibung
funcIItemUsingTickan IItemUsingTick function. The count argument of function is the amount of time in tick the item has been used for continuously.