This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
What is the issue?Basically I'm a bit of a noob at coding this but here's what I came up with:My idea is to log every time an animal is killed, where it was killed and who killed it.<event> <outcome affected_mobs="pig,cow,sheep,chicken,mooshroom"> <actions> <log>Mob was killed by %player%</log> </actions> </outcome></event>
Also I'm looking to modify xp or item drops of mobs depending on whether they were killed in a certain coordinate (an incentive to use our arena for easier xp or different drops).Many thanks for any help given :)
Both are possible. Place something like this in the dies.txt file:
<event> <outcome affected_mobs="pig,cow,sheep,chicken,mushroom_cow"> <action_group> <actions> <log>Mob was killed by ^killer^</log> <continue/> </actions> </actions_group> </outcome> <outcome affected_mobs="pig,cow,sheep,chicken,mushroom_cow"> <condition_group> <conditions> <x>above 10, 15 to 20</x> <conditions> </condition_group> <action_group> <actions> <drop_exp>50</drop_exp> </actions> </action_group> </outcome> </event>
That's a quick example. Take a look at the tutorial website to see more actions and conditions.
Ok thank you :) With the first script it'll say who killed the mob, but will it also record the location of the event?
I can work the rest out though, getting the basic structure was something I wasn't sure about.
And I assume in the spawns file I could write similar code to the first one to log when withers are created (in the event someone uses it to grief a house).
All the event files use the same syntax so it would work (without the killer part of course).
Looking at the code, it seems I never added a location constant :( I'll add that soon. There is a ^world_name^ one though.
Ok been playing with the code but no matter how I do it (using tutorial) dropping items or exp doesn't work. Is this a known bug? P.s. thanks for all the help with the logging though, I'll make an individual event for each mob (so i know what mob was killed). Can't wait for location to be recorded also, will be a very useful anti-griefing tool :)
Lastly I'm wondering whether mobs has the ability to log spawning of a wither and who spawned it (location obviously once you update that). Is this possible? Thinking adding this and the ^killer^ tag (and any others) to the subelement page? You said they use the same syntax so would it be ^spawner^ to know who spawned a wither boss?
It's all in the works. I'm currently moving this all to a separate plugin which will handle all logging of actions and conditions (with different levels of information).
To post a comment, please login or register a new account.