ItemEvent

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.neoforge.api.event.item.ItemEvent;

Extends

ItemEvent extends EntityEvent.

Members

Getter
script.zs
// ItemEvent.entity as ItemEntity
myItemEvent.entity

Return Type: ItemEntity

Getter
script.zs
// ItemEvent.hasResult as bool
myItemEvent.hasResult

Return Type: bool

hasResult() as bool
script.zs
// ItemEvent.hasResult() as bool;
myItemEvent.hasResult();

Return Type: bool

Getter
script.zs
// ItemEvent.result as Result
myItemEvent.result

Return Type: EventResult

Setter
script.zs
// ItemEvent.result = (result as Result);
myItemEvent.result = myResult;

Parameters:

result Type: EventResult
result() as Result
script.zs
// ItemEvent.result() as Result;
myItemEvent.result();

Return Type: EventResult

result(result as Result)
script.zs
// ItemEvent.result(result as Result);
myItemEvent.result(myResult);

Parameters:

result Type: EventResult
setAllow()
sets the event's result to allow
script.zs
// ItemEvent.setAllow();
myItemEvent.setAllow();
setDefault()
sets the event's result to default
script.zs
// ItemEvent.setDefault();
myItemEvent.setDefault();
setDeny()
sets the event's result to deny
script.zs
// ItemEvent.setDeny();
myItemEvent.setDeny();