InteractionResult

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.api.world.InteractionResult;

Implements

Undocumented Interfaces

Comparable<Enum>

Enum Constants

InteractionResult is an enum with 5 constants. They are accessible like so:

script.zs
// InteractionResult.CONSUME
<constant:minecraft:world/interactionresult:consume>
// InteractionResult.CONSUME_PARTIAL
<constant:minecraft:world/interactionresult:consume_partial>
// InteractionResult.FAIL
<constant:minecraft:world/interactionresult:fail>
// InteractionResult.PASS
<constant:minecraft:world/interactionresult:pass>
// InteractionResult.SUCCESS
<constant:minecraft:world/interactionresult:success>

Members

Getter
script.zs
// InteractionResult.consumesAction as bool
<constant:minecraft:world/interactionresult:consume>.consumesAction

Return Type: bool

consumesAction() as bool
script.zs
// InteractionResult.consumesAction() as bool;
<constant:minecraft:world/interactionresult:consume>.consumesAction();

Return Type: bool

Getter
script.zs
// InteractionResult.shouldAwardStats as bool
<constant:minecraft:world/interactionresult:consume>.shouldAwardStats

Return Type: bool

shouldAwardStats() as bool
script.zs
// InteractionResult.shouldAwardStats() as bool;
<constant:minecraft:world/interactionresult:consume>.shouldAwardStats();

Return Type: bool

Getter
script.zs
// InteractionResult.shouldSwing as bool
<constant:minecraft:world/interactionresult:consume>.shouldSwing

Return Type: bool

shouldSwing() as bool
script.zs
// InteractionResult.shouldSwing() as bool;
<constant:minecraft:world/interactionresult:consume>.shouldSwing();

Return Type: bool

static sidedSuccess(successSide as bool) as InteractionResult
Returns true if successSide is true, this can be used to return SUCCESS on the client, but CONSUME on the server.

Returns: <constant:minecraft:world/interactionresult:success> if successSide is true, otherwise <constant:minecraft:world/interactionresult:consume>.

script.zs
// InteractionResult.sidedSuccess(successSide as bool) as InteractionResult;
InteractionResult.sidedSuccess(true);

Parameters:

successSide Type: bool - Is the current side the success side.

Return Type: InteractionResult