Files
netease-modsdk-wiki/docs/mcdocs/1-ModAPI/接口/玩家/动画.md
2025-03-17 13:24:39 +08:00

1.5 KiB
Raw Blame History

sidebarDepth
sidebarDepth
1

动画

PlayTpAnimation

客户端

method in mod.client.component.playerAnimCompClient.PlayerAnimCompClient

  • 描述

    第三人称视角播放玩家通用动作

  • 参数

    参数名
    数据类型
    说明
    anim str 动作名称如sneaking
  • 返回值

    数据类型
    说明
    bool 是否成功
  • 备注

    • 支持的动作包括sneaking、sneaking_inverted、swim、sleeping、holding_left、holding_right、crossbow_hold、crossbow_equipped、bow_equipped、upside_down、tp_attack
  • 示例

import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
comp.PlayTpAnimation("sneaking")

StopAnimation

客户端

method in mod.client.component.playerAnimCompClient.PlayerAnimCompClient

  • 描述

    停止播放玩家通用动作

  • 参数

    参数名
    数据类型
    说明
    anim str 动作名称如sneaking
  • 返回值

    数据类型
    说明
    bool 是否成功
  • 示例

import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
comp.StopAnimation("sneaking")