Package kr.toxicity.model.api.nms
Interface HitBox
- All Superinterfaces:
Identifiable
Represents a hitbox for a model part, allowing for interaction and collision detection.
Hitboxes are often implemented using invisible entities (like Slimes or Interaction entities) and are linked to specific bones in the model.
- Since:
- 1.15.2
-
Method Summary
Modifier and TypeMethodDescriptionvoiddismount(@NotNull PlatformEntity entity) Dismounts an entity from this hitbox.voidDismounts all passengers from this hitbox.booleanChecks if a dismount operation is forced.default @NotNull BoneNameReturns the name of the bone group associated with this hitbox.default booleanChecks if this hitbox is being controlled by another entity.booleanChecks if this hitbox has a mount driver.voidhide(@NotNull PlatformPlayer player) Hides this hitbox from a specific player.@NotNull HitBoxListenerlistener()Returns the listener associated with this hitbox.voidmount(@NotNull PlatformEntity entity) Mounts an entity onto this hitbox.@NotNull MountControllerReturns the mount controller for this hitbox.voidmountController(@NotNull MountController controller) Sets the mount controller for this hitbox.booleanonWalk()Checks if the passenger of this hitbox is walking.@NotNull RenderedBoneReturns the rendered bone that acts as the position source for this hitbox.default @NotNull Optional<EntityTrackerRegistry> registry()Returns the entity tracker registry for this hitbox's source entity.@NotNull org.joml.Vector3fReturns the relative position of this hitbox to its source entity.voidRemoves this hitbox safely.voidshow(@NotNull PlatformPlayer player) Shows this hitbox to a specific player.@NotNull PlatformEntitysource()Returns the source entity of this hitbox.voidtriggerInteract(@NotNull PlatformPlayer player, @NotNull ModelInteractionHand hand) Triggers an interaction with this hitbox.voidtriggerInteractAt(@NotNull PlatformPlayer player, @NotNull ModelInteractionHand hand, @NotNull org.joml.Vector3f position) Triggers an interaction with this hitbox at a specific position.Methods inherited from interface kr.toxicity.model.api.nms.Identifiable
id, uuid
-
Method Details
-
triggerInteract
@Internal void triggerInteract(@NotNull @NotNull PlatformPlayer player, @NotNull @NotNull ModelInteractionHand hand) Triggers an interaction with this hitbox.- Parameters:
player- the player interactinghand- the hand used- Since:
- 1.15.2
-
triggerInteractAt
@Internal void triggerInteractAt(@NotNull @NotNull PlatformPlayer player, @NotNull @NotNull ModelInteractionHand hand, @NotNull @NotNull org.joml.Vector3f position) Triggers an interaction with this hitbox at a specific position.- Parameters:
player- the player interactinghand- the hand usedposition- the interaction position- Since:
- 1.15.2
-
hide
Hides this hitbox from a specific player.- Parameters:
player- the target player- Since:
- 1.15.2
-
show
Shows this hitbox to a specific player.- Parameters:
player- the target player- Since:
- 1.15.2
-
groupName
Returns the name of the bone group associated with this hitbox.- Returns:
- the group name
- Since:
- 1.15.2
-
mountController
Returns the mount controller for this hitbox.- Returns:
- the mount controller
- Since:
- 1.15.2
-
mountController
Sets the mount controller for this hitbox.- Parameters:
controller- the new mount controller- Since:
- 1.15.2
-
onWalk
boolean onWalk()Checks if the passenger of this hitbox is walking.- Returns:
- true if walking, false otherwise
- Since:
- 1.15.2
-
source
Returns the source entity of this hitbox.- Returns:
- the source entity
- Since:
- 1.15.2
-
mount
Mounts an entity onto this hitbox.- Parameters:
entity- the entity to mount- Since:
- 1.15.2
-
hasMountDriver
boolean hasMountDriver()Checks if this hitbox has a mount driver.- Returns:
- true if it has a driver, false otherwise
- Since:
- 1.15.2
-
hasBeenControlled
default boolean hasBeenControlled()Checks if this hitbox is being controlled by another entity.- Returns:
- true if controlled, false otherwise
- Since:
- 1.15.2
-
dismount
Dismounts an entity from this hitbox.- Parameters:
entity- the entity to dismount- Since:
- 1.15.2
-
dismountAll
void dismountAll()Dismounts all passengers from this hitbox.- Since:
- 1.15.2
-
forceDismount
boolean forceDismount()Checks if a dismount operation is forced.- Returns:
- true if forced, false otherwise
- Since:
- 1.15.2
-
relativePosition
@NotNull @NotNull org.joml.Vector3f relativePosition()Returns the relative position of this hitbox to its source entity.- Returns:
- the relative position
- Since:
- 1.15.2
-
removeHitBox
void removeHitBox()Removes this hitbox safely.- Since:
- 1.15.2
-
listener
Returns the listener associated with this hitbox.- Returns:
- the listener
- Since:
- 1.15.2
-
positionSource
Returns the rendered bone that acts as the position source for this hitbox.- Returns:
- the position source bone
- Since:
- 1.15.2
-
registry
Returns the entity tracker registry for this hitbox's source entity.- Returns:
- an optional containing the registry, or empty if not found
- Since:
- 1.15.2
-