k-bai / minecraft-ray-collision-detector Goto Github PK
View Code? Open in Web Editor NEWSuper precise raycast system datapack in vanilla minecraft
Super precise raycast system datapack in vanilla minecraft
测试代码:
execute at @s anchored eyes run summon marker ^ ^ ^32 {Tags:["mrcd_bullet","init"]}
execute as @e[tag=init, limit=1] store result score @s mrcd_x0 run data get entity @s Pos[0] 1000
execute as @e[tag=init, limit=1] store result score @s mrcd_y0 run data get entity @s Pos[1] 1000
execute as @e[tag=init, limit=1] store result score @s mrcd_z0 run data get entity @s Pos[2] 1000
execute at @s anchored eyes run tp @e[tag=init, limit=1] ^ ^ ^ ~ ~
execute as @e[tag=init, limit=1] store result score #temp_x mrcd_system run data get entity @s Pos[0] 1000
execute as @e[tag=init, limit=1] store result score #temp_y mrcd_system run data get entity @s Pos[1] 1000
execute as @e[tag=init, limit=1] store result score #temp_z mrcd_system run data get entity @s Pos[2] 1000
scoreboard players operation @e[tag=init, limit=1] mrcd_x0 -= #temp_x mrcd_system
scoreboard players operation @e[tag=init, limit=1] mrcd_y0 -= #temp_y mrcd_system
scoreboard players operation @e[tag=init, limit=1] mrcd_z0 -= #temp_z mrcd_system
execute as @e[tag=init, limit=1] at @s run function mrcd:ray_tick
tag @e[tag=mrcd_target_entity] remove mrcd_target_entity
kill @e[tag=init]
已知稳定复现点位:
execute in minecraft:overworld run tp @s 17.13 -59.72 22.3 45.99 -0.0055
至execute in minecraft:overworld run tp @s 17.13 -59.72 22.3 45.99 -0.049
游戏版本:21w18a 与 1.16.5
数据包版本:2.2
朝向非完整方块进行检测,会返回完整方块的碰撞。
在我测试我新的异或算法的时候发现了这个问题。最开始我以为是我新异或算法的问题,但是随后的测试发现栅栏一类不需要异或参与计算的方块似乎都有这个问题。example里面的例子就会遇到。已测试过较早一些的2.1,但该版本并无问题,而且我异或算法放进2.1也能工作。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.