User Tools

Site Tools


zh_cn:tutorial:entity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
zh_cn:tutorial:entity [2023/01/15 01:21] – texture 应该翻译成纹理 solidblockzh_cn:tutorial:entity [2023/01/15 01:22] – [生成你的实体] solidblock
Line 227: Line 227:
  
 ===== 生成你的实体 ===== ===== 生成你的实体 =====
 +记得将客户端入口点添加到 fabric.mod.json 中,像这样:
 +<code json>
  
-你可以在游戏内使用 ''/summon entitytesting:cube'' 来生成你的实体,按下F3+b可以查看它的碰撞体积:+  "entrypoints":
 +    "main":
 +      "mod.fabricmc.entitytesting.EntityTesting" 
 +    ], 
 +    "client":
 +      "mod.fabricmc.entitytesting.EntityTestingClient" 
 +    ] 
 +  }, 
 +</code> 
 + 
 +你可以在游戏内使用 ''/summon entitytesting:cube'' 来生成你的实体,按下 F3+b 可以查看它的碰撞体积:
 {{https://i.imgur.com/MmQvluB.png}} {{https://i.imgur.com/MmQvluB.png}}
  
 +**注意:**如果你的实体没有继承 ''LivingEntity'',你需要创建你自己的封包处理器。你可以通过网络 API 来完成,也可以对 ''ClientPlayNetworkHandler#onEntitySpawn'' 使用 mixin。
zh_cn/tutorial/entity.txt · Last modified: 2023/01/15 01:23 by solidblock