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.forge.api.event.item.ItemEvent;

Extends

ItemEvent extends EntityEvent.

Members

cancel()
Cancels the event. Same as setCanceled(true)
script.zs
// ItemEvent.cancel();
myItemEvent.cancel();
Getter
script.zs
// ItemEvent.cancelable as bool
myItemEvent.cancelable

Return Type: bool

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

Return Type: bool

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

Return Type: bool

Setter
script.zs
// ItemEvent.canceled = (cancel as bool);
myItemEvent.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// ItemEvent.canceled() as bool;
myItemEvent.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// ItemEvent.canceled(cancel as bool);
myItemEvent.canceled(myBool);

Parameters:

cancel Type: bool
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();