Interface IgnisBlockStrategy
- All Superinterfaces:
IgnisStrategy
- All Known Implementing Classes:
AbstractIgnisBlockStrategy
Runtime behavior for custom block types.
Two lifecycles
Blocks have a placed lifecycle while the barrier block exists in the world, and an
active lifecycle after ignition when a RuntimeBlockInstance ticks until trigger.
Placed block callbacks
onPlaced(BlockDefinition, IgnisLocation)— after the custom block is registered at a locationonPlacedClick(BlockDefinition, IgnisLocation, IgnisPlayer, IgnisInteraction, IgnisItem)— player click; returnCustomBlockActionfor core handlingonPlacedInteract(BlockDefinition, IgnisLocation, IgnisPlayer, IgnisInteraction, IgnisItem, CustomBlockAction)— follow-up forCustomBlockAction.OPENand similar custom actionsonPlacedBreak(BlockDefinition, IgnisLocation)— block removed (creative break, mining complete, or ignite prep)
Active block callbacks
onPlace(RuntimeBlockInstance)— active instance created (typically after ignite)onTick(RuntimeBlockInstance)— repeating scheduler tick while fuse counts downonTrigger(RuntimeBlockInstance, Object)— fuse elapsed or external trigger; explosion/effect logic runs hereonBreak(RuntimeBlockInstance)/onInteract(RuntimeBlockInstance, IgnisPlayer)— optional active-instance hooks
Override profile(BlockDefinition) to declare combustibility, default click actions, and ignition
materials. Click behavior is implemented in onPlacedClick(BlockDefinition, IgnisLocation, IgnisPlayer, IgnisInteraction, IgnisItem); YAML interactions
is optional tuning data (sounds, particles) via BlockDefinition.getInteractionConfig().
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonBreak(RuntimeBlockInstance instance) default voidonInteract(RuntimeBlockInstance instance, IgnisPlayer player) default voidonPlace(RuntimeBlockInstance instance) default voidonPlaced(BlockDefinition definition, IgnisLocation location) default voidonPlaced(BlockDefinition definition, IgnisLocation location, IgnisItem placedFrom) default voidonPlacedBreak(BlockDefinition definition, IgnisLocation location) default voidonPlacedBreak(BlockDefinition definition, IgnisLocation location, IgnisItem droppedItem) default CustomBlockActiononPlacedClick(BlockDefinition definition, IgnisLocation location, IgnisPlayer player, IgnisInteraction interaction, IgnisItem heldItem) Decide how a placed block responds to a player click.default voidonPlacedInteract(BlockDefinition definition, IgnisLocation location, IgnisPlayer player, CustomBlockAction action) default voidonPlacedInteract(BlockDefinition definition, IgnisLocation location, IgnisPlayer player, IgnisInteraction interaction, IgnisItem heldItem, CustomBlockAction action) default voidonTick(RuntimeBlockInstance instance) default voidonTrigger(RuntimeBlockInstance instance, Object context) default StrategyProfileprofile(BlockDefinition definition) Methods inherited from interface IgnisStrategy
descriptor
-
Method Details
-
profile
-
onPlaced
-
onPlaced
-
onPlacedClick
default CustomBlockAction onPlacedClick(BlockDefinition definition, IgnisLocation location, IgnisPlayer player, IgnisInteraction interaction, IgnisItem heldItem) Decide how a placed block responds to a player click.- Returns:
CustomBlockAction.NONEto ignore;CustomBlockAction.HANDLEDwhen this method performed custom logic;CustomBlockAction.BREAK/CustomBlockAction.IGNITEfor core services;CustomBlockAction.OPENto delegate toonPlacedInteract(BlockDefinition, IgnisLocation, IgnisPlayer, IgnisInteraction, IgnisItem, CustomBlockAction)
-
onPlacedInteract
default void onPlacedInteract(BlockDefinition definition, IgnisLocation location, IgnisPlayer player, IgnisInteraction interaction, IgnisItem heldItem, CustomBlockAction action) -
onPlacedInteract
default void onPlacedInteract(BlockDefinition definition, IgnisLocation location, IgnisPlayer player, CustomBlockAction action) -
onPlacedBreak
-
onPlacedBreak
default void onPlacedBreak(BlockDefinition definition, IgnisLocation location, IgnisItem droppedItem) -
onPlace
-
onTick
-
onInteract
-
onBreak
-
onTrigger
-