speclib/thirdpersoncontrol!
- 此数据包允许玩家通过 WASD、跳跃和潜行输入来控制第三人称视角下的实体!
- 此数据包仅适用于 1.21.4 及以上版本!
模块:
使用方法:
第三人称控制:
第三人称控制是该数据包的主要/核心模块,允许玩家使用 WASD 键控制实体。它通过新的 Player Input 谓词获取玩家输入,并计算将运动向量应用到实体的 Motion NBT 中。该数据包还允许玩家以第三人称视角旁观实体。相机位置在 tpc:gb/load 中进行初始化。在该函数文件中看到的所有实体都可以通过 WASD、跳跃和潜行进行控制。某些实体拥有特殊的控制方式,例如能够飞行的实体可以通过按住跳跃键来增加高度。
- 生成实体并在第三人称视角下控制:
/function tpc:summon {entity:"armor_stand"}
- 旁观具有特定标签的实体:
/function tpc:spectate {tag:"temp_tag"}
- 旁观具有特定标签的随机实体:
/function tpc:spectate_random {sub_tag:"temp_tag"}
- 取消旁观实体:
/function tpc:remove
Camera Interpolate(模块):
Camera Interpolate 模块允许用户插值到特定的 'X' 和 'Y' 旋转角度,并设置特定的 'SPEED' 值。当命令运行时,玩家相机会找到到达给定旋转坐标的最短路径,并按照提供的速度进行插值。该模块还允许玩家在控制实体和旁观实体之间切换。当旁观实体时,他们的相机每 10 秒会随机插值到一个随机方向。
- 插值相机:
/function camera:interpolate {"x":10,"y":30,"speed":200} // 速度值越大,插值越慢。
- 插值到随机方向:
/function camera:interpolate_random
- 从实体控制器切换到实体旁观者(反之亦然):
/function camera:toggle_control
speclib/thirdpersoncontrol!
- This datapack allows players to control entities in THIRD PERSON via WASD, Jump and Sneak INPUTS!
- This datapack only works in 1.21.4 and above!
Modules:
How to Use:
Third Person Control:
The Third Person Control is a part/main module of the datapack which allows players to control entities with WASD. It takes player input via the new Player Input predicates and calculates and applies Motion Vector into the Motion NBT of the entity. The datapack also allows players to spectate entities (in third person). The camera positions are initialized in tpc:gb/load. All entities seen in that function file are controllable with WASD, jump and sneak. Some entities have special controls, like the entities which can fly can gain altitude with holding down jump.
- Spawn Entity and Control In Third Person:
/function tpc:summon {entity:"armor_stand"}
- Spectate an Entity with a Specific Tag:
/function tpc:spectate {tag:"temp_tag"}
- Spectate a Random Entity with a Specific Tag:
/function tpc:spectate_random {sub_tag:"temp_tag"}
- Unspectate Entities:
/function tpc:remove
Camera Interpolate (Module):
The Camera Interpolate Module allows users to interpolate to a specific 'X' and 'Y' rotation, with a particular 'SPEED' value. When the command is ran, the player camera will find the shortest path to the given rotation coordinates and interpolate and the provided speed. The Module also allows players to switch from Controlling the Entity to Spectating It. When Spectating the Entity, their Camera will randomly interpolate to a random direction every 10 seconds.
- Interpolate Camera:
/function camera:interpolate {"x":10,"y":30,"speed":200} // Greater the Speed Value, Slower the Interpolation.
- Interpolate to a Random Direction:
/function camera:interpolate_random
- Toggle from Entity Controller → Entity Spectator (and vice versa):
/function camera:toggle_control
评论 0
登录后参与评分
还没有评论,来抢沙发吧