Serious lib 图标

Serious lib

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 2.0
本资源为搬运资源,原资源地址: https://modrinth.com/mod/serious-lib
资源信息

Minecraft 版本: 1.21.9 1.21.10

平台: datapack

标签: library

资源介绍

This is a library for use on the server legitimoose.com. Many functions won't work properly anywhere else (specifically the motion ones)!
This is a library designed mostly for my own use, but it's available in case anyone wants to use it for their own project :)

This library was designed to be as easy to use as possible. It focuses on functions I use often, such as raycasts and motion manipulation. Please note however that the ease of use and general applicability comes at the cost of optimisation - much of this (especially the raycast functions) could be done much more efficiently by a dedicated function.

The Functions

add_motion

Sets the motion of the entity to their current motion plus the input vector. Takes a relative coordinate (anything that works for a teleport command works here) as "vector". Example:

function serious_lib:motion/add_motion {"vector":"^ ^ ^1"}

This would add 1 to the motion of the executing entity in the direction faced.

set_motion

Sets the motion of the entity to the input vector, without maintaining current motion. Other than that works the same as add_motion.

relative_tp and relative_tp_data

Both teleport the player from a starting position (start_pos) to a finishing position (end_pos), maintaining their relative position to each point. relative_tp takes both fields as macros (and is fairly pointless) but relative_tp_data takes them through data storage, allowing for dynamic start and end points.

data modify serious_lib:motion start_pos set from entity @s Pos
data modify serious_lib:motion end_pos set value [0,0,0]
execute as @e[distance=..10] at @s run function serious_lib:motion/relative_tp_data

This would teleport all entities within 10 blocks so that the executing entity is positioned at 0, 0, 0, and all other entities retain their relative position to them.

raycasts

These are designed for ease of use over optimisation, and are likely horribly inefficient. They work by summoning area effect clouds with specific tags when hitting things: "entity" for an entity collision, "block" for a block collision, and "end" in addition to any other tags for wherever the raycast ends (even if it didn't hit anything.

scoreboard players set @s ray_length 100
execute anchored eyes positioned ^ ^ ^ run function serious_lib:raycast/particle/basic {"particle":"end_rod"}
execute at @n[type=area_effect_cloud,tag=entity] run damage @n[tag=!end]
execute at @n[type=area_effect_cloud,tag=block] run particle explosion

This would cast a 50 block ray from the executing entity's eyes, damaging the first entity it collided with, and creating explosion particles if it collides with a block.

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Waifu Mod

价格:0 墨喵币
下载量:0

查看详情
J&B Farm

价格:0 墨喵币
下载量:0

查看详情
Xenith's Beacon Infused Armor

价格:0 墨喵币
下载量:0

查看详情
DarkPvPv1

价格:0 墨喵币
下载量:0

查看详情