Data Packs Simple

Cursed throwable TNT using quaternions

  • 26 views
  • save_alt 2 downloads
Compatibility
Minecraft 26.3 snapshot
Changes include
  • Advancements
  • Functions
  • Loot Tables
  • Recipes
  • 3
  • 2
the der discohund
Lvl 45Master Vampire Theorist
21
Use right-click on any TNT item to throw it, and it will follow you around.

Only works for TNT that is crafted, mined or found in your world, so if you got it in your inventory before the data pack was installed or if you got it directly from the creative menu, you have to place and break the TNT first.

This data pack is meant as a demo for the quaternion math using the new /compute command.

As such, I made sure to write the code in a way that it is easy to learn from. The code also contains some easily re-usable math functions that you can free to copy into your own projects, as long as you make sure I'm credited for those parts.

For example, the logic that rotates the TNT in this data pack looks like this:

Cursed throwable TNT using quaternions Minecraft Data Pack

In this, the only part specific to this project is the get_axis_angle function. Actually rotating the entity is handled by all of the math that you can see right here!

If you have any questions, feel free to ask me on Discord.

More like this

  Have something to say?

TIBR
09/03/2026 12:09 am
He/Him • Level 14 : Journeyman Gentlemen Modder
This is just too peak.
1

Welcome