QUOTE |
An example of using this feature is given in chestguardian2.xml in xmlextras. In this example the guardian spawner is triggered by the property test (TriggerObjectProp) "totalitems<1 | totalweight<20" which will lead to triggering of the chest guardian if anyone removes the pile of gold from the chest completely (leaving totalitems=0), or removes some of the gold, (reducing the totalweight to below 20). Another example is given in chestguardian3.xml in xmlextras. In this example the guardian spawner is triggered by the property test (TriggerObjectProp) "totalitems>1 & totalweight>40" which will lead to triggering of the chest guardian if at least one additional item is added (totalitems>1), and the added items weigh enough to push the totalweight above 40. |
QUOTE |
Description of doorguardian.xml: (note, after loading the example do a respawn on both to quickly set them up) This uses two spawners. One spawns three doors, and the other spawns a mob that is triggered by opening one of the doors. This is an example that demonstrates how the SERIAL and GETONSPAWN keywords can be combined to set up self-configuring triggered spawners rather than having to explicitly use targeting to select triggering objects. The first spawner spawns 3 metal doors and makes them immovable. At the same time it sets the TriggerObject property on the second spawner (named DoorGuardian#2) to the serial id of the first spawn entry (one of the metal doors). It also sets the TriggerObjectProp propery of the second spawner to "open=true", which will cause the second spawner to be triggered when that door is opened. The second spawner simply spawns the guardian mob that is a standard troll with its hits and str buffed. Each line is a spawn entry and the number next to it refers to the subgroup assigned to the entry. First spawner (DoorGuardian#1) 1 metaldoor,0/movable/false 1 SET,DoorGuardian#2/triggerobject/GETONSPAWN,1,SERIAL/triggerobjectprop/open=true Second spawner (DoorGuardian#2) troll/name/Door Guardian/hitsmaxseed/1000/hits/1000/str/200 Note, this spawner example is exactly the same as manually creating the doors, then creating the guardian spawner and setting its TriggerObject and TriggerObjectProp properties by hand. Description of chestguardian.xml: This is similar to doorguardian.xml but uses chests instead of doors, and is triggered when a player removes the contents of the chest. |