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.
import crafttweaker.api.world.InteractionResult;
Implements
Undocumented Interfaces
Comparable<Enum>
Enum Constants
InteractionResult is an enum with 6 constants. They are accessible like so:
// 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>// InteractionResult.SUCCESS_NO_ITEM_USED<constant:minecraft:world/interactionresult:success_no_item_used>
Members
Getter
// InteractionResult.consumesAction as bool<constant:minecraft:world/interactionresult:consume>.consumesAction
Return Type:
bool
Getter
// InteractionResult.indicateItemUse as bool<constant:minecraft:world/interactionresult:consume>.indicateItemUse
Return Type:
bool
Getter
// InteractionResult.shouldSwing as bool<constant:minecraft:world/interactionresult:consume>.shouldSwing
Return Type:
bool
static sidedSuccess(successSide as bool) as InteractionResult
Returns true if script.zs
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>.
InteractionResult.sidedSuccess(true);
Parameters:
successSide: bool
Type: bool
- Is the current side the success side.
Return Type:
InteractionResult