Files
2025-03-17 13:24:39 +08:00

73 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebarDepth: 1
---
# 动画
## PlayTpAnimation
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.playerAnimCompClient.PlayerAnimCompClient
- 描述
第三人称视角播放玩家通用动作
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| anim | str | 动作名称如sneaking |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 是否成功 |
- 备注
- 支持的动作包括sneaking、sneaking_inverted、swim、sleeping、holding_left、holding_right、crossbow_hold、crossbow_equipped、bow_equipped、upside_down、tp_attack
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
comp.PlayTpAnimation("sneaking")
```
## StopAnimation
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.playerAnimCompClient.PlayerAnimCompClient
- 描述
停止播放玩家通用动作
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| anim | str | 动作名称如sneaking |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 是否成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
comp.StopAnimation("sneaking")
```