Skip to content

Commit 59ad882

Browse files
add entity variants section
1 parent 3ad9945 commit 59ad882

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

docs/nova.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ nav:
7272
- "GUI Textures": "addon/fonts/guitextures.md"
7373
- "Action Bar Overlay": "addon/fonts/actionbar.md"
7474
- "Boss Bar Overlay": "addon/fonts/bossbar.md"
75+
- "Entity Variants": "addon/entity-variants.md"
7576
- "Attachments": "addon/attachments.md"
7677
- "Abilities": "addon/abilities.md"
7778
- "Hitboxes": "addon/hitboxes.md"

docs/nova/addon/entity-variants.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## What is an Entity Variant?
2+
3+
Entity variants are a vanilla Minecraft feature and allow you to add retextured variants of existing entities to the game.
4+
([Minecraft Wiki](https://minecraft.wiki/w/Mob_variant))
5+
6+
## Registering a custom entity variant
7+
You can register a custom entity variant like this:
8+
9+
```kotlin
10+
@Init(stage = InitStage.PRE_PACK) // (1)!
11+
object EntityVariants {
12+
13+
val BLUE_COW by ExampleAddon.cowVariant("blue") {
14+
spawnConditions {
15+
// (2)!
16+
}
17+
18+
texture(CowModelType.WARM /*(3)!*/) {
19+
texture("entity/cow/blue")
20+
}
21+
}
22+
23+
}
24+
```
25+
26+
1. Nova will load this class during addon initialization, causing your variants to be registered.
27+
2. The conditions for your custom variant to be selected when spawning. See [Minecraft Wiki - Spawn Conditions](https://minecraft.wiki/w/Mob_spawning#Spawn_conditions)
28+
for more information.
29+
3. Some entities offer multiple model types. For example, the warm cow has horns. You can select the model type here.

0 commit comments

Comments
 (0)