Minecraft Ray Collision Detector

Minecraft Ray Collision Detector 2.0

This project is
100% Complete
Contributor(s)
Octave
Minecraft Version(s)
1.14.4, 1.15.2
Intro
Minecraft Ray Collision Detector is a super precise raycast system in vanilla minecraft! This datapack solved the raycast problem perfectly with minimal command cost. It can be a really basic datapack for detect which surface are you click on or shoot a bullet through stairs or glasspanes
The speed of bullet or the casting distence can be easily defined with scoreboard, and cost only 200 commands in average per block!

Supported minecraft version: 1.14.4, 1.15.2. Datapack workes with 1.16, however all the new blocks in 1.16 are treated as full blocks.

Pics


Touched y+ of the bell



Pass through stairs and hit the piston


Pass through fences and glasspane and hit snowlayer


Can precisely hit those blocks that have random hitboxes

How to use
Set scoreboard mrcd_x0, mrcd_y0, mrcd_z0 for any area effect cloud. These three scoreboards stand for how many milliblocks(0.001block) that the area effect cloud can fly in a tick in three dimensions respectively. Then execute function mrcd:generic/start as the area effect cloud. If it touched a block, it will have tags named mrcd_touch_edge and mrcd_touch_DIRECTION. You can recognize which surface it touched from those tags.

If you want an area effect cloud that can pass those blocks that a player can pass, you should tag the area effect cloud mrcd_bullet.

If you want an area effect cloud that can touch entities, you should tag the area effect cloud mrcd_entity and rotate the AEC as the speed direction. If it touched an entity, it will have a tag named mrcd_touch_entity, and the target entity will be tagged mrcd_target_entity. Note that players are ignored by default. You can add minecraft: player in entity types tag (#mrcd:target) to change it.

Details are listed in function mrcd:raycast, mrcd:bullet and mrcd:entity.

Hope all developers enjoy this datapack and please post an issue on github if you find any unsupported blocks and bugs!
Author
Octave
Downloads
47
Views
327
First release
Last update
Rating
0.00 star(s) 0 ratings
Top