Glowing Entity Texture
本教程将指导您如何通过材质和纹理为实体创建发光效果,就像末影人的眼睛那样。
纹理处理
要使实体纹理发光,您需要使用高级图像编辑器(这里以Blockbench为例)对纹理进行半透明擦除处理:
- 打开实体纹理文件
不必在意骨骼的奇怪旋转方式,Mojang喜欢通过动画来正确渲染模型
- 选择__橡皮擦__工具,将不透明度/alpha值设置为较低数值(如71或23)


- 擦除需要发光部位的纹理。像素可见度越低发光效果越强,但注意不要完全擦除(保持alpha值不为0)
![]()
猪纹理示例:

材质设置
需要修改目标生物的RP/entity/my_entity.entity.json文件。找到"materials":{}并将其值设为"entity_emissive_alpha"(请确保纹理已正确定义)。
RP/entity/pig.entity.json#description
json
"materials": {
"default": "entity_emissive_alpha"
}猪实体文件示例
RP/entity/pig.entity.json
json
{
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "minecraft:pig",
"min_engine_version": "1.8.0",
"materials": {
"default": "entity_emissive_alpha" // 将"pig"替换为"entity_emissive_alpha"
},
"textures": {
"default": "textures/entity/pig/pig",
"saddled": "textures/entity/pig/pig_saddle"
},
"geometry": {
"default": "geometry.pig.v1.8"
},
"animations": {
"setup": "animation.pig.setup",
"walk": "animation.quadruped.walk",
"look_at_target": "animation.common.look_at_target",
"baby_transform": "animation.pig.baby_transform"
},
"scripts": {
"animate": [
"setup",
{
"walk": "q.modified_move_speed"
},
"look_at_target",
{
"baby_transform": "q.is_baby"
}
]
},
"render_controllers": ["controller.render.pig"],
"spawn_egg": {
"texture": "spawn_egg",
"texture_index": 2
}
}
}
}效果测试
现在启动Minecraft,加载启用了该资源包的世界。将时间设为_午夜_或寻找附近洞穴进行测试,实体应该会如预期般发光。


