Interface HitboxInteractHandler<E>
- Type Parameters:
E- The extra data class for this Immersive. This is the first class passed toBlockBasedImmersiveBuilder.copy(BlockBasedImmersiveHandler, Class, Class, BiConsumer).
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface for
BuiltBlockBasedImmersives for determining what should happen when a hitbox is
interacted with.-
Method Summary
Modifier and TypeMethodDescriptionintapply(BuiltBlockBasedImmersiveInfo<E> info, net.minecraft.world.entity.player.Player player, List<Integer> slots, net.minecraft.world.InteractionHand hand, boolean modifierPressed) Called when a hitbox is being interacted with.
-
Method Details
-
apply
int apply(BuiltBlockBasedImmersiveInfo<E> info, net.minecraft.world.entity.player.Player player, List<Integer> slots, net.minecraft.world.InteractionHand hand, boolean modifierPressed) Called when a hitbox is being interacted with.- Parameters:
info- The info containing the interacted hitbox.player- The player interacting with the hitbox.slots- The slots or hitboxIndices being interacted with.hand- Which hand is interacting with the hitbox.modifierPressed- Whether the modifier key (usually the button mapped to breaking blocks) was held for the interaction.- Returns:
- A cooldown time. See
Immersive.handleHitboxInteract(ImmersiveInfo, LocalPlayer, List, InteractionHand, boolean)for more info.
-