森罗万象
教程
OptiFine文档
Blockbench文档
论坛版 (opens new window)
下载示例 (opens new window)
教程
OptiFine文档
Blockbench文档
论坛版 (opens new window)
下载示例 (opens new window)
  • 属性文件说明
  • 连接纹理
  • 自然纹理
  • 更好的草地
  • 自定义方块渲染
  • 自定义物品纹理
  • 随机实体纹理
    • 概述丨Overview
    • 属性文件丨random_entities.properties
    • 示例丨Examples
    • 译注
  • 自定义实体模型
  • 自定义动画
  • 自定义颜色
  • 自定义天空
  • 自发光纹理
  • 动态光源
  • 自定义载入画面
  • 自定义GUI
  • 自定义全景图
  • 高清字体
  • 系统属性
  • 纹理属性
  • 光影

  • 调试快捷键
  • 尚未完成的事

随机实体纹理

Random Entities

# 概述丨Overview

随机实体纹理基于 MCPatcher 的 Random Mobs 模块,可以向下兼容随机怪物(Random Mobs),仍然支持在 "assets/minecraft/optifine/mob" 中的纹理和配置文件。

你可以把备选纹理放在资源包的 "optifine/random" 文件夹下,和 "textures" 文件夹中的原版纹理对应:

基础纹理:

assets/minecraft/textures/entity/creeper/creeper.png

备选纹理:

assets/minecraft/optifine/random/entity/creeper/creeper2.png

assets/minecraft/optifine/random/entity/creeper/creeper3.png

assets/minecraft/optifine/random/entity/creeper/creeper4.png

以此类推

属性文件(可选):

assets/minecraft/optifine/random/entity/creeper/creeper.properties

基础纹理:

assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png

备选纹理:

assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand2.png

assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand3.png

assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand4.png

以此类推

属性文件(可选):

assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand.properties

Textures ending with a digit use the separator "."

Primary (vanilla) texture:

assets/minecraft/textures/entity/warden/warden_pulsating_spots_2.png

Alts:

assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.2.png

assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.3.png

assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.4.png etc.

属性文件(可选):

assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.properties

属性文件由一系列规则组成,这些规则从1开始编号。

每一组规则都指定了一些要使用的实体纹理,以及一个或多个使用它们的条件。

单人游戏中怪物生成的坐标或者多人游戏中怪物第一次被玩家发现时的坐标会依次与每一条规则进行匹配,第一个匹配的规则将被使用。

如果没有匹配的规则,将使用默认纹理(例如 creeper.png)。

如果某个实体没有设置 ".properties" 文件,那么所有可以使用的皮肤都将应用于该实体。

有多张纹理的实体将使用基础纹理的 ".properties" 文件,也就是说,你不需要新建

wolf.properties

wolf_tame.properties

wolf_angry.properties

如果每张纹理都有相同数量的备选纹理,只需要 wolf.properties 就可以应用于这三者。

"_eyes" 和 "_overlay" 类似。

(译注:原文写的就不明不白,对此感到困惑的可以看一下这个帖子 (opens new window))

所有的属性名都区分大小写。除非另作说明,所有的路径都相对于assets/minecraft。

# 属性文件丨random_entities.properties

(必需)纹理的序号

纹理序号 "1" 表示 "assets/minecraft/texture" 中的默认纹理。

textures.<n>=<纹理序号列表>

也可以使用随机怪物属性 "skins.<n>",二者选一。

skins.<n>=<皮肤列表>

(可选)随机选项的权重

权重之和不需要正好为100或者其他特定数字。权重的数量应该和纹理的数量一致。

weights.<n>=<等数量的权重列表>

(可选)生物群系列表

这里列出了原版生物群系名:https://minecraft.gamepedia.com/Biome#Biome_IDs (opens new window),也可以使用模组添加的生物群系。

biomes.<n>=<生物群系列表>

(可选)高度范围

取代了旧的 minHeight 和 maxHeight 属性。

从1.18开始高度可以使用负值,用于范围时需要将负数用小括号括起来。

heights.<n>=<高度范围>

(可选)实体名

使用和自定义物品纹理NBT标签相似的语法。

以 "!" 开头的值表示匹配相反的东西 (非)。

示例:

  • 匹配字符串: "name=Pinky"
  • 匹配特殊格式: "name=\u00a74\u00a7oPinky"
    (为了获得最佳兼容性,请使用转义序列'\u00a7'而不是"§")
  • 使用 "?" 和 "*" 的通配符: "name=pattern:Pinky*"
  • 通配符, 不区分大小写: "name=ipattern:Pinky*"
  • Java正则表达式: "name=regex:Pin(k)+y"
    (参考http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html (opens new window))
  • Java正则表达式, 不区分大小写: "name=iregex:Pin(k)+y"

匹配字符串中的所有反斜线必须输入两次,正则表达式和通配符中的文字反斜杠必须输入4次。

正确:

name=regex:\\d+

name=regex:\\\\

name=/\\/\\

错误:

name=regex:\d+

name=regex:\\

name=/\/\

name.<n>=<实体名>

职业(可选)

列出村民职业,可选填等级。

格式为:

<职业>[:等级1,等级2,...]

可选的职业:

none(失业), armorer(盔甲匠), butcher(屠夫), cartographer(制图师), cleric(牧师), farmer(农民),

fisherman(渔夫), fletcher(制箭师), leatherworker(皮匠), librarian(图书管理员), mason(石匠),

nitwit(傻子), shepherd(牧羊人), toolsmith(工具匠), weaponsmith(武器匠)

professions.<n>=<职业>

示例:

 # 所有等级的农民或等级为1, 3, 4的图书管理员
 professions=farmer librarian:1,3-4
 # 可以使用职业的全名
 professions=minecraft:fisherman minecraft:shepherd minecraft:nitwit

颜色(可选)

列出狼/猫的项圈颜色或羊/羊驼的颜色。

可选的颜色:

white orange magenta(品红色) light_blue yellow lime(黄绿色)

pink gray light_gray cyan(青色) purple(紫色) blue brown green red black

colors.<n>=<颜色>

示例:

colors=pink magenta purple

旧属性 "collarColors" 依然可被识别。

是否为幼崽(可选)

只对怪物有效。

baby.<n>=<true/false>

生命值(可选)

生命值的范围,可以以数值或者百分比的形式给出。

只对怪物有效。

示例:

health.1=10 health.2=5-8 10-12 health.3=0-50%

health.<n>=<list>

月相(可选)

月相为0-7的整数。

示例:

moonPhase.1=3 moonPhase.2=0 1 2 moonPhase.1=0-2 4-7

moonPhase.<n>=<list>

天气(可选)

不同值可以用空格分隔。

例如 "weather=clear rain thunder"

weather.<n>=<clear|rain|thunder>

尺寸(可选)

仅适用于有多种尺寸的怪物。(史莱姆和岩浆怪的尺寸为 0-255,幻翼的尺寸为 0-64)

自然生成的史莱姆和岩浆怪的尺寸只有三种:0=小, 1=中, 3=大。

自然生成的幻翼的尺寸为0。

sizes.<n>=<list>

示例:

sizes.1=3
sizes.2=0 1 3
sizes.3=0-2 4-7

NBT tags (optional)

See "cit_single.properties" for more details

nbt.<n>.<tag>=<value>

Blocks (optional)

For entities checks the block on which the entity is standing For block entities checks the block of the block entity See "ctm.properties, matchBlocks" for more details.

blocks.<n>

# 示例丨Examples

creeper/creeper.properties:

将 creeper10.png 到 creeper14.png 应用于所有位于地下的苦力怕。

creeper13.png 当前出现的概率为 7.3% (3/(10+10+10+3+10))。

skins.1=10-14
weights.1=10 10 10 3 10
heights.1=0-55

将 5, 7, 9 应用于高于80的山区地带。

skins.2=5 7 9
biomes.2=ExtremeHills DesertHills ForestHills ExtremeHillsEdge JungleHills IceMountains
heights.2=80-255

没有其他规则匹配这些纹理时,需要额外列出剩余的纹理,这样他们会等概率地随机出现在上述情况以外的区域。 请记住,如果没有这部分,这些纹理就不会被使用,实体纹理就只会显示为 creeper/creeper.png。

skins.3=1-4 6 8 15-20

# 译注

推荐使用 BlockBench 绘制实体的纹理,可以直接在模型上绘制。

← 自定义物品纹理 自定义实体模型 →