MonsterMoon
MonsterMoon
In NetHack moon phases affect the environment – and with this plugin that can happen in Minecraft too!
With this small plugin you can:
- Create custom size calendars and simple linear procedures for each of your worlds.
- Calendar that has multiple of eight (8, 16, 24, ...) number of days can be linked to the moon phases.
- Set difficulty levels, PVP, spawning, and run commands on per-day and per-world level.
- Create a set of totally random events!
- Create an once in a blue moon event, that happens both very rarely and very predictably (if you count the days...)
A simple example:
WorldName: # On this world day-begins: dawn # days will change when the sun rises. commands-on-enable: - say MonsterMoon is now activated for world "WorldName"! commands-on-disable: - say Server level defaults are automatically restored! spawn-monsters: false # In this world monsters do not spawn calendar: Monday: spawn-monsters: true # Except on Mondays, and... Tuesday: # ... on Tuesdays there is 50 % spawn-monsters: true false # possibility of monsters. Wednesday: void # World level defaults are # restored on Wednesday. Thursday: commands: - say This command is run when Thursday begins. Friday: pvp: true # Overdrives the server default. Saturday: day-begins: -3000 # Saturday begins earlier than usual. Sunday: void # Totally normal day.
Installation
Installation is done the usual way, just drop the MonsterMoon.jar into the plugins directory and /reload server plugins.
Configuration is done via the plugins/MonsterMoon/config.yml file. When you run MonsterMoon the first time it will create an example configuration file that you can edit.
Format of the config.yml
WorldName: # Name of the world where the following rules apply: [properties] # Default properties for this world. (See list below.) commands[-on-enable]: # Commands that are executed when - say MonsterMoon is on! # MonsterMoon is being enabled. - tell Player1 Hello! commands-on-disable: # Commands that are executed when - tell Player1 Bye! # MonsterMoon is being disabled. - say MonsterMoon is off! day-begins: midnight # Time when day changes. (See values below.) day-order: universal # Which order the following calendar # days are applied. (See values below.) calendar: # This world has the following calendar days: Monday: # Name for this day [properties] # Properties for this day. (See list below.) commands: # Commands that are executed on this day. - say It's Monday. Tuesday: [properties] commands: - say It's Tuesday. [...]
Empty Days
You can create empty (nothing but default values) calendar days, but due to the YAML format each day must have some content. Use something like the following to create days that do not have any events:
calendar: Monday: void Tuesday: still nothing # (It does not actually matter Wednesday: _ # what is written here.)
Commands
With commands-on-enable (run when MonsterMoon plugin is enabled), commands-on-disable (run when MonsterMoon plugin is disabled) and daily commands (run when day begins) you can run either standard CraftBukkit commands, or control other plugins. Commands must be listed in YAML list notation even when there is only one command in the list. Also, do not use the forward slash (/) for the commands.
For example:
SomeWorld: calendar: Monday: commands: - weather clear # Weather is always clear on Mondays Tuesday: commands: - weather thunder # It thunders on Tuesday! - bloodmoon next # Schedule BloodMoon plugin for the next night - pluginmanager enable TinyTweak # Use PluginManager plugin # to enable another plugin
Possible [properties] are
difficulty: [Number] # number in range [0..3] peaceful # same as 0 easy # same as 1 normal # same as 2 hard # same as 3 default # use default value (for this world) server-default # use default value (for this server) no-change # preserve the current value spawn-monsters: spawn-animals: pvp: true # property is active false # property is not active default # use default value (for this world) server-default # use default value (for this server) no-change # preserve the current value
These properties are set by per-world and per-day basis and will override the values set in the server.properties file.
Scope
If property is not defined for a calendar day, a world default value will be used instead. For example:
SomeWorld: spawn-monsters: false # Monsters do not usually spawn on SomeWorld calendar: Monday: spawn-monsters: true # Monsters will spawn on Monday Tuesday: void # Monsters will NOT spawn on Tuesday, # because SomeWorld default is false Wednesday: void
If you want properties to propagate you have to set either Tuesday or the world default to no-change. For example:
SomeWorld: spawn-monsters: no-change # Leave values as-is (use server default) calendar: Monday: spawn-monsters: true # Monsters will spawn on Monday Tuesday: void # Monsters will spawn on Tuesday! Wednesday: void
To randomize properties
You can randomize properties by introducing multiple possible values on the same line.
Example:
spawn-monsters: no-change no-change false # There is 33.33% possibility # that monster spawning will cease.
Possible values for day-begins are
day-begins: [Number] # The actual time of day. midnight # same as -6000 sunrise # same as 0 midday # same as 6000 sunset # same as 12000
Example:
day-begins: 9000 # Day will change at 3 o'clock in the afternoon.
Technical details
Negative numbers are allowed because the actual time is calculated as a delta to the world.getFullTime(). This means that numbers over 24000 are also allowed.
Example:
day-begins: 6000 When Monday begins the time is: world.getFullTime() == 222000, world.getTime() == 6000 Tuesday is now scheduled to begin at: (222000 - (222000 % 24000) + 24000) + 6000 == 246000 ^ 'day-begins' delta
Possible values for day-order are
day-order: universal # The next day will be determined from the global time linear # First day of the calendar is always executed first random # Days follow each other in random order
Notes and Usage Ideas
- To create a fixed "moon phase" calendar use day-order: universal with a calendar that has multiple of eight (8, 16, 24, ...) number of days.
- To create a simple procedure that is guaranteed to proceed in a linear order use day-order: linear.
- To create a random set of events use day-order: random.
- In day-order: universal days are guaranteed to be a day long, but in linear and random mode days can actually be much shorter if you use the day-begins property creatively.
About /time
Using /time add or /time set throws MonsterMoon out of sync. You can either wait the problem to solve itself (it will), or fix it manually by stopping and restarting MonsterMoon calendar:
- Stop MonsterMoon in world "WorldName": /monstermoon WorldName stop
- Add some time: /time add 10000
- Restart MonsterMoon in world "WorldName": /monstermoon WorldName start
Compatibility
Compiled with Oracle Java 1.7.0_21 against Bukkit 1.5.2-R0.1 API.
License
Public Domain (Creative Commons Zero)
Source Code
Included in the MonsterMoon.jar package.
This is one of the most helpful and concise tutorials I have read in awhile. Thanks for the plugin, and the tutorial.
Sounds pretty Awesome!
gonna test it out!
@medullaman And answers to the rest of the queries:
1. The moon phases in the config are just an example. (Not a default of any sort.) The calendar is essentially a list of days that will be looped over.
2. Yes. If you want a monthly event you have to create a "monthful" of days. Most of those days can be "void" if you do not anything special for them.
3. Days are no way limited to Monday-Sunday, or not even to moon phase names. (I have used those for an example.) In fact, a 8-day "week" is much more sensible in Minecraft setting, because it will sync the moon phases.
This is one of those plugins that are at the same time so simple, and so full of possibilities, that you have to play around with the settings to find the full potential. Just remember the basic rule: Calendar is a list of days that is looped over.
@medullaman Hello!
The calendar is a per-world type of setting. In "config.yml" you have to change the word "MonsterMoon" to match the name of the world you want to calendar to be active in.
F.ex., change:
MonsterMoon:
to:
My_Own_World:
Reload plugins, and you should be ready to go. The world name is case sensitive, so please check the exact spelling!
Hello and thanks for sharing this awesome idea. I am excited to start using it on my server.
I want to be sure I understand the config file correctly, I see that there is already calendar entries for the moon phases but when I load the plugin I also that it says I have no days in my calendar. This leads me to a few questions.
1. Are the phases a sort of default if you have nothing else defined for that particular day. So I have Mon Tues and wed set as void but this particular Monday is a full moon so those setting will be applied? And what about Fridays, if they have settings and its a full moon, do the day settings over ride the moon phase settings?
2. If I want a "monthly" event do I need to create a full month of days in the config. And similarly if I wanted an event that happened every 6 full moons does there need to be 6 full moons of days.
3. Are the days limited to the standard Monday - Sunday or could we create an 8 day week or a 4 day week with custom day names
Thanks ahead of time for your help. And again kudos on a really cool idea.
@xcuirsed
Nope. With this plugin you can make stuff to happen on each day.
(Actually... there is a possibility that you can lengthen a day with this plugin. Choosing "day-order: linear" and creating a hour long subdays (with funnily numbered "day-begins:"...) each of them having something like "commands: [time add -1000]" in them... I have no idea how that would really work!)
I hopefully got this right,
You can extended the minecraft day lengths with this plugin correct?
Thanks
@RoosSkywalker The plugin has now been approved and is available for downloading!
Thank you for the interest. This one was written primarily for personal use only, but feel free to send bug reports!
@fungreenfox You can execute either standard CraftBukkit commands, or command other plugins. I added an extra section to the documentation.
I am missing information about the "custom commands". Can i do anything but change void and mobs at a given time?
Once this comes out, I will download it.
This looks awesome! if you need any help just ask.