Wiki

Clone wiki

Ace / Examples

Examples

Sending chat message "DUMP" will trigger dump of all block names into config/AccidentallyCircumstantialEvents/ directory.

{
    "event_type": "CHAT",
    "text": "DUMP",
    "tasks": [
                {
                    "task_type": "DUMP",
                    "objectType": "BLOCK"
                }
             ]
}

Tossing oakwood planks (default Q) will trigger message "Someone tossed item" to all players

{
    "event_type": "TOSS",
    "issuer": "ALL_PLAYERS",
    "modid": "minecraft",
    "name": "planks",
    "meta": "0",
    "tasks": [
                 {
                    "task_type": "CHAT",
                    "receiver_type": "ALL_PLAYERS",
                    "receiver": "",
                    "message": "Someone tossed item" 
                 }
             ]
}

Chat message "RELOAD" will reload Ace json files on fly.

{
    "event_type": "CHAT",
    "text": "RELOAD",
    "tasks": [
                {
                    "task_type": "RELOAD"  
                }
             ]
}

All players who joins world for the first time will get jumpboost lvl 4 for 1000 tics.

{
    "event_type": "JOIN_WORLD",
            "noDeathDim": "true",
            "joinOneEver": "true",
    "target": "ALL_PLAYERS",
    "tasks": [
                {
                    "task_type": "POTION",
                    "target_type": "SELF",
                    "target": "",
                    "id": "8",
                    "duration": "1000",
                    "level": "4"    
                }
             ]
}

Cancels enderman teleporting and using of enderpearls

{
    "event_type": "ENDER",
    "tasks": [
                {
                    "task_type": "CANCEL" 
                }
             ]
}

All players who right click oakwood plank will get 2 coal and if they have on them spruce planks - one of them will be removed

{
    "event_type": "INTERACT",
    "issuer": "ALL_PLAYERS",
    "action": "RIGHT_BLOCK",
    "modid": "minecraft",
    "name": "planks",
    "meta": "0",
    "tasks": [
                {
                    "task_type": "INVENTORY_REMOVE",
                    "target_type": "SELF",
                    "target": "",
                    "modid": "minecraft",
                    "name": "planks",
                    "meta": "1",
                    "count": "1",
                    "conditions":   [
                                        {
                                            "condition_type": "INVENTORY",
                                            "modid": "minecraft",
                                            "name": "planks",
                                            "meta": "1"
                                        }
                                    ]    
                },
                {
                    "task_type": "INVENTORY_ADD",
                    "target_type": "SELF",
                    "target": "",
                    "modid": "minecraft",
                    "name": "coal",
                    "meta": "0",
                    "count": "2"   
                }
            ]
}

Every 50 ticks if player is in X:0-16 Z:0-16 chunk on any hight from 0 to 256 he will get message "Danger!!!" and will have instant damage potion applied

{
    "event_type": "TICK",
    "ticks": "50",
    "tasks": [
                {
                    "task_type": "CHAT",
                    "receiver_type": "SELF",
                    "receiver": "",
                    "message": "Danger!!!",
                    "conditions":   [
                        {
                            "condition_type": "AREA",
                            "startX": "0",
                            "startY": "0",
                            "startZ": "0",
                            "endX": "16",
                            "endY": "256",
                            "endZ": "16"
                        }
                    ]     
                },
                {
                    "task_type": "POTION",
                    "target_type": "SELF",
                    "target": "",
                    "id": "7",
                    "duration": "1",
                    "level": "1",
                    "conditions":   [
                        {
                            "condition_type": "AREA",
                            "startX": "0",
                            "startY": "0",
                            "startZ": "0",
                            "endX": "16",
                            "endY": "256",
                            "endZ": "16"
                        }
                    ] 
                }
            ]
}

If player right clicks custom block "bomb" from quadrum (can be configured to any other modded block) all players will know he touched what he should not.

{
    "event_type": "INTERACT",
    "issuer": "ALL_PLAYERS",
    "action": "RIGHT_BLOCK",
    "modid": "Quadrum",
    "name": "bomb",
    "meta": "2",
    "tasks":[
                {
                    "task_type": "CHAT",
                    "receiver_type": "ALL_PLAYERS",
                    "receiver": "",
                    "message": "BOOOOOM!" 
                }
            ]
}

Tossing gold ore will spawn Pech at players feet

{
    "event_type": "TOSS",
    "issuer": "ALL_PLAYERS",
    "modid": "minecraft",
    "name": "gold_ore",
    "meta": "0",
    "tasks": [
             {
                "task_type": "SPWN_MOB",
                "type": "Thaumcraft.Pech",
                "location_type": "SELF",
                "xCoord": "0",
                "yCoord": "0",
                "zCoord": "0"
             }
        ]
}

Every 50 ticks if player is not in X:0-16 Z:0-16 chunk on any hight from 0 to 256 he will have instant damage potion applied and if he is in taht area but not have oak plank he will be poisoned

{
    "event_type": "TICK",
    "ticks": "50",
    "tasks": [
                {
                    "task_type": "POTION",
                    "target_type": "SELF",
                    "target": "",
                    "id": "7",
                    "duration": "1",
                    "level": "1",
                    "conditions":   [
                                        {
                                            "condition_type": "AREA",
                                            "reversed": "true",
                                            "startX": "0",
                                            "startY": "0",
                                            "startZ": "0",
                                            "endX": "16",
                                            "endY": "256",
                                            "endZ": "16"
                                        }
                    ] 
                },
                {
                    "task_type": "POTION",
                    "target_type": "SELF",
                    "target": "",
                    "id": "19",
                    "duration": "5",
                    "level": "1",
                    "conditions":   [
                                        {
                                            "condition_type": "AREA",
                                            "startX": "0",
                                            "startY": "0",
                                            "startZ": "0",
                                            "endX": "16",
                                            "endY": "256",
                                            "endZ": "16"
                                        },
                                        {
                                            "condition_type": "INVENTORY",
                                            "reversed": "true",
                                            "modid": "minecraft",
                                            "name": "planks",
                                            "meta": "1"
                                        }
                    ] 
                }                   
            ]
}

Every 100 ticks if time passed start of night time, time is set to morning - test world must have.

{
    "event_type": "TICK",
    "ticks": "100",
    "tasks": [
                {
                    "task_type": "TIME",
                    "timeOfDay": "0",
                    "conditions":
                                    [
                                        {
                                            "condition_type": "TIME",
                                            "timeOfDay": "12000",
                                            "operand": "AFTER"
                                        }
                                    ]
                }
             ]
}

Tossing stone in 3 block radius near wolf will execute /weather rain command.

{
    "event_type": "TOSS",
    "issuer": "ALL_PLAYERS",
    "modid": "minecraft",
    "name": "stone",
    "meta": "0",
    "tasks": [
                {
                    "task_type": "COMMAND",
                    "command": "/weather rain",
                    "conditions":   
                                    [
                                        {
                                            "condition_type": "PROXIMITY",
                                            "target": "MOB",
                                            "modid": "0",
                                            "name": "0",
                                            "meta": "0",
                                            "mob": "Wolf",
                                            "radius": "3"
                                        }
                                    ]        
                }
            ]
}

Sending chat message WHISTLE while holding in active slot bone will summon wolf at You feet.

{
    "event_type": "CHAT",
    "text": "WHISTLE",
    "tasks": [
                {
                    "task_type": "SPWN_MOB",
                    "type": "Wolf",
                    "location_type": "SELF",
                    "xCoord": "0",
                    "yCoord": "0",
                    "zCoord": "0",
                    "conditions":   [
                                        {
                                            "condition_type": "USING",
                                            "modid": "minecraft",
                                            "name": "bone",
                                            "meta": "0"
                                        }
                                    ]

                }
            ]
}

Any mod posting AceQuestEventAPI with data for minecraft quest number 1 will get message "Congratulations! You completed quest"

{
            "event_type": "QUEST",
            "modid": "minecraft",
            "questid": "1",
            "issuer": "ALL_PLAYERS",
            "tasks": [
                          {
                              "task_type": "CHAT",
                              "receiver_type": "SELF",
                              "receiver": "",
                              "message": "Congratulations! You completed quest" 
                          }
                       ]
     }

Writing chat message SPLATS will check scoreboard for objetive Deaths and if it greater than 100 will display message "YOU DIED TOO MANY TIMES"

            {
                "event_type": "CHAT",
                "text": "SPLATS",
                "tasks": [
                            {
                                "task_type": "CHAT",
                                "receiver_type": "ALL_PLAYERS",
                                "receiver": "",
                                "message": "YOU DIED TOO MANY TIMES",
                                "conditions": 
                                                    [
                                                        {
                                                            "condition_type": "SCOREBOARD",
                                                            "objective": "Deaths",
                                                            "player_type": "SELF",
                                                            "player": "",
                                                            "value": "100",
                                                            "operand": "GREATER"
                                                        }
                                                    ] 
                            }
                          ]
            }

If any player gets achievement for openning inventory all achievements will be dumped into file in ACE config directory.

            {
                "event_type": "ACHIEVEMENT",
                "issuer": "ALL_PLAYERS",
                "achievement": "achievement.openInventory",
                "tasks": [
                             {
                                "task_type": "DUMP",
                                "objectType": "ACHIEVEMENT"
                             }
                          ]
            }

Writing chat message "TEST" will send all players "SECRET MESSAGE FOR INVENTORY OPENERS" for all players who has achievement for opening inventory.

           {
                "event_type": "CHAT",
                "text": "TEST",
                "tasks": [
                            {
                                "task_type": "CHAT",
                                "receiver_type": "ALL_PLAYERS",
                                "receiver": "",
                                "message": "SECRET MESSAGE FOR INVENTORY OPENERS",
                                "conditions": 
                                                    [
                                                        {
                                                            "condition_type": "ACHIEVEMENT",
                                                            "player": "SELF",
                                                            "achievement": "achievement.openInventory"
                                                        }
                                                    ] 
                             }
                          ]
            }

Triggering quest trigger with modid "minecraft" and questid "2" by any player will play provided sound "ding".

           This needs to be defined in config/AccidentallyCircumstantialEvents/yourJsonFileWithAceScripts.json :
            {
            "event_type": "QUEST",
            "modid": "minecraft",
            "questid": "2",
            "issuer": "ALL_PLAYERS",
            "tasks": [
                        {
                            "task_type": "SOUND",
                            "name": "ding",
                            "player_type": "ALL_PLAYERS",
                            "volume": "1",
                            "pitch": "0.2"  
                        }
                    ]
            }

           Because AceSoundTask is based on resource packs definig sound is similar. You need to create file sounds.json in config/AccidentallyCircumstantialEvents Example for 2 sounds from witch only one is in example:

           {
             "ding": {"category": "master","sounds": [{"name": "ding","stream": false}]},
             "blip": {"category": "master","sounds": [{"name": "blip","stream": false}]}
           }

           Here is tutotial on what each part means: http://www.minecraftforge.net/wiki/MrGReapers_tutorials/1.7.2_sound_tutorial
           For Ace it is important that name of sound (here ding) is the same in sounds.json and in ACE script

           Next step is creating directory config/AccidentallyCircumstantialEvents Example/sounds and placing ding.ogg in it. Sounds needs to be in ogg format. After that completing quest should trigger playing sound.

Player who writes in chat TESTME will get message chicken if he is on easy difficulty and has invisibility potion on

{
    "event_type": "CHAT",
    "text": "TESTME",
    "tasks": [
                                       {
                                              "task_type": "CHAT",
                                              "receiver_type": "SELF",
                                              "receiver": "",
                                              "message": "CHICKEN",
                                              "conditions": 
                                                    [
                                                        {
                                                            "condition_type": "POTION",
                                                            "id": "14"
                                                        },
                                                        {
                                                            "condition_type": "DIFFICULTY",
                                                            "name": "EASY"
                                                        }
                                                    ] 
                                       }
             ]
}

Every player who joins world will trigger seting world spawn command to 0,0,0. Command requires op privilages but ignorePrivilages parameter allows to ignore it

{
            "event_type": "JOIN_WORLD",
            "target": "ALL_PLAYERS",
            "noDeathDim": "false",
            "joinOneEver": "false",
            "tasks": [
                        {
                            "task_type": "COMMAND",
                            "command": "/setworldspawn 0 0 0",
                            "ignorePrivilages": "true"
                        }
                      ]
    }

Right clicking with any item/empty hand any block (ignoreBlock parameter) will show player message INTERACT ALL THE THINGS

    {
                            "event_type": "INTERACT",
                            "issuer": "ALL_PLAYERS",
                            "action": "RIGHT_BLOCK",
                            "ignoreBlock": "true",
                            "modid": "minecraft",
                            "name": "0",
                            "meta": "0",
                            "tasks":
                                    [
                                     {
                                        "task_type": "CHAT",
                                        "receiver_type": "SELF",
                                        "receiver": "",
                                        "message": "INTERACT ALL THE THINGS"
                                     }
                                    ]
    }

Right clicking with any item/empty hand any block will increase TEST variable by 1, then it will display message to player with its value. When TEST variable is greater than 9 player will get message YOU REACHED A GOAL! and variable will be reset to 0 so cycle can begin again

            {
                            "event_type": "INTERACT",
                            "issuer": "ALL_PLAYERS",
                            "action": "RIGHT_BLOCK",
                            "ignoreBlock": "true",
                            "modid": "minecraft",
                            "name": "0",
                            "meta": "0",
                            "tasks":
                                    [
                                            {
                                                "task_type": "HANDLER_COUNT",
                                                "handlerIdentifier": "TEST",
                                                "operation": "+"
                                            },
                                            {
                                                "task_type": "HANDLER_COUNT_CHAT",
                                                "handlerIdentifier": "TEST"
                                             },
                                             {
                                "task_type": "CHAT",
                                "receiver_type": "SELF",
                                "receiver": "",
                                "message": "YOU REACHED A GOAL!",
                                                "conditions":   [
                                                                    {
                                                                        "condition_type": "HANDLER_COUNT",
                                                                        "handlerIdentifier": "TEST",
                                                                        "value": "9",
                                                                        "operand": "GREATER"
                                                                    }
                                                                ] 
                                            },
                                            {
                                                "task_type": "HANDLER_COUNT",
                                                "handlerIdentifier": "TEST",
                                                "operation": "CLEAR",
                                                "conditions":  
                                                                [
                                                                    {
                                                                        "condition_type": "HANDLER_COUNT",
                                                                        "handlerIdentifier": "TEST",
                                                                        "value": "9",
                                                                        "operand": "GREATER"
                                                                    }
                                                                ] 
                                            }
                                    ]
            }

##When player joins world he/she will receive oak sapling with Sharpness I enchant. Nbt works like in MC give command

            {
            "event_type": "JOIN_WORLD",
            "noDeathDim": "true",
            "joinOneEver": "true",
            "target": "ALL_PLAYERS",
            "tasks": [
                        {
                            "task_type": "INVENTORY_ADD",
                            "target_type": "SELF",
                            "target": "",
                            "modid": "minecraft",
                            "name": "sapling",
                            "meta": "0",
                            "count": "1",
                            "nbt": "{ench:[{id:16,lvl:1}]}"
                        }
                     ]
            }

##Writing in chat WOOL will display INVENTORY message if player has in inventory any wool (not only with meta =0)

            {
            "event_type": "CHAT",
            "text": "WOOL",
            "tasks": [
                    {
                "task_type": "CHAT",
                "receiver_type": "ALL_PLAYERS",
                "receiver": "",
                "message": "INVENTORY",
                "conditions":   [
                                                        {
                                                            "condition_type": "INVENTORY",
                                                            "modid": "minecraft",
                                                            "name": "wool",
                                                            "meta": "0",
                                                            "ignoreMeta": "true"
                                                        }
                                                    ] 
            }

##Writing in chat WOOL will display USINGmessage if player has in active slot any wool (not only with meta =0)

            {
            "event_type": "CHAT",
            "text": "WOOL",
            "tasks": [
                    {
                "task_type": "CHAT",
                "receiver_type": "ALL_PLAYERS",
                "receiver": "",
                "message": "USING",
                "conditions":   [
                                                        {
                                                            "condition_type": "USING",
                                                            "modid": "minecraft",
                                                            "name": "wool",
                                                            "meta": "0",
                                                            "ignoreMeta": "true"
                                                        }
                                                    ] 
            }

##If player wrotes in chat TEST he will get message BIOME if he is Forest biome, and message WEATHER if it is raining and not thundering

            {
            "event_type": "CHAT",
            "text": "TEST",
            "tasks": [
                            {
                                "task_type": "CHAT",
                                "receiver_type": "ALL_PLAYERS",
                                "receiver": "",
                                "message": "BIOME",
                                "conditions":   [
                                                        {
                                                            "condition_type": "BIOME",
                                                            "biomeName": "Forest"
                                                        }
                                                    ] 
                           },
                           {
                               "task_type": "CHAT",
                               "receiver_type": "ALL_PLAYERS",
                               "receiver": "",
                               "message": "WEATHER",
                               "conditions":   [
                                                {
                                                            "condition_type": "WEATHER",
                                                            "isRaining": "true",
                                                            "isThundering": "false"
                                                        }
                                                    ] 
                            }
                           ]
            }

##If player tosses oak planks they will despawn after 10 ticks

    {
        "event_type": "TOSS",
        "issuer": "ALL_PLAYERS",
        "modid": "minecraft",
        "name": "planks",
        "meta": "0",
        "tasks": [
            {
                "task_type": "ITEM_NEW_LIFE",
                "newLife": "10"
            }
        ]
    }

##If oak planks despawn while on dirt player will get message Expire on dirt

    {
        "event_type": "EXPIRE",
        "modid": "minecraft",
        "name": "planks",
        "meta": "0",
        "tasks": [
            {
                "task_type": "CHAT",
                "receiver_type": "ALL_PLAYERS",
                "receiver": "",
                "message": "Expire on dirt",
                "conditions":   [
                                                        {
                                                            "condition_type": "ON_BLOCK",
                                                            "modid": "minecraft",
                                                            "name": "dirt",
                                                            "meta": "0",
                                                            "inWater": "false"
                                                        }
                                                    ] 
            }
        ]
    }

##If Player910 say HI in chat he will get message "Welcome Player910"

    {
                "event_type": "CHAT",
                "text": "HI",
                "tasks": [
                            {
                                "task_type": "CHAT",
                                "receiver_type": "ALL_PLAYERS",
                                "receiver": "",
                                "message": "Welcome Player910",
                                "conditions":  
                                            [
                                                {
                                                    "condition_type": "PLAYER_NAME",
                                                    "player": "Player910"
                                                }
                                            ]
                             }
                        ]
    }

##Before pig drops its loot it is cleared (porkchops) and instead is added 5 beef

            {
                "event_type": "LIVING_DROPS",
                "target": "Pig",
                "tasks": [
                             {
                                "task_type": "DROPS_CLEAR"
                            },
                            {
                                "task_type": "DROPS_ADD",
                                "modid": "minecraft",
                                "name": "beef",
                                "meta": "0",
                                "count": "5"
                            }
                        ]
            }

##If player dies he gets message "You died :<"

            {
                "event_type": "DEATH",
                "target": "PLAYER",
                "tasks": [
                            {
                               "task_type": "CHAT",
                                "receiver_type": "SELF",
                                "receiver": "",
                                "message": "You died :<"
                            }
                        ]
            }

##Makes skeletons to drop 1 less bone

            {
                "event_type": "LIVING_DROPS",
                "target": "Skeleton",
                "tasks": [
                            {
                                "task_type": "DROPS_REMOVE",
                                "modid": "minecraft",
                                "name": "bone",
                                "meta": "0",
                                "count": "1"
                            }
                        ]
            }

##Writing in chat IDENTIFY while holding item will write its modid, name and meta for use with ACE

            {
            "event_type": "CHAT",
            "text": "IDENTIFY",
            "tasks": [
                        {
                            "task_type": "IDENTIFY"  
                        }
                    ]
            }

##Writing in chat SPWN will spawn on players feet primed tnt with fuse time of 40 ticks

           {
            "event_type": "CHAT",
            "text": "SPWN",
            "tasks": [
                       {
                                    "task_type": "SPWN_MOB",
                                    "type": "PrimedTnt",
                                    "location_type": "SELF",
                                    "xCoord": "0",
                                    "yCoord": "0",
                                    "zCoord": "0",
                                    "nbt": "{Fuse:40}"
                       }
                     ]
           }

##Writing in chat BLOCk will spawn Zombie spawner instead of pig spawner

            {
            "event_type": "CHAT",
            "text": "BLOCK",
            "tasks": [
                        {
                            "task_type": "BLOCK",
                            "modid": "minecraft",
                            "name": "mob_spawner",
                            "meta": "1",
                            "location_type": "SELF",
                            "xCoord": "0",
                            "yCoord": "0",
                            "zCoord": "0",
                            "nbt": "{EntityId:Zombie}"
                        }
                    ]
            }

##Right clicking pig will display player message "Beep!"

            {
                "event_type": "INTERACT_ENT",
                "target": "Pig",
                "tasks": [
                            {
                                        "task_type": "CHAT",
                                        "receiver_type": "SELF",
                                        "receiver": "",
                                        "message": "Beep!"
                                }
                        ]
            }

##Tossing stick will spawn woolf in random location near player in radius of 4 blocks

            {
"event_type": "TOSS",
"issuer": "ALL_PLAYERS",
"modid": "minecraft",
"name": "stick",
"meta": "0",
"tasks": [
         {
            "task_type": "SPWN_MOB",
            "type": "Wolf",
            "location_type": "RANDOM",
            "radius": "4";
            "xCoord": "0",
            "yCoord": "0",
            "zCoord": "0"
         }
    ]
            }

Updated