SwingThrough

SwingThrough

Mod

Allows targeting (and interacting with and attacking) living entities through transparent blocks like grass, crops, and flowers.

Client Game MechanicsUtility

32.0k downloads
113 followers
Createda year ago
Updated10 months ago

Follow Save
Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.
Allows targeting living entities through transparent blocks.

Packs: Tinkerer's Quilt (Silk) - Switchy Pack
Mods: Switchy - Origins Minus (Statures) - Tinkerer's Smithing

This mod discards the block crosshair target to allow an entity to be targeted instead, when:

  • The block has empty collision
  • The entity is living and attackable
  • You're not directly riding the entity
  • The entity isn't your own tamed entity
  • The entity is within reach (slightly longer than actual attack range, but still usable)

Due to the way this is implemented, the block outline will also visually disappear when you're targeting the entity instead.

Technical Notes

This mod is comprised of a single mixin with about 4 lines of meaningful code:

  • 2 lines to use the full entity targeting range if the block meets the conditions (instead of stopping at the block).
  • 2 lines to discard the block target if the full range was used and the entity meets the conditions.

It performs no additional raycasts or radius searches.

Afterword

All mods are built on the work of many others.

We made this mod for Tinkerer's Quilt - our modpack about ease of play and vanilla content.

External resources



Project members

sisby-folk

Co-Authors


Technical information

License
LGPL-3.0-only
Client side
required
Server side
unsupported
Project ID