MobToggle
MobToggle - simple Mob control:
Version: v1.2
MobToggle is a simple plugin that allows you to turn monsters and animals on and off using simple commands. It is permissions compatible, and allows you to control both monsters and animals separately. It supports multiworld, and will only modify the world you are standing in when you use it.
When you turn Monsters off, it automatically kills all monsters on the map, and reports how many of them were killed.
However, it will NOT prevent mobs from spawning by unnatural means, such as other plugins. I have done some testing and it seems to be working fine, but please do report any problems and I will try to fix them quickly.
The commands are:
- /montoggle - turns monsters on/off
- /anitoggle - turns animals on/off
- /mobtoggle - turns monsters AND animals on/off.
A note about /mobtoggle: it switches both of these independently of the state the other is in. This means that, for example, if monsters are off and animals are on, using /mobtoggle will turn monsters on and animals off!
the permissions are as follows:
- MobToggle.MonToggle - allows /montoggle
- MobToggle.AniToggle - allows /anitoggle
- MobToggle.MobToggle - allows /mobtoggle
- MobToggle.* - allows all of the above.
Each of these are given to OPs by default.
Features:
Allows you to turn monsters on/off Allows you to turn animals on/off Still allows other mob spawning plugins to function When Monsters are off, health regenerates. Persistence (settings optionally carry through reboot, see below)
About Persistence ATTENTION: TURNS OUT I BROKE THIS! HOPE TO HAVE IT BACK SOON!
Persistence is now available for MobToggle. What that means is that when you stop the server it will save the state of each world, and attempt to restore those settings when you next boot up. It will always save the settings, but will not load them unless you change persistence: false in config.yml to persistence: true. This file will only exist after you run the server at least once. The setting is off by default because it conflicts with other plugins that attempt to manage the same settings, such as multiverse. Mobtoggle still operates fine with these plugins (to my knowledge) when persistence is kept off.
You can also change the saved spawn settings in the file manually, if you want. Settings are stored as [worldname]: [setting]. Simply alter the entry for the world in question to use the new setting. Valid options are:
- monsters
- animals
- both
- neither
The file should not be case-sensitive and technically only reads the first character, so it should be fairly difficult to break. In the event that it does read an invalid setting, however, it will simply default to "both".
@mctribble
That's alright.
@Dailan_Mistwalker
I think it can be done, but I'm sorry to say I am not in a position to make such an attempt. There is a lot going on for me right now, and I just don't have the time to put into it. Sorry.
Could you add the option to let mob spawners spawn?
@Lehl37
Sadly, the configs got a bit broken and I haven't been able to go back in to fix them. Really though, persistent management of this sort of thing is probably better handled by a plugin like multiverse anyway.
To make multiverse stop mob spawning, go to the world in question and type:
/mv modify set animals false
Multiverse can even restrict spawns to certain types of mobs if you want, though I don't remember how so you would have to look that up in their wiki.
nice little everything u got there :D
i actually use this plugin on my server since its just simple.
multiverse can stop mobs spawning too? how?xD
actually my mobtoggle doesnt has any config file or even any folder :D works still.. but it toggle mobs on everytime i restart the server
@vatofrog
Did it quit working? To my knowledge there isn't anything that should have broken it.
please up date it
great plugin very useful working on 1.2.5 no problem thanks
@mctribble
Its awesome! Thanks m8, its working! :))) Finaly just resolved ;D
@AnimusTheHUN
I have some good news too. I was reading through your list and found multiverse on it. multiverse has some known issues with mine, so I looked into it. See, multiverse saves spawn settings for its worlds and loads them up automatically. What's happening is mobtoggle loads it, and then multiverse overrides it. What that means for you is that persistence simply will not work right, but there's a solution!
All you have to do is tell Multiverse you don't want animals in your world. To do this, stand in the world in question and type: /mv modify set animals false and you're golden! In fact, it sounds like you don't need mobtoggle at all.
You can read more about this here: https://github.com/Multiverse/Multiverse-Core/wiki/World-properties#wiki-animals
@mctribble
Ups there are some news :)) I just deleted the mobtoggle folder, let the 1.2.2 plugin to create it again. Its sucessfull and it is can read correctly the config file's first 3 lines. I mean the main world and nether, the end world's data. The server.log show it now correctle (Y) :) But it isnt apply. I mean when i log in and type /anitoggle, its just disable animal spawn. However in server.log file show "as monsters"
config file at startup: (its totaly correct)
persistence: true
realcraft1: monsters
realcraft1_nether: both
realcraft1_the_end: both
realcraft2: both
realcraft3: monsters
server.log at startup: (correct, but realcraft2 and realcraft3 worlds are missing)
2012-04-01 17:32:07 [INFO] [MobToggle] Enabling MobToggle v1.2.2
2012-04-01 17:32:07 [INFO] [mobtoggle]Loading settings...
2012-04-01 17:32:07 [INFO] [mobtoggle]: read setting for realcraft1 as monsters
2012-04-01 17:32:07 [INFO] [mobtoggle]: read setting for realcraft1_nether as both
2012-04-01 17:32:07 [INFO] [mobtoggle]: read setting for realcraft1_the_end as both
2012-04-01 17:32:07 [INFO] MobToggle version 1.2 is enabled.
The result is, the animal spawn disable is not activate in world. I must type it again for disable when i logging in the server after restart.
So a little step forward :))
Another important thing maybe: Does plugin loading sequence mean? As i see in server.log, the "Multiverse" plugin what manage 2nd and 3rd
added worlds, is loading after MobToggle. Is it would be problem? If yes, can i change the loading sequence shomehow?
@mctribble
Atm i rent a host at "www.clans.hu". Its a game server hoster and they have rly good support, and they also provide full acces to any config.
As you will see i use tonns of plugins. But each one need for setuping everything what needed on server. Full plugin list:
BankCraft (for money and XP banking)
BlockDoor (can create doors made of blocks)
BlockLog (a block logging and map restore plugin)
Essentials; -chat -GeoIP -group manager (for permissions).
FoundDIamonds (show each ore finding on server by chat massage)
GriefPrevention (antiGrief and land protect tool for players)
HomeSpawnPlus (a nice spawn/home customize tool)
iConomy (iconomy plugin)
iZone (landprotect tool for admin)
Jail (Jail plugin)
Master Promote (palyers can buy ranks from their ingame money)
MineralVein (an oregenerator tools. I use to customize chance of diamonds on map)
MobHealth (show damages wich are dealed player
> mob)Mobs (i use it to customize mob's stats and drops)
Multiverse , -Portals, -Nethergates
NoCheat
Orebfrustractor (anti-xray)
SignShop
SkylandsPlus (can use together with multiverse for creating a skyland type world)
Stargate (portal plugin)
Terrain Control (like skylands but another types of worlds)
Vault (required for many iconomy compatible plugin)
xAuth (offline login authenticator)
These plugins are up to date and fully compatible with atlast 1.2.4 R01.
@AnimusTheHUN
hm, that's pretty strange. I think whats going on is it cant find the file it made earlier and is reverting to defaults, which is bizarre behavior since it is clearly saving to that very file properly. The only cause I could think of is that your computer is denying it permission for some reason or other, though that doesn't make a whole lot of sense.
As for not finding logs on some worlds, my best guess is that those worlds weren't loaded and active at the time your server booted up, and thus were not returned to the plugin when it asked for a list. That will probably need some workaround or other, but I'm not sure what off the top of my head.
I'll try and do a little research, but in the meantime try:
I'm sorry this is causing so much hassle. Hopefully we can figure out a fix. I might even be able to just write a plugin that disables animal spawning altogether, though that would probably still have the issue of not seeing all your worlds.
@mctribble
Thanks! It would be a rly usefull plugin and i will run it on my server. This is 100%. Only this little "persistance" thing left for:)
@mctribble
Thanks for replay and for your time to make a new release!:)
I just tested it on MineCraft 1.2.4 2126-R01 Bukkit. Here is a part of server.log file for MobToggle's part:
2012-04-01 14:41:08 [INFO] [MobToggle] Enabling MobToggle v1.2.2
2012-04-01 14:41:08 [INFO] [mobtoggle]Loading settings...
2012-04-01 14:41:08 [INFO] [mobtoggle]: read setting for realcraft1 as both
2012-04-01 14:41:08 [INFO] [mobtoggle]: read setting for realcraft1_nether as both
2012-04-01 14:41:08 [INFO] [mobtoggle]: read setting for realcraft1_the_end as both
2012-04-01 14:41:08 [INFO] MobToggle version 1.2 is enabled.
At this time, the data of MobToggle's config file when i start the server:
persistence: true
realcraft1: monsters
realcraft1_nether: both
realcraft1_the_end: both
realcraft2: animals
realcraft3: monsters
For some reasen, the plugin cannot read-out correctly the datas from config file? (i did not modified it manualy. I just let the plugin to generate and modify it by ingame commands (/anitoggle /montoggle) Also i cannot found process data about "realcraft2 and 3" worlds in server.log by Mobtoggle.
Only one plugin exist on my server wich can manipulate the mob spawning. Its calling "Mobs". For Mobtoggle, in this Mobs plugin, i disabled all manipulate for any animal spawn data. (My primary target is disable animal spawn in every world. They can spawn only by "spawnegg" by useing a player. I cannot do this with "Mobs" :( For this i would like to use your MobToggle plugin.
Have you got any tipp what would be the problem? :/
@AnimusTheHUN
Well I recompiled the plugin to the latest recommended build and failed to reproduce your problem. I'm HOPING that means the recompile fixed it, but if not we have some work to do here. If mobtoggle V 1.2.2 (which I just uploaded, might need to give it a few minutes) does not fix it, then read on:
First of all, bukkit does not let plugins access the world before it is generated. The result of this is that if you install the plugin, turn off monsters, and load up then it will still make animals in those first few chunks. Subsequent ones should be free of animals like normal. If that is your issue, I think commandbook's /butcher can get rid of them, or even MCedit if you prefer.
If that is not your problem, please read the server messages carefully. I added some more, so it should tell you exactly what settings it is reading. It should also tell you if it finds that setting invalid.
Finally, make sure you have the latest RB, 1.2.4R1.0. If after all this you still have issues, we probably have a conflict with something else or a bad config file. If you are changing the file manually, try avoiding that just in case its more sensitive than it should be in some way or other. Also try looking through your plugins for anything that may be conflicting. It isn't always obvious, multiverse will conflict, for one. You can post your list here and I can help look if you like.
@mctribble
Thanks! It would be a rly usefull plugin and i will run it on my server. This is 100%. Only this little "persistance" thing left for:)
@AnimusTheHUN
How aggravating. I had it working on my end. I'll look into it again once I have a chance. Thank you for the report
@mctribble
Persistance still not working under 1.2.4 R01-2126. The config. file is generated, its ok. The values are changing (both/animals/monsters) if i use commands ingame. i also set "true" the persistance. But when i restart the server, plugin is not do what contains the config file. I must set again and again after every restart.
@lmazon
Good news! Turns out I overestimated the difficulty of my problem, and persistence was pretty fast to implement. I uploaded a new version now which SHOULD work. I wasn't able to test it too thoroughly, though, so I would appreciate it if you could let me know if it works over on your end.
@mctribble
Ah, I see. I think multiverse can handle that. Custom difficulty probably can as well, but I think it's outdated right now. Good luck finding something.