|
地板

楼主 |
发表于 2020-2-14 17:14:05
|
只看该作者
IP:广东
这个是Mojang原生的实体事件触发,在实体json中定义触发条件和触发项,可做出调用命令,动画或执行实体event的效果
其他生物包括自定义生物上测试倒是正常的,放在玩家身上就不行了。也问过一些大佬说是Mojang的锅,1.14就修复了?
以下是部分关键代码
- --entities/player.json--
- "description": {
- "identifier": "minecraft:player",
- "is_spawnable": false,
- "is_summonable": false,
- "is_experimental": false,
- "scripts": {
- "animate": [
- "light"
- ]
- },
- "animations": {
- "light": "controller.animation.light"
- }
- }
复制代码
- --animation_controllers/light.json--
- "animation_controllers": {
- "controller.animation.light": {
- "states": {
- "default": {
- "transitions": [
- {
- "add_light_0": "query.is_saddled"
- }
- ],
- "on_entry": [
- "/function light_remove" //调用指令
- ],
- "on_exit": [
- "/function light_load"
- ]
- },
- "add_light_0": {...}
- }
- }
- }
复制代码 |
|