2.6
This commit is contained in:
@@ -31,12 +31,13 @@ sidebarDepth: 1
|
||||
- [指令](#指令)
|
||||
- [消息](#消息)
|
||||
- [记分板](#记分板)
|
||||
- [行为](#行为)
|
||||
## 实体
|
||||
|
||||
- [实体类型](#实体类型)
|
||||
- [附加值](#附加值)
|
||||
- [属性](#属性)
|
||||
- [行为](#行为)
|
||||
- [行为](#行为1)
|
||||
- [状态效果](#状态效果)
|
||||
- [渲染](#渲染1)
|
||||
- [背包](#背包)
|
||||
@@ -52,7 +53,7 @@ sidebarDepth: 1
|
||||
## 玩家
|
||||
|
||||
- [属性](#属性1)
|
||||
- [行为](#行为1)
|
||||
- [行为](#行为2)
|
||||
- [渲染](#渲染2)
|
||||
- [背包](#背包1)
|
||||
- [摄像机](#摄像机)
|
||||
@@ -86,6 +87,10 @@ sidebarDepth: 1
|
||||
## 模型
|
||||
|
||||
- [模型](#模型-2)
|
||||
## 山头服务器
|
||||
|
||||
- [山头服务器](#山头服务器-2)
|
||||
|
||||
## 原生UI
|
||||
|
||||
- [原生UI](#原生ui-2)
|
||||
@@ -127,6 +132,9 @@ sidebarDepth: 1
|
||||
## 商城
|
||||
|
||||
- [商城](#商城-2)
|
||||
## 渲染
|
||||
|
||||
- [渲染](#渲染-2)
|
||||
|
||||
#### Component
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
@@ -541,6 +549,10 @@ sidebarDepth: 1
|
||||
| [GetAllPlayerScoreboardObjects](世界/记分板.md#getallplayerscoreboardobjects) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家记分项 |
|
||||
| [GetAllScoreboardObjects](世界/记分板.md#getallscoreboardobjects) | <span style="display:inline;color:#ff5555">服务端</span> | 获取所有记分板项 |
|
||||
| [GetAllScoreboardObjects](世界/记分板.md#getallscoreboardobjects) | <span style="display:inline;color:#7575f9">客户端</span> | 获取所有记分板项 |
|
||||
#### 行为
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [UseItemAttackEntity](世界/行为.md#useitemattackentity) | <span style="display:inline;color:#ff5555">服务端</span> | 使用指定物品攻击某个实体。 |
|
||||
#### 实体类型
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
@@ -644,7 +656,7 @@ sidebarDepth: 1
|
||||
| [SetVariant](实体/属性.md#setvariant) | <span style="display:inline;color:#ff5555">服务端</span> | 设置实体的变种属性值 |
|
||||
| [isEntityInLava](实体/属性.md#isentityinlava) | <span style="display:inline;color:#7575f9">客户端</span> | 实体是否在岩浆中 |
|
||||
| [isEntityOnGround](实体/属性.md#isentityonground) | <span style="display:inline;color:#7575f9">客户端</span> | 实体是否触地 |
|
||||
#### 行为
|
||||
#### 行为<span id = "行为1"></span>
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [AddActorComponent](实体/行为.md#addactorcomponent) | <span style="display:inline;color:#ff5555">服务端</span> | 给指定实体自定义添加实体Component |
|
||||
@@ -818,10 +830,12 @@ sidebarDepth: 1
|
||||
| [EvalMolangExpression](实体/molang.md#evalmolangexpression) | <span style="display:inline;color:#ff5555">服务端</span> | 在实体上下文上执行molang表达式 |
|
||||
| [EvalMolangExpression](实体/molang.md#evalmolangexpression) | <span style="display:inline;color:#7575f9">客户端</span> | 在实体上下文上执行molang表达式 |
|
||||
| [Get](实体/molang.md#get) | <span style="display:inline;color:#7575f9">客户端</span> | 获取某一个实体计算节点的值,如果不存在返回注册时的默认值 |
|
||||
| [GetAllProperties](实体/molang.md#getallproperties) | <span style="display:inline;color:#ff5555">服务端</span> | 获取实体属性列表 |
|
||||
| [GetMolangValue](实体/molang.md#getmolangvalue) | <span style="display:inline;color:#7575f9">客户端</span> | 获取实体molang变量的值 |
|
||||
| [GetStringHash64](实体/molang.md#getstringhash64) | <span style="display:inline;color:#7575f9">客户端</span> | 返回字符串变量的hash64 |
|
||||
| [Register](实体/molang.md#register) | <span style="display:inline;color:#7575f9">客户端</span> | 注册实体计算节点 |
|
||||
| [Set](实体/molang.md#set) | <span style="display:inline;color:#7575f9">客户端</span> | 设置某一个实体计算节点的值 |
|
||||
| [SetPropertyValue](实体/molang.md#setpropertyvalue) | <span style="display:inline;color:#ff5555">服务端</span> | 设置实体属性的值 |
|
||||
| [UnRegister](实体/molang.md#unregister) | <span style="display:inline;color:#7575f9">客户端</span> | 注销实体计算节点 |
|
||||
#### 标签
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
@@ -881,6 +895,10 @@ sidebarDepth: 1
|
||||
| [GetPlayerStarveTick](玩家/属性.md#getplayerstarvetick) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家饥饿掉血速度,当饥饿值小于饥饿临界值时会自动扣除血量,开启饥饿值且开启饥饿掉血时有效。原版默认值为80刻(即每4秒)扣除1点血量 |
|
||||
| [GetPlayerTotalExp](玩家/属性.md#getplayertotalexp) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家的总经验值 |
|
||||
| [GetPlayerTotalExp](玩家/属性.md#getplayertotalexp) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家的总经验值 |
|
||||
| [IsHighLevelMultiJointOfficialSkin](玩家/属性.md#ishighlevelmultijointofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为史诗及以上的多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsHighLevelOfficialSkin](玩家/属性.md#ishighlevelofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为史诗及以上的官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsMultiJointOfficialSkin](玩家/属性.md#ismultijointofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsOfficialSkin](玩家/属性.md#isofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsPlayerNaturalRegen](玩家/属性.md#isplayernaturalregen) | <span style="display:inline;color:#ff5555">服务端</span> | 是否开启玩家自然恢复,当饥饿值大于等于健康临界值时会自动恢复血量,开启饥饿值且开启自然恢复时有效。原版默认开启 |
|
||||
| [IsPlayerNaturalStarve](玩家/属性.md#isplayernaturalstarve) | <span style="display:inline;color:#ff5555">服务端</span> | 是否开启玩家饥饿掉血,当饥饿值小于饥饿临界值时会自动恢复血量,开启饥饿值且开启饥饿掉血时有效。原版默认开启 |
|
||||
| [SetEnchantmentSeed](玩家/属性.md#setenchantmentseed) | <span style="display:inline;color:#ff5555">服务端</span> | 设置玩家的附魔种子,该种子会决定附魔台上准备附魔的装备的附魔项 |
|
||||
@@ -897,7 +915,7 @@ sidebarDepth: 1
|
||||
| [SetPlayerTotalExp](玩家/属性.md#setplayertotalexp) | <span style="display:inline;color:#ff5555">服务端</span> | 设置玩家的总经验值 |
|
||||
| [Swing](玩家/属性.md#swing) | <span style="display:inline;color:#7575f9">客户端</span> | 本地玩家播放原版攻击动作 |
|
||||
| [getUid](玩家/属性.md#getuid) | <span style="display:inline;color:#7575f9">客户端</span> | 获取本地玩家的uid |
|
||||
#### 行为<span id = "行为1"></span>
|
||||
#### 行为<span id = "行为2"></span>
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [AddPlayerAroundEntityMotion](玩家/行为.md#addplayeraroundentitymotion) | <span style="display:inline;color:#ff5555">服务端</span> | 给玩家添加对实体环绕运动器 |
|
||||
@@ -927,6 +945,7 @@ sidebarDepth: 1
|
||||
| [IsOnLadder](玩家/行为.md#isonladder) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家是否在梯子/藤蔓上 |
|
||||
| [IsPlayerCanFly](玩家/行为.md#isplayercanfly) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家能否飞行 |
|
||||
| [IsPlayerFlying](玩家/行为.md#isplayerflying) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家是否在飞行 |
|
||||
| [OpenNeteaseContainer](玩家/行为.md#openneteasecontainer) | <span style="display:inline;color:#ff5555">服务端</span> | 打开自定义容器界面,不依赖于方块。该界面的物品数据需由开发者自行维护。 |
|
||||
| [OpenWorkBench](玩家/行为.md#openworkbench) | <span style="display:inline;color:#ff5555">服务端</span> | 在玩家当前位置打开工作台UI,不依赖于工作台方块 |
|
||||
| [PickUpItemEntity](玩家/行为.md#pickupitementity) | <span style="display:inline;color:#ff5555">服务端</span> | 某个Player拾取物品ItemEntity |
|
||||
| [PlayerAttackEntity](玩家/行为.md#playerattackentity) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家使用手持武器攻击某个生物 |
|
||||
@@ -1153,6 +1172,7 @@ sidebarDepth: 1
|
||||
| [AddDropItemToWorld](方块/渲染.md#adddropitemtoworld) | <span style="display:inline;color:#7575f9">客户端</span> | 在客户端添加一个掉落物渲染 |
|
||||
| [ChangeBlockTextures](方块/渲染.md#changeblocktextures) | <span style="display:inline;color:#7575f9">客户端</span> | 替换方块贴图 |
|
||||
| [DeleteClientDropItemEntity](方块/渲染.md#deleteclientdropitementity) | <span style="display:inline;color:#7575f9">客户端</span> | 删除AddDropItemToWorld创建的客户端掉落物 |
|
||||
| [DestroyCrackFrame](方块/渲染.md#destroycrackframe) | <span style="display:inline;color:#7575f9">客户端</span> | 销毁特定方块位置上的破坏纹理(仅能销毁SetCrackFrame接口创建的破坏纹理)。 |
|
||||
| [GetBlockEntityExtraUniforms](方块/渲染.md#getblockentityextrauniforms) | <span style="display:inline;color:#7575f9">客户端</span> | 获取在自定义方块实体的shader当中使用的自定义变量的值,该自定义变量总共可设置EXTRA_ACTOR_UNIFORM1,EXTRA_ACTOR_UNIFORM2,EXTRA_ACTOR_UNIFORM3,EXTRA_ACTOR_UNIFORM4,总共4组,每组为一个vec4(float, float, float ,float)类型的向量。 |
|
||||
| [GetBlockRenderDistance](方块/渲染.md#getblockrenderdistance) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家周围的可渲染距离 |
|
||||
| [GetBlockTextures](方块/渲染.md#getblocktextures) | <span style="display:inline;color:#7575f9">客户端</span> | 获取方块的初始贴图信息 |
|
||||
@@ -1164,6 +1184,8 @@ sidebarDepth: 1
|
||||
| [SetBlockEntityModelScale](方块/渲染.md#setblockentitymodelscale) | <span style="display:inline;color:#7575f9">客户端</span> | 设置自定义方块实体的实体模型大小的缩放值,可通过该接口来调整自定义方块实体的实体模型的大小。只有自定义方块实体定义实体模型才生效,实体模型在resource_pack/entity/下定义,详细可参考自定义方块实体动画的教学文档。 |
|
||||
| [SetBlockEntityParticlePosOffset](方块/渲染.md#setblockentityparticleposoffset) | <span style="display:inline;color:#7575f9">客户端</span> | 设置自定义方块实体中粒子特效位置偏移值,用于调整粒子特效相对于方块位置的偏移。与特效/粒子/SetPos接口不同,该接口调整的是相对于方块位置的位置偏移值,而不是世界坐标。 |
|
||||
| [SetBlockRenderDistance](方块/渲染.md#setblockrenderdistance) | <span style="display:inline;color:#7575f9">客户端</span> | 设置玩家周围方块的可渲染距离 |
|
||||
| [SetCrackFrame](方块/渲染.md#setcrackframe) | <span style="display:inline;color:#7575f9">客户端</span> | 仅客户端的破坏纹理的渲染,可自定义破坏阶段在第几帧。 |
|
||||
| [SetDropItemTransform](方块/渲染.md#setdropitemtransform) | <span style="display:inline;color:#7575f9">客户端</span> | 设置通过AddDropItemToWorld添加的掉落物的位置、角度和缩放 |
|
||||
#### 容器
|
||||
| 接口| <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
@@ -1420,7 +1442,10 @@ sidebarDepth: 1
|
||||
| [ShowModel](模型.md#showmodel) | <span style="display:inline;color:#7575f9">客户端</span> | 显示纯模型 |
|
||||
| [UnBindModelToEntity](模型.md#unbindmodeltoentity) | <span style="display:inline;color:#7575f9">客户端</span> | 取消实体上挂接的某个骨骼模型。取消挂接后,这个modelId的模型便会销毁,无法再使用,如果是临时隐藏可以使用HideModel |
|
||||
| [UnBindModelToModel](模型.md#unbindmodeltomodel) | <span style="display:inline;color:#7575f9">客户端</span> | 取消骨骼模型上挂接的某个骨骼模型。取消挂接后,这个modelId的模型便会销毁,无法再使用,如果是临时隐藏可以使用HideModel |
|
||||
|
||||
#### 山头服务器<span id = "山头服务器2"></span>
|
||||
| 接口 | <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [GetHostPlayerUid](山头服务器.md#gethostplayeruid) | <span style="display:inline;color:#ff5555">服务端</span> | 获取服务器拥有者的uid。 |
|
||||
#### 原生UI<span id = "原生UI2"></span>
|
||||
| 接口 | <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
@@ -1447,7 +1472,6 @@ sidebarDepth: 1
|
||||
| [HideMoveGui](原生UI.md#hidemovegui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中左下角的移动按钮。隐藏后点击相应位置不会响应 |
|
||||
| [HideNeteaseStoreGui](原生UI.md#hideneteasestoregui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中的网易商店按钮。隐藏后点击相应位置不会响应 |
|
||||
| [HidePauseGUI](原生UI.md#hidepausegui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏暂停按钮原生UI。 |
|
||||
| [HideReportGUI](原生UI.md#hidereportgui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏举报按钮原生UI。 |
|
||||
| [HideSlotBarGui](原生UI.md#hideslotbargui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中底部中间的物品栏界面 |
|
||||
| [HideSneakGui](原生UI.md#hidesneakgui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中左下角方向键的中心处潜行按钮。隐藏后点击相应位置不会响应 |
|
||||
| [HideSwimGui](原生UI.md#hideswimgui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中的浮潜按钮。隐藏后点击相应位置不会响应。 |
|
||||
@@ -1917,3 +1941,36 @@ sidebarDepth: 1
|
||||
| [OpenShopWindow](商城.md#openshopwindow) | <span style="display:inline;color:#7575f9">客户端</span> | 打开网易商城窗口。PC端无效(Apollo的PC端请使用商城插件) |
|
||||
| [ShowShopGate](商城.md#showshopgate) | <span style="display:inline;color:#7575f9">客户端</span> | 显示网易商城入口 |
|
||||
|
||||
#### 渲染<span id = "渲染2"></span>
|
||||
| 接口 | <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [AddArrowShape](渲染.md#addarrowshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建箭头形状 |
|
||||
| [AddBoxShape](渲染.md#addboxshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建盒子形状 |
|
||||
| [AddCircleShape](渲染.md#addcircleshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建圆形状 |
|
||||
| [AddLineShape](渲染.md#addlineshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建线条形状 |
|
||||
| [AddSphereShape](渲染.md#addsphereshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建球形状 |
|
||||
| [AddTextShape](渲染.md#addtextshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建文本形状 |
|
||||
| [GetBoxScale](渲染.md#getboxscale) | <span style="display:inline;color:#7575f9">客户端</span> | 获取BoxShape的大小 |
|
||||
| [GetColor](渲染.md#getcolor) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的颜色 |
|
||||
| [GetEndPos](渲染.md#getendpos) | <span style="display:inline;color:#7575f9">客户端</span> | 获取LineShape或ArrowShape的结束位置 |
|
||||
| [GetLength](渲染.md#getlength) | <span style="display:inline;color:#7575f9">客户端</span> | 获取ArrowShape的头部长度 |
|
||||
| [GetPos](渲染.md#getpos) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的位置 |
|
||||
| [GetPriority](渲染.md#getpriority) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的优先级 |
|
||||
| [GetRadius](渲染.md#getradius) | <span style="display:inline;color:#7575f9">客户端</span> | 获取CircleShape或ArrowShape或SphereShape的半径 |
|
||||
| [GetSegments](渲染.md#getsegments) | <span style="display:inline;color:#7575f9">客户端</span> | 获取CircleShape或ArrowShape头部的分段数 |
|
||||
| [GetText](渲染.md#gettext) | <span style="display:inline;color:#7575f9">客户端</span> | 获取TextShape的文本 |
|
||||
| [GetType](渲染.md#gettype) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的类型 |
|
||||
| [GetVisible](渲染.md#getvisible) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape是否可见 |
|
||||
| [Remove](渲染.md#remove) | <span style="display:inline;color:#7575f9">客户端</span> | 删除Shape |
|
||||
| [RemoveAll](渲染.md#removeall) | <span style="display:inline;color:#7575f9">客户端</span> | 删除当前所有Shape |
|
||||
| [SetBoxScale](渲染.md#setboxscale) | <span style="display:inline;color:#7575f9">客户端</span> | 设置BoxShape的大小 |
|
||||
| [SetColor](渲染.md#setcolor) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape的颜色 |
|
||||
| [SetEndPos](渲染.md#setendpos) | <span style="display:inline;color:#7575f9">客户端</span> | 设置LineShape或ArrowShape的结束位置 |
|
||||
| [SetLength](渲染.md#setlength) | <span style="display:inline;color:#7575f9">客户端</span> | 设置组成ArrowShape头部的长度 |
|
||||
| [SetPos](渲染.md#setpos) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape的位置 |
|
||||
| [SetPriority](渲染.md#setpriority) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape的渲染优先级, 同一像素点处优先渲染优先级高的Shape, 默认为0 |
|
||||
| [SetRadius](渲染.md#setradius) | <span style="display:inline;color:#7575f9">客户端</span> | 设置CircleShape或ArrowShape或SphereShape的半径 |
|
||||
| [SetSegments](渲染.md#setsegments) | <span style="display:inline;color:#7575f9">客户端</span> | 设置组成ArrowShape头部的网格数量, 最小为3 |
|
||||
| [SetText](渲染.md#settext) | <span style="display:inline;color:#7575f9">客户端</span> | 设置TextShape的文本内容 |
|
||||
| [SetVisible](渲染.md#setvisible) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape是否可见 |
|
||||
|
||||
|
||||
@@ -297,6 +297,7 @@ method in mod.server.component.blockCompServer.BlockCompServer
|
||||
- 备注
|
||||
- 注意:该pattern不限定方向,只要能在任一平面上组合成功就能合成对应的实体。
|
||||
- 如示例代码所示,不需要放方块的位置需要显式定义为空气方块
|
||||
- 如示例代码所示,如果填了空格,表示该位置可以匹配任意方块
|
||||
- 当引擎中已注册过相同的pattern和defines时,该接口不会更新result_actor_name,并返回False
|
||||
- namespace:name:aux_value,当aux_value不填或者填*时为通配,如果有具体aux_value时只匹配特定方块
|
||||
如'minecraft:wood'、'minecraft:wood:*'均通配木头,而'minecraft:wood:0'只匹配橡木。
|
||||
@@ -318,6 +319,11 @@ defines ={
|
||||
}
|
||||
comp.RegisterBlockPatterns(pattern,defines,'minecraft:chicken')
|
||||
#该例子左中右下放铁块,上面放金块,会生成一只鸡
|
||||
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreateBlock(playerId)
|
||||
value = comp.RegisterBlockPatterns(['# #'],{'#': 'minecraft:iron_block'},'minecraft:cat')
|
||||
#该例子中,玩家左右放俩铁块,无论中间是空气还是任意方块,均可生成一只猫
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ sidebarDepth: 1
|
||||
- [指令](#指令)
|
||||
- [消息](#消息)
|
||||
- [记分板](#记分板)
|
||||
- [行为](#行为)
|
||||
|
||||
### 地图
|
||||
|
||||
@@ -328,3 +329,9 @@ sidebarDepth: 1
|
||||
| [GetAllScoreboardObjects](记分板.md#getallscoreboardobjects) | <span style="display:inline;color:#ff5555">服务端</span> | 获取所有记分板项 |
|
||||
| [GetAllScoreboardObjects](记分板.md#getallscoreboardobjects) | <span style="display:inline;color:#7575f9">客户端</span> | 获取所有记分板项 |
|
||||
|
||||
### 行为
|
||||
|
||||
| 接口 | <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [UseItemAttackEntity](行为.md#useitemattackentity) | <span style="display:inline;color:#ff5555">服务端</span> | 使用指定物品攻击某个实体。 |
|
||||
|
||||
|
||||
56
docs/mcdocs/1-ModAPI/接口/世界/行为.md
Normal file
56
docs/mcdocs/1-ModAPI/接口/世界/行为.md
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
sidebarDepth: 1
|
||||
---
|
||||
# 行为
|
||||
|
||||
## UseItemAttackEntity
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
method in mod.server.component.gameCompServer.GameComponentServer
|
||||
|
||||
- 描述
|
||||
|
||||
使用指定物品攻击某个实体。
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 物品字典数据 |
|
||||
| entityId | str | 攻击实体id |
|
||||
| cause | str | 伤害类型,默认值是EntityAttack,详见Minecraft枚举值文档的[ActorDamageCause](../../枚举值/ActorDamageCause.md) |
|
||||
| attackerPos | tuple(float,float,float) | 伤害来源坐标,默认值为None,该参数会影响击退效果的计算 |
|
||||
| knocked | bool | 是否击退,默认值为False,如果设置为True,需同时设置attackerPos |
|
||||
| customTag | str | 标识自定义伤害来源,只在cause为Custom生效,可在ActorHurtServerEvent、ActuallyHurtServerEvent、DamageEvent、PlayerHurtEvent、PlayerDieEvent、MobDieEvent监听到标识 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| dict | 成功:返回使用过后的物品字典;失败:返回None |
|
||||
|
||||
- 备注
|
||||
- 无攻击力的物品,将会没有伤害。
|
||||
- 有耐久的物品在攻击后,将会扣除部分耐久。
|
||||
- 可通过DamageEvent等事件修改伤害值。
|
||||
- 如果itemDict写入了不可添加到该物品的附魔,该附魔效果将不会生效,返回的itemDict也不会带有该附魔信息。如果有需求,可考虑将附魔信息写入userData。
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
levelId = serverApi.GetLevelId()
|
||||
comp = serverApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
itemDict = {
|
||||
"newItemName": "minecraft:iron_sword",
|
||||
"newAuxValue": 0,
|
||||
"count": 1,
|
||||
"durability": 256,
|
||||
"enchantData": [(9,1)]
|
||||
}
|
||||
print(comp.UseItemAttackEntity(itemDict, entityId))
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ sidebarDepth: 1
|
||||
| [HideMoveGui](原生UI.md#hidemovegui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中左下角的移动按钮。隐藏后点击相应位置不会响应 |
|
||||
| [HideNeteaseStoreGui](原生UI.md#hideneteasestoregui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中的网易商店按钮。隐藏后点击相应位置不会响应 |
|
||||
| [HidePauseGUI](原生UI.md#hidepausegui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏暂停按钮原生UI。 |
|
||||
| [HideReportGUI](原生UI.md#hidereportgui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏举报按钮原生UI。 |
|
||||
| [HideSlotBarGui](原生UI.md#hideslotbargui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中底部中间的物品栏界面 |
|
||||
| [HideSneakGui](原生UI.md#hidesneakgui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中左下角方向键的中心处潜行按钮。隐藏后点击相应位置不会响应 |
|
||||
| [HideSwimGui](原生UI.md#hideswimgui) | <span style="display:inline;color:#7575f9">客户端</span> | 隐藏游戏中的浮潜按钮。隐藏后点击相应位置不会响应。 |
|
||||
@@ -773,35 +772,6 @@ clientApi.HidePauseGUI(True)
|
||||
|
||||
|
||||
|
||||
## HideReportGUI
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.extraClientApi
|
||||
|
||||
- 描述
|
||||
|
||||
隐藏举报按钮原生UI。
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| isHide | bool | 是否隐藏,True为隐藏,False为显示 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
clientApi.HideReportGUI(True)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## HideSlotBarGui
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
@@ -107,6 +107,39 @@ result = comp.Get('query.mod.state')
|
||||
|
||||
|
||||
|
||||
## GetAllProperties
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
method in mod.server.component.queryVariableCompServer.QueryVariableComponentServer
|
||||
|
||||
- 描述
|
||||
|
||||
获取实体属性列表
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| tuple(str) | 所有已注册properties,每个str为properties的名称,如果有错误,返回None |
|
||||
|
||||
- 备注
|
||||
- 可配合query.property,使用EvalMolangExpression获取实体属性的值。在客户端只能获取到client_sync为true的属性
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreateQueryVariable(entityId)
|
||||
result = comp.GetAllProperties()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetMolangValue
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
@@ -251,6 +284,42 @@ result = comp.Set('query.mod.state', 1.0)
|
||||
|
||||
|
||||
|
||||
## SetPropertyValue
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
method in mod.server.component.queryVariableCompServer.QueryVariableComponentServer
|
||||
|
||||
- 描述
|
||||
|
||||
设置实体属性的值
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| propertyName | str | 属性名,如minecraft:has_nectar |
|
||||
| value | str/int/float/bool | 属性值支持int/float/bool/enum(str),支持molang表达式 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 是否执行成功 |
|
||||
|
||||
- 备注
|
||||
- molang表达式需无副作用, 例如不能设置molang变量的值,例如"variable.moo = 1;return variable.moo;"。query仅支持query.has_property、query.property
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreateQueryVariable(entityId)
|
||||
result = comp.SetPropertyValue('minecraft:has_nectar', True)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## UnRegister
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
@@ -320,10 +320,12 @@ sidebarDepth: 1
|
||||
| [EvalMolangExpression](molang.md#evalmolangexpression) | <span style="display:inline;color:#ff5555">服务端</span> | 在实体上下文上执行molang表达式 |
|
||||
| [EvalMolangExpression](molang.md#evalmolangexpression) | <span style="display:inline;color:#7575f9">客户端</span> | 在实体上下文上执行molang表达式 |
|
||||
| [Get](molang.md#get) | <span style="display:inline;color:#7575f9">客户端</span> | 获取某一个实体计算节点的值,如果不存在返回注册时的默认值 |
|
||||
| [GetAllProperties](molang.md#getallproperties) | <span style="display:inline;color:#ff5555">服务端</span> | 获取实体属性列表 |
|
||||
| [GetMolangValue](molang.md#getmolangvalue) | <span style="display:inline;color:#7575f9">客户端</span> | 获取实体molang变量的值 |
|
||||
| [GetStringHash64](molang.md#getstringhash64) | <span style="display:inline;color:#7575f9">客户端</span> | 返回字符串变量的hash64 |
|
||||
| [Register](molang.md#register) | <span style="display:inline;color:#7575f9">客户端</span> | 注册实体计算节点 |
|
||||
| [Set](molang.md#set) | <span style="display:inline;color:#7575f9">客户端</span> | 设置某一个实体计算节点的值 |
|
||||
| [SetPropertyValue](molang.md#setpropertyvalue) | <span style="display:inline;color:#ff5555">服务端</span> | 设置实体属性的值 |
|
||||
| [UnRegister](molang.md#unregister) | <span style="display:inline;color:#7575f9">客户端</span> | 注销实体计算节点 |
|
||||
|
||||
### 标签
|
||||
|
||||
@@ -2383,6 +2383,7 @@ method in mod.server.component.attrCompServer.AttrCompServer
|
||||
- 为了避免因浮点数误差导致错误,设置的时候通常会增加1/16个方块大小,即0.0625。所以此处我们设置2.0625。游戏中默认值是0.5625,即半格高度。
|
||||
- 只对玩家生效,无法修改其它实体该属性
|
||||
- 修改后不影响跳跃逻辑及跳跃高度,并不会因此而跳到更高,因此在某些特定情况下,你可以走上方块但跳不上去。
|
||||
- 设置的步长值较大时,可能会存在可以跨到方块顶部,却走不到方块中间空隙的特殊情况。
|
||||
|
||||
- 示例
|
||||
|
||||
|
||||
43
docs/mcdocs/1-ModAPI/接口/山头服务器.md
Normal file
43
docs/mcdocs/1-ModAPI/接口/山头服务器.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
sidebarDepth: 1
|
||||
---
|
||||
# 山头服务器
|
||||
|
||||
# 索引
|
||||
|
||||
---
|
||||
|
||||
| 接口 | <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [GetHostPlayerUid](山头服务器.md#gethostplayeruid) | <span style="display:inline;color:#ff5555">服务端</span> | 获取服务器拥有者的uid。 |
|
||||
|
||||
## GetHostPlayerUid
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
method in mod.server.component.domainGameCompServer.DomainGameCompServer
|
||||
|
||||
- 描述
|
||||
|
||||
获取服务器拥有者的uid。
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| int | 服务器拥有者uid |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreateDomainGame(levelId)
|
||||
uid = comp.GetHostPlayerUid()
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -341,8 +341,9 @@ method in mod.server.component.itemCompServer.ItemCompServer
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家id |
|
||||
| slot | int | 容器槽位,含义见:[容器类型枚举](../../枚举值/PlayerUISlot.md) |
|
||||
| slot | int | 容器槽位。在isNeteaseUI为True时代表netease_ui_container中对应槽位;isNeteaseUI为False时含义见:[容器类型枚举](../../枚举值/PlayerUISlot.md) |
|
||||
| getUserData | bool | 是否获取userData,默认为False |
|
||||
| isNeteaseUI | bool | 默认为false,true时获取netease_ui_container的物品 |
|
||||
|
||||
- 返回值
|
||||
|
||||
@@ -352,7 +353,7 @@ method in mod.server.component.itemCompServer.ItemCompServer
|
||||
|
||||
- 备注
|
||||
- 合成容器包括工作台、铁砧、附魔台、织布机、砂轮、切石机、制图台、锻造台。
|
||||
- 所有合成容器槽位共享,不会根据不同容器重新排列
|
||||
- 所有合成容器槽位共享,不会根据不同容器重新排列。网易ui容器独立于原版合成容器,不同自定义容器中的netease_ui_container共享槽位。
|
||||
|
||||
- 示例
|
||||
|
||||
@@ -523,9 +524,10 @@ method in mod.server.component.itemCompServer.ItemCompServer
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家id |
|
||||
| slot | int | 容器槽位,含义见:[容器类型枚举](../../枚举值/PlayerUISlot.md) |
|
||||
| slot | int | 容器槽位。在isNeteaseUI为True时代表netease_ui_container中对应槽位;isNeteaseUI为False时含义见:[容器类型枚举](../../枚举值/PlayerUISlot.md) |
|
||||
| itemDict | dict | <a href="../../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a>,没有物品则返回None |
|
||||
| needBack | bool | 是否将容器槽位的已有物品放回至玩家背包中,默认为True。设置为False时,则会直接用itemDict中的物品覆盖容器槽位的已有物品。 |
|
||||
| isNeteaseUI | bool | 默认为false,true时设置netease_ui_container的物品 |
|
||||
|
||||
- 返回值
|
||||
|
||||
@@ -537,6 +539,7 @@ method in mod.server.component.itemCompServer.ItemCompServer
|
||||
- 合成容器包括工作台、铁砧、附魔台、织布机、砂轮、切石机、制图台、锻造台。
|
||||
- 如果原槽位有物品,则会将原有物品放入玩家背包。如果玩家背包已满,则会在世界中玩家当前的位置生成对应的物品掉落物。
|
||||
- 注意,所有合成容器槽位共享,不会根据不同容器重新排列,没有打开容器或者打开了别的容器,该接口会返回False。
|
||||
- 如果设置的是netease_ui_container,即使没有打开容器也能设置成功,所有netease_ui_container槽位共享。
|
||||
- 下面情况视为清空特定槽位:itemDict为None,为{}, 或itemName为minecraft:air,或者count为0,同时needBack参数为False
|
||||
- 由于创造输出物品生成位比较特殊,该接口已经屏蔽了slot = 50的情况,即无法设置创造输出位的物品。
|
||||
|
||||
@@ -584,7 +587,7 @@ method in mod.server.component.itemCompServer.ItemCompServer
|
||||
- 备注
|
||||
- 此接口不支持末影箱。对应的末影箱接口请参考 [SpawnItemToEnderChest](#spawnitemtoenderchest)
|
||||
- 下面情况视为清空特定槽位:itemDict为空,为{}, 或itemName为minecraft:air,或者count为0
|
||||
- 目前该接口支持的容器类型方块:箱子、潜影盒、漏斗、木桶、投掷器、发射器
|
||||
- 目前该接口支持的容器类型方块:箱子、潜影盒、漏斗、木桶、投掷器、发射器、自定义容器
|
||||
|
||||
- 示例
|
||||
|
||||
|
||||
@@ -133,8 +133,8 @@ method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(levelId)
|
||||
blockDict = comp.SetBlockBasicInfo("minecraft:stone", {"blockLightEmission":1,
|
||||
"blockLightAbsorption":1,
|
||||
blockDict = comp.SetBlockBasicInfo("custom:custom_block", {"destroyTime":1,
|
||||
"loot":"loot_tables/block/custom_block_drop.json",
|
||||
"solid":False,
|
||||
"tier":{"level":3}})
|
||||
```
|
||||
|
||||
@@ -123,6 +123,43 @@ print comp.DeleteClientDropItemEntity(entityId)
|
||||
|
||||
|
||||
|
||||
## DestroyCrackFrame
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.blockInfoCompClient.BlockInfoComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
销毁特定方块位置上的破坏纹理(仅能销毁SetCrackFrame接口创建的破坏纹理)。
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| dimensionId | int | 方块所在维度。 |
|
||||
| blockPos | tuple(int,int,int) | 目标方块的坐标。 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 是否执行成功。 |
|
||||
|
||||
- 备注
|
||||
- 如果方块被替换,需开发者主动销毁裂纹
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateBlockInfo(levelId)
|
||||
# 销毁位置(30,66,30)的破坏纹理
|
||||
comp.DestroyCrackFrame(0, (30, 66, 30))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetBlockEntityExtraUniforms
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
@@ -444,7 +481,7 @@ method in mod.client.component.blockInfoCompClient.BlockInfoComponentClient
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| pos | tuple(int,int,int) | 方块所在位置 |
|
||||
| scale | tuple(int,int,int) | 实体模型在x,y,z各个轴上的缩放值。支持负值,当某一轴的缩放值为负值时,表示模型将会在这个轴上进行以另外两个轴为对称平面的镜像变换。 |
|
||||
| scale | tuple(float,float,float) | 实体模型在x,y,z各个轴上的缩放值。支持负值,当某一轴的缩放值为负值时,表示模型将会在这个轴上进行以另外两个轴为对称平面的镜像变换。 |
|
||||
|
||||
- 返回值
|
||||
|
||||
@@ -454,7 +491,7 @@ method in mod.client.component.blockInfoCompClient.BlockInfoComponentClient
|
||||
|
||||
- 备注
|
||||
- 模型的大小可以通过两个方式来调整:
|
||||
(1) 在entity.json中scripts字段下定义scale,如下所示
|
||||
(1) 在entity.json中scripts字段下定义scale,如下所示:
|
||||
"minecraft:client_entity": {
|
||||
...
|
||||
"scripts":{
|
||||
@@ -549,3 +586,79 @@ print comp.SetBlockRenderDistance(48)
|
||||
|
||||
|
||||
|
||||
## SetCrackFrame
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.blockInfoCompClient.BlockInfoComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
仅客户端的破坏纹理的渲染,可自定义破坏阶段在第几帧。
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| dimensionId | int | 方块所在维度。 |
|
||||
| blockPos | tuple(int,int,int) | 目标方块的坐标。 |
|
||||
| frame | int | 第几张纹理(取值范围0-9)。 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 是否执行成功(不代表必定能显示裂纹)。 |
|
||||
|
||||
- 备注
|
||||
- 目前自定义方块实体外观,不支持裂纹的显示(client_entity、netease_model)。
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateBlockInfo(levelId)
|
||||
# 在(30,66,30)这个位置播放破坏方块的纹理,进度为1
|
||||
comp.SetCrackFrame(0, (30, 66, 30), 1)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetDropItemTransform
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.itemCompClient.ItemCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置通过AddDropItemToWorld添加的掉落物的位置、角度和缩放
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| entityId | str | 掉落物的entityId,entityId可在调用[AddDropItemToWorld](#AddDropItemToWorld)时保存返回值,或者通过[GetClientDropItemEntityIdList](#GetClientDropItemEntityIdList)接口获取list |
|
||||
| position | tuple(float,float,float) | 生成的掉落物所在位置。如需设置后续参数需填写None占位,传None表示不修改 |
|
||||
| rotation | tuple(float,float,float) | 选填,设置掉落物的角度,不填默认为None,设置rotation后将会固定角度[AddDropItemToWorld](#AddDropItemToWorld)设置的spinSpeed无效。如需设置后续参数需填写None占位,传None表示不修改 |
|
||||
| scale | float | 选填,设置掉落物的缩放,不填默认为None,传None表示不修改 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 是否成功 |
|
||||
|
||||
- 备注
|
||||
- Scale不能为负数,设置过大可能会导致掉落物消失,同时Scale过大会出现某些摄像机视角不会渲染的情况
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateItem(levelId)
|
||||
print comp.SetDropItemTransform(entityId, (10, 10, 10), (90, 45, 30), 1.5) # entityId需要AddDropItemToWorld接口获取
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ sidebarDepth: 1
|
||||
| [AddDropItemToWorld](渲染.md#adddropitemtoworld) | <span style="display:inline;color:#7575f9">客户端</span> | 在客户端添加一个掉落物渲染 |
|
||||
| [ChangeBlockTextures](渲染.md#changeblocktextures) | <span style="display:inline;color:#7575f9">客户端</span> | 替换方块贴图 |
|
||||
| [DeleteClientDropItemEntity](渲染.md#deleteclientdropitementity) | <span style="display:inline;color:#7575f9">客户端</span> | 删除AddDropItemToWorld创建的客户端掉落物 |
|
||||
| [DestroyCrackFrame](渲染.md#destroycrackframe) | <span style="display:inline;color:#7575f9">客户端</span> | 销毁特定方块位置上的破坏纹理(仅能销毁SetCrackFrame接口创建的破坏纹理)。 |
|
||||
| [GetBlockEntityExtraUniforms](渲染.md#getblockentityextrauniforms) | <span style="display:inline;color:#7575f9">客户端</span> | 获取在自定义方块实体的shader当中使用的自定义变量的值,该自定义变量总共可设置EXTRA_ACTOR_UNIFORM1,EXTRA_ACTOR_UNIFORM2,EXTRA_ACTOR_UNIFORM3,EXTRA_ACTOR_UNIFORM4,总共4组,每组为一个vec4(float, float, float ,float)类型的向量。 |
|
||||
| [GetBlockRenderDistance](渲染.md#getblockrenderdistance) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家周围的可渲染距离 |
|
||||
| [GetBlockTextures](渲染.md#getblocktextures) | <span style="display:inline;color:#7575f9">客户端</span> | 获取方块的初始贴图信息 |
|
||||
@@ -115,6 +116,8 @@ sidebarDepth: 1
|
||||
| [SetBlockEntityModelScale](渲染.md#setblockentitymodelscale) | <span style="display:inline;color:#7575f9">客户端</span> | 设置自定义方块实体的实体模型大小的缩放值,可通过该接口来调整自定义方块实体的实体模型的大小。只有自定义方块实体定义实体模型才生效,实体模型在resource_pack/entity/下定义,详细可参考自定义方块实体动画的教学文档。 |
|
||||
| [SetBlockEntityParticlePosOffset](渲染.md#setblockentityparticleposoffset) | <span style="display:inline;color:#7575f9">客户端</span> | 设置自定义方块实体中粒子特效位置偏移值,用于调整粒子特效相对于方块位置的偏移。与特效/粒子/SetPos接口不同,该接口调整的是相对于方块位置的位置偏移值,而不是世界坐标。 |
|
||||
| [SetBlockRenderDistance](渲染.md#setblockrenderdistance) | <span style="display:inline;color:#7575f9">客户端</span> | 设置玩家周围方块的可渲染距离 |
|
||||
| [SetCrackFrame](渲染.md#setcrackframe) | <span style="display:inline;color:#7575f9">客户端</span> | 仅客户端的破坏纹理的渲染,可自定义破坏阶段在第几帧。 |
|
||||
| [SetDropItemTransform](渲染.md#setdropitemtransform) | <span style="display:inline;color:#7575f9">客户端</span> | 设置通过AddDropItemToWorld添加的掉落物的位置、角度和缩放 |
|
||||
|
||||
### 容器
|
||||
|
||||
|
||||
989
docs/mcdocs/1-ModAPI/接口/渲染.md
Normal file
989
docs/mcdocs/1-ModAPI/接口/渲染.md
Normal file
@@ -0,0 +1,989 @@
|
||||
---
|
||||
sidebarDepth: 1
|
||||
---
|
||||
# 渲染
|
||||
|
||||
# 索引
|
||||
|
||||
---
|
||||
|
||||
| 接口 | <div style="width: 3em"></div> | 描述 |
|
||||
| --- | --- | --- |
|
||||
| [AddArrowShape](渲染.md#addarrowshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建箭头形状 |
|
||||
| [AddBoxShape](渲染.md#addboxshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建盒子形状 |
|
||||
| [AddCircleShape](渲染.md#addcircleshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建圆形状 |
|
||||
| [AddLineShape](渲染.md#addlineshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建线条形状 |
|
||||
| [AddSphereShape](渲染.md#addsphereshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建球形状 |
|
||||
| [AddTextShape](渲染.md#addtextshape) | <span style="display:inline;color:#7575f9">客户端</span> | 新建文本形状 |
|
||||
| [GetBoxScale](渲染.md#getboxscale) | <span style="display:inline;color:#7575f9">客户端</span> | 获取BoxShape的大小 |
|
||||
| [GetColor](渲染.md#getcolor) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的颜色 |
|
||||
| [GetEndPos](渲染.md#getendpos) | <span style="display:inline;color:#7575f9">客户端</span> | 获取LineShape或ArrowShape的结束位置 |
|
||||
| [GetLength](渲染.md#getlength) | <span style="display:inline;color:#7575f9">客户端</span> | 获取ArrowShape的头部长度 |
|
||||
| [GetPos](渲染.md#getpos) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的位置 |
|
||||
| [GetPriority](渲染.md#getpriority) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的优先级 |
|
||||
| [GetRadius](渲染.md#getradius) | <span style="display:inline;color:#7575f9">客户端</span> | 获取CircleShape或ArrowShape或SphereShape的半径 |
|
||||
| [GetSegments](渲染.md#getsegments) | <span style="display:inline;color:#7575f9">客户端</span> | 获取CircleShape或ArrowShape头部的分段数 |
|
||||
| [GetText](渲染.md#gettext) | <span style="display:inline;color:#7575f9">客户端</span> | 获取TextShape的文本 |
|
||||
| [GetType](渲染.md#gettype) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape的类型 |
|
||||
| [GetVisible](渲染.md#getvisible) | <span style="display:inline;color:#7575f9">客户端</span> | 获取Shape是否可见 |
|
||||
| [Remove](渲染.md#remove) | <span style="display:inline;color:#7575f9">客户端</span> | 删除Shape |
|
||||
| [RemoveAll](渲染.md#removeall) | <span style="display:inline;color:#7575f9">客户端</span> | 删除当前所有Shape |
|
||||
| [SetBoxScale](渲染.md#setboxscale) | <span style="display:inline;color:#7575f9">客户端</span> | 设置BoxShape的大小 |
|
||||
| [SetColor](渲染.md#setcolor) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape的颜色 |
|
||||
| [SetEndPos](渲染.md#setendpos) | <span style="display:inline;color:#7575f9">客户端</span> | 设置LineShape或ArrowShape的结束位置 |
|
||||
| [SetLength](渲染.md#setlength) | <span style="display:inline;color:#7575f9">客户端</span> | 设置组成ArrowShape头部的长度 |
|
||||
| [SetPos](渲染.md#setpos) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape的位置 |
|
||||
| [SetPriority](渲染.md#setpriority) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape的渲染优先级, 同一像素点处优先渲染优先级高的Shape, 默认为0 |
|
||||
| [SetRadius](渲染.md#setradius) | <span style="display:inline;color:#7575f9">客户端</span> | 设置CircleShape或ArrowShape或SphereShape的半径 |
|
||||
| [SetSegments](渲染.md#setsegments) | <span style="display:inline;color:#7575f9">客户端</span> | 设置组成ArrowShape头部的网格数量, 最小为3 |
|
||||
| [SetText](渲染.md#settext) | <span style="display:inline;color:#7575f9">客户端</span> | 设置TextShape的文本内容 |
|
||||
| [SetVisible](渲染.md#setvisible) | <span style="display:inline;color:#7575f9">客户端</span> | 设置Shape是否可见 |
|
||||
|
||||
## AddArrowShape
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
新建箭头形状
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| startPos | tuple(float,float,float) | 箭头形状的起始位置 |
|
||||
| endPos | tuple(float,float,float) | 箭头形状的结束位置 |
|
||||
| color | tuple(float,float,float) | 箭头形状的颜色, RGB值, 取值范围为[0,1], 默认为(1,1,1) |
|
||||
| headSegmentsNum | int | 组成箭头形状头部的网格数量, 最小为3, 默认为20 |
|
||||
| arrowHeadLength | float | 箭头形状头部的长度, 默认为1 |
|
||||
| radius | float | 箭头形状头部的半径, 默认为0.5 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| DrawingShapeCompClient | 新建的箭头形状 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0), 40, 5, 2.5)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## AddBoxShape
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
新建盒子形状
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| pos | tuple(float,float,float) | 盒子形状的位置 |
|
||||
| scale | tuple(float,float,float) | 盒子形状的大小, 默认为(1,1,1) |
|
||||
| color | tuple(float,float,float) | 盒子形状的颜色, RGB值, 取值范围为[0,1], 默认为(1,1,1) |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| DrawingShapeCompClient | 新建的盒子形状 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
shape = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## AddCircleShape
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
新建圆形状
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| pos | tuple(float,float,float) | 圆形状的位置 |
|
||||
| radius | float | 圆形状的半径 |
|
||||
| color | tuple(float,float,float) | 圆形状的颜色, RGB值, 取值范围为[0,1], 默认为(1,1,1) |
|
||||
| plane | int | 圆形状的平面, 0时为不指定平面, 1时为XY平面, 2时为XZ平面, 3时为YZ平面, 默认为2 |
|
||||
| segmentsNum | int | 圆形状的网格数量, 默认为20, 最小为1, 小于1后不渲染 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| DrawingShapeCompClient | 新建的圆形状 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
circle = comp.AddCircleShape((50,100,50), 5, (1,0,0))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## AddLineShape
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
新建线条形状
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| startPos | tuple(float,float,float) | 线条形状的起始位置 |
|
||||
| endPos | tuple(float,float,float) | 线条形状的结束位置 |
|
||||
| color | tuple(float,float,float) | 线条形状的颜色, RGB值, 取值范围为[0,1], 默认为(1,1,1) |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| DrawingShapeCompClient | 新建的线条形状 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
line = comp.AddLineShape((-37, 100, 100), (0,0,0),(1,0,0))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## AddSphereShape
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
新建球形状
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| pos | tuple(float,float,float) | 球形状的位置 |
|
||||
| radius | float | 球形状的半径 |
|
||||
| color | tuple(float,float,float) | 球形状的颜色, RGB值, 取值范围为[0,1], 默认为(1,1,1) |
|
||||
| segmentsNum | int | 球形状的网格数量, 默认为20, 最小为1, 小于等于1后不渲染 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| DrawingShapeCompClient | 新建的球形状 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
sphere = comp.AddSphereShape((-50, 100, -50), 5, (1,0,0))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## AddTextShape
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
新建文本形状
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| pos | tuple(float,float,float) | 文本形状的位置 |
|
||||
| text | str | 文本形状的文本 |
|
||||
| color | tuple(float,float,float) | 文本形状的颜色, RGB值, 取值范围为[0,1], 默认为(1,1,1) |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| DrawingShapeCompClient | 新建的文本形状 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
text = comp.AddTextShape((20,100,20), "test 测试", (1,0,0))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetBoxScale
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取BoxShape的大小
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| tuple(float,float,float) | BoxShape的大小 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
box.GetBoxScale()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetColor
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取Shape的颜色
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| tuple(float,float,float) | Shape的颜色 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
box.GetColor()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetEndPos
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取LineShape或ArrowShape的结束位置
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| tuple(float,float,float) | LineShape或ArrowShape的结束位置 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
line = comp.AddLineShape((0, 100, 100), (20,20,2),(1,0,0))
|
||||
line.GetEndPos()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetLength
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取ArrowShape的头部长度
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| float | ArrowShape的头部长度 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0), 40, 5)
|
||||
arrow.GetLength()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetPos
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取Shape的位置
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| tuple(float,float,float) | Shape的位置 |
|
||||
|
||||
- 备注
|
||||
- 对于线条形状和箭头形状来说是指起点Pos, 其他是指形状中心Pos
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
box.GetPos()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetPriority
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取Shape的优先级
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| int | Shape的优先级 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
box.GetPriority()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetRadius
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取CircleShape或ArrowShape或SphereShape的半径
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| float | CircleShape或ArrowShape或SphereShape的半径 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
circle = comp.AddCircleShape((50,100,50), 5, (1,0,0))
|
||||
circle.GetRadius()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetSegments
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取CircleShape或ArrowShape头部的分段数
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| int | CircleShape或ArrowShape头部的分段数 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
circle = comp.AddCircleShape((50,100,50), 5, (1,0,0))
|
||||
circle.GetSegments()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetText
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取TextShape的文本
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| str | TextShape的文本 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
text = comp.AddTextShape((20,100,20), "test 测试", (1,0,0))
|
||||
text.GetText()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetType
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取Shape的类型
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| ShapeType | [Shape的类型](../枚举值/ShapeType.md) |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
box.GetType()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetVisible
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取Shape是否可见
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | Shape是否可见 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37, 100, 100),(5,5,5),(1,0,0))
|
||||
box.GetVisible()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Remove
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
删除Shape
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 删除是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0),40, 5, 2.5)
|
||||
arrow.Remove()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## RemoveAll
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingCompClient.DrawingCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
删除当前所有Shape
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 删除是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
comp.RemoveAll()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetBoxScale
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置BoxShape的大小
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| scale | tuple(float,float,float) | BoxShape的目标大小 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
box = comp.AddBoxShape((-37,100,100),(5,5,5),(1,0,0))
|
||||
box.SetBoxScale((9,9,9))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetColor
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置Shape的颜色
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| color | tuple(float,float,float) | Shape的颜色, RGB值, 取值范围为[0,1] |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0),40, 5, 2.5)
|
||||
arrow.SetColor((0,0,0))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetEndPos
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置LineShape或ArrowShape的结束位置
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| endPos | tuple(float,float,float) | LineShape或ArrowShape的结束位置 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
line = comp.AddLineShape((0, 100, 100), (0,100,50),(1,0,0))
|
||||
line.SetEndPos((20,200, 20))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetLength
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置组成ArrowShape头部的长度
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| length | float | 组成ArrowShape头部的长度 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0),40, 5, 2.5)
|
||||
arrow.SetLength(10)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetPos
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置Shape的位置
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| pos | tuple(float,float,float) | Shape的目标位置 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 备注
|
||||
- 对于线条形状和箭头形状来说是指起点Pos, 其他是指形状中心Pos
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
line = comp.AddLineShape((0,100,100), (0,100,50),(1,0,0))
|
||||
line.SetPos((0,100,70))
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetPriority
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置Shape的渲染优先级, 同一像素点处优先渲染优先级高的Shape, 默认为0
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| priority | int | Shape的渲染优先级 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0),40, 5, 2.5)
|
||||
arrow.SetPriority(10)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetRadius
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置CircleShape或ArrowShape或SphereShape的半径
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| radius | float | CircleShape或ArrowShape或SphereShape的半径 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
circle = comp.AddCircleShape((50,100,50), 5, (1,0,0))
|
||||
print circle.SetRadius(2.0)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetSegments
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置组成ArrowShape头部的网格数量, 最小为3
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| segments | int | 组成ArrowShape头部的网格数量, 最小为3 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0),40, 5, 2.5)
|
||||
arrow.SetSegments(100)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetText
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置TextShape的文本内容
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| text | str | TextShape的文本内容 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
text = comp.AddTextShape((20,100,20), "test 测试", (1,0,0))
|
||||
text.SetText("tteesstt")
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetVisible
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.drawingShapeCompClient.DrawingShapeCompClient
|
||||
|
||||
- 描述
|
||||
|
||||
设置Shape是否可见
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| visible | bool | Shape是否可见 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 设置是否成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateDrawing(levelId)
|
||||
arrow = comp.AddArrowShape((20,100,20), (20,150,20), (1,0,0),40, 5, 2.5)
|
||||
arrow.SetVisible(False)
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -634,6 +634,142 @@ print(comp.GetPlayerTotalExp(playerId))
|
||||
|
||||
|
||||
|
||||
## IsHighLevelMultiJointOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为史诗及以上的多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 史诗及以上的多关节官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsHighLevelMultiJointOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsHighLevelOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为史诗及以上的官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 史诗及以上的官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsHighLevelOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsMultiJointOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 多关节官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsMultiJointOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsPlayerNaturalRegen
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
@@ -405,7 +405,9 @@ method in mod.client.component.actorRenderCompClient.ActorRenderCompClient
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| clearBindParticle | bool | 是否清除粒子,默认为False |
|
||||
|
||||
- 返回值
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@ sidebarDepth: 1
|
||||
| [GetPlayerStarveTick](属性.md#getplayerstarvetick) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家饥饿掉血速度,当饥饿值小于饥饿临界值时会自动扣除血量,开启饥饿值且开启饥饿掉血时有效。原版默认值为80刻(即每4秒)扣除1点血量 |
|
||||
| [GetPlayerTotalExp](属性.md#getplayertotalexp) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家的总经验值 |
|
||||
| [GetPlayerTotalExp](属性.md#getplayertotalexp) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家的总经验值 |
|
||||
| [IsHighLevelMultiJointOfficialSkin](属性.md#ishighlevelmultijointofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为史诗及以上的多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsHighLevelOfficialSkin](属性.md#ishighlevelofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为史诗及以上的官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsMultiJointOfficialSkin](属性.md#ismultijointofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsOfficialSkin](属性.md#isofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsPlayerNaturalRegen](属性.md#isplayernaturalregen) | <span style="display:inline;color:#ff5555">服务端</span> | 是否开启玩家自然恢复,当饥饿值大于等于健康临界值时会自动恢复血量,开启饥饿值且开启自然恢复时有效。原版默认开启 |
|
||||
| [IsPlayerNaturalStarve](属性.md#isplayernaturalstarve) | <span style="display:inline;color:#ff5555">服务端</span> | 是否开启玩家饥饿掉血,当饥饿值小于饥饿临界值时会自动恢复血量,开启饥饿值且开启饥饿掉血时有效。原版默认开启 |
|
||||
| [SetEnchantmentSeed](属性.md#setenchantmentseed) | <span style="display:inline;color:#ff5555">服务端</span> | 设置玩家的附魔种子,该种子会决定附魔台上准备附魔的装备的附魔项 |
|
||||
@@ -88,6 +92,7 @@ sidebarDepth: 1
|
||||
| [IsOnLadder](行为.md#isonladder) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家是否在梯子/藤蔓上 |
|
||||
| [IsPlayerCanFly](行为.md#isplayercanfly) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家能否飞行 |
|
||||
| [IsPlayerFlying](行为.md#isplayerflying) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家是否在飞行 |
|
||||
| [OpenNeteaseContainer](行为.md#openneteasecontainer) | <span style="display:inline;color:#ff5555">服务端</span> | 打开自定义容器界面,不依赖于方块。该界面的物品数据需由开发者自行维护。 |
|
||||
| [OpenWorkBench](行为.md#openworkbench) | <span style="display:inline;color:#ff5555">服务端</span> | 在玩家当前位置打开工作台UI,不依赖于工作台方块 |
|
||||
| [PickUpItemEntity](行为.md#pickupitementity) | <span style="display:inline;color:#ff5555">服务端</span> | 某个Player拾取物品ItemEntity |
|
||||
| [PlayerAttackEntity](行为.md#playerattackentity) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家使用手持武器攻击某个生物 |
|
||||
|
||||
@@ -919,6 +919,50 @@ comp.IsPlayerFlying()
|
||||
|
||||
|
||||
|
||||
## OpenNeteaseContainer
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
method in mod.server.component.playerCompServer.PlayerCompServer
|
||||
|
||||
- 描述
|
||||
|
||||
打开自定义容器界面,不依赖于方块。该界面的物品数据需由开发者自行维护。
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| screenName | str | 打开的容器ui的命名空间,格式[namespace.screenName] |
|
||||
| customDescription | str | 打开的容器ui的标题(复用原版ui时生效) |
|
||||
| isCloseReturnItem | bool | 关闭容器界面时,是否返还物品到背包;默认为False(不返还),由开发者维护物品数据的存储。 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 返回True则执行成功,不代表界面已打开 |
|
||||
|
||||
- 备注
|
||||
- 参数含义以及自定义容器ui json的编写,参考[自定义容器](../../../../mcguide/20-玩法开发/15-自定义游戏内容/2-自定义方块/3-特殊方块/11-自定义容器.md)教程。
|
||||
- collection_name需指定为`netease_ui_container`。
|
||||
- 如果isCloseReturnItem为False,将在关闭界面后,`容器内的物品不会返还到背包`。
|
||||
- 可使用[GetPlayerUIItem](../方块/容器.md#getplayeruiitem)、[SetPlayerUIItem](../方块/容器.md#setplayeruiitem)接口来获取、设置容器内的物品。
|
||||
- 该接口打开的容器,可触发[PlayerTryAddCustomContainerItemServerEvent](../../事件/物品.md#playertryaddcustomcontaineritemserverevent)、[PlayerTryPutCustomContainerItemServerEvent](../../事件/物品.md#playertryputcustomcontaineritemserverevent)、[PlayerTryRemoveCustomContainerItemServerEvent](../../事件/物品.md#playertryremovecustomcontaineritemserverevent)以及对应的客户端事件。
|
||||
- 可通过监听[PushScreenEvent](../../事件/UI.md#pushscreenevent),来做容器内格子物品的初始化逻辑;建议每一个ui namespace单独对应一种功能,以免无法正确区分容器界面。
|
||||
- 如出现“failed to create root control”等断言,请检查ui json的编写是否正确。
|
||||
- 如出现物品无法放入容器界面、或者无法移动物品,请检查ui json的是否使用了netease_ui_container。
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreatePlayer(playerId)
|
||||
comp.OpenNeteaseContainer("netease_container.netease_custom_container_screen", "容器标题")
|
||||
```
|
||||
|
||||
|
||||
|
||||
## OpenWorkBench
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
@@ -86,6 +86,8 @@ method in mod.client.extraClientApi
|
||||
建议使用资源池来管理绑定实体UI,当实体与本地玩家距离超过一定范围时,隐藏/移除其绑定UI,或使其绑定UI改为绑定其他有需求的实体。
|
||||
|
||||
当需要大批量创建绑定实体UI时,建议将创建UI的任务分为小批量多次执行,每批次间相距至少一帧。例如需要创建100个绑定实体UI,将任务分散在5帧中,每帧创建20个绑定实体UI。
|
||||
- 注意:
|
||||
第二个参数uiKey,如果传进去名字一样名字的ui,则会创建失败,请保证uiKey的唯一性。
|
||||
|
||||
- 示例
|
||||
|
||||
|
||||
Reference in New Issue
Block a user