Skip to content

Commit a1ca558

Browse files
committed
Added new animation registering method
1 parent 54b3705 commit a1ca558

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

docs/compatibilities/kubejs/custom-animations.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ To get started you create a client-side script (`assets/<namespace>/kubejs_scrip
66

77
```js
88
PalladiumEvents.registerAnimations((event) => {
9-
event.register('test/ability_test', 10, (builder) => {
9+
event.registerForPower('test/ability_test', 'namespace:my_power_id', 10, (builder) => {
1010
// animation part
1111
});
1212
});
1313
```
1414

15-
In the `register` function you specificy the ID, the priority, and then a function for animating, which just needs a `builder` parameter.
15+
In the `registerForPower` function you specificy the ID, the ID of the power this animation will be used for, the priority, and then a function for animating, which just needs a `builder` parameter.
1616

1717

1818

@@ -62,12 +62,31 @@ And here are all the body parts you can access:
6262
If you want to have the animation in first-person be more specific, or even not appear at all, there are some functions you can use:
6363
```js
6464
PalladiumEvents.registerAnimations((event) => {
65-
event.register('test/ability_test', 10, (builder) => {
65+
event.registerForPower('test/ability_test', 'namespace:my_power_id', 10, (builder) => {
6666
if (builder.isFirstPerson()) {
6767
// do first-person animations
6868
} else {
6969
// do third-person animations
7070
}
7171
});
7272
});
73+
```
74+
75+
76+
# Power-independent animations
77+
78+
If you want to make an animation that isn't bound to any power, you can use the following method.
79+
80+
:::danger
81+
82+
Using this is bad for your FPS. Use this with caution!
83+
84+
:::
85+
86+
```js
87+
PalladiumEvents.registerAnimations((event) => {
88+
event.register('test/ability_test', 10, (builder) => {
89+
// animation part
90+
});
91+
});
7392
```

0 commit comments

Comments
 (0)