Extra Events

logo

Extra Events


This is a plugin to easily allow devs to add some extra events not found in Bukkit


Time Events

HourChangeEvent
Called every Minecraft hour
Members - hour
SecondTickEvent
Called every real life second
DawnEvent
Called when the Minecraft time is 0
MiddayEvent
Called when the Minecraft time is 6000
DuskEvent
Called when the Minecraft time is 12000
NightEvent
Called when the Minecraft time is 12500
MidnightEvent
Called when the Minecraft time is 18000
TimerActivateEvent
Called when a timer goes off (see below)
Members - timer

Area Events

PlayerEnterAreaEvent
Called when a player enters an area (either WorldGuard region or Area)
Members - player, area
PlayerLeaveAreaEvent
Called when a player leaves an area (either WorldGuard region or Area)
Members - player, area
PlayerInAreaEvent
Called every half a second a player is inside an area (either WorldGuard region or Area)
Members - player, area

Entity Events

LivingEntityBlockEvent
Called when a LivingEntity is hit whilst invincible
Members - entity, attacker, cause
LivingEntityDamageEvent
Called when a LivingEntity is hit and not invincible
Members - entity, attacker, cause, damage
PlayerApproachLivingEntityEvent
Called when a Player gets near a LivingEntity
Members - entity, player
The range is customizable (see below)
PlayerLeaveLivingEntityEvent
Called when a Player moves away from a LivingEntity
Members - entity, player
The range is customizable (see below)
PlayerNearLivingEntityEvent
Called every half a second when a Player is near a LivingEntity
Members - entity, player
The range is customizable (see below)
PlayerTargetedEvent
Called when a hostile mob targets a player
Members - entity,player, reason

Timers

It's possible to set up events to be fired every x seconds. See below or in the config file for an example.

If you're a Mobs user you can set timers here and use the timer.txt event file to react to them. Use the if_timer condition to check the timer's name if you have more than one.


Config

approach:
  x: 10
  y: 4
  z: 10
leave:
  x: 10
  y: 4
  z: 10
near:
  x: 5
  y: 4
  z: 5
areas:
  world_name:
    area_name:
      x:
        from: 10
        to: 20
      y:
        from: 55
        to: 58
      z:
        from: 100
        to: 120
timers:
  example:
    interval_in_seconds: 300
    enabled: no
    world: world_name

These are the defaults for the entity events.

The top section controls how close a Player must be to a LivingEntity to call the PlayerApproachLivingEntityEvent.
The middle section controls how close a Player must be to a LivingEntity to call the PlayerLeaveLivingEntityEvent.
The bottom section controls how close a Player must be to a LivingEntity to call the PlayerNearLivingEntityEvent.

The middle section deals with areas. Use this to add areas without needing WorldGuard. The areas are only markers for convenience and don't offer any protection, owners, etc.

The last section deals with timers. Each timer needs a unique name ('example' above), and a valid world name or it will be disabled. You can control the timers from in game with the /timers command (see below).


Commands

/reload_extraevents, or /ree
Reloads the config without reloading the server.
Needs the permission extraevents.can_reload_config, or op.
/timers, or /t
Allows timers to be disabled, paused, etc.
Needs the permission extraevents.can_change_timers, or op.
/timers
Shows a report of the current status.
/timers pause
Stops the plugin from activating any timers automatically.
/timers unpause
Reverses the above.
/timers enable
Enables all timers.
/timers enable [name]
Enables the timer called [name].
/timers disable
Disables all timers.
/timers disable [name]
Disables the timer called [name].
/timers activate
Activates all timers, as if they had reached 0.
/timers activate [name]
Activates the timer called [name], as if it had reached 0.
/timers check
Shows a report of all timers.
/timers check [name]
Shows a report of the timer called [name].
/timers set_interval x
Sets the interval of all timers to x.
/timers set_interval x [name]
Sets the interval of the timer called [name] to x.

Note that none of these commands changes the config itself, so all timers will be reset to their original values after reloading.


How To Use

Add this plugin to the project in exactly the same way as you add Bukkit, and use the events in the same way as normal Bukkit events.


Donate

Plugins take a lot of time to maintain, and Pepsi Max helps me think. So if your server enjoys the effects of this plugin please consider sending some Pepsi Max my way!

Donate

If you're penniless or like the plugin but not that much I'm also partial to TF2 items. Send any you don't want my way! STEAM id: coldandtired

If you don't know what TF2 is, then start playing! It's free and fun!

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of coldandtired coldandtired Mar 23, 2014 at 20:32 UTC - 0 likes

    @TiffanyValenti: Go I believe so. I haven't messed around with players spawning mobs much but you would have to look at the Bukkit docs and see if there is a way to determine which player spawned the mob, and then block the event.

    alt text

  • Avatar of TiffanyValenti TiffanyValenti Mar 23, 2014 at 17:40 UTC - 0 likes

    So for the PlayerTargetedEvent it would be possible for me to say spawn a creeper and have it not target the person who spawned it?

  • Avatar of coldandtired coldandtired Mar 14, 2014 at 10:14 UTC - 0 likes

    @nateku2: Go Do you mean the spawn timer (how many mobs per tick)? You can adjust that in the bukkit properties file (or the server one, I forget).

  • Avatar of blackeye6 blackeye6 Mar 13, 2014 at 22:31 UTC - 0 likes

    Just what I was looking for, works perfectly ;3

    I am xTDKx

  • Avatar of nateku2 nateku2 Mar 13, 2014 at 22:23 UTC - 0 likes

    can I make the minecraft timer slower with this plugin?

  • Avatar of coldandtired coldandtired Mar 08, 2014 at 22:06 UTC - 0 likes

    Make sure to delete any old version before updating to 1.7.2 b1.

  • Avatar of coldandtired coldandtired Nov 15, 2013 at 21:22 UTC - 1 like

    @Relicum: Go This would still be thread safe though as long as the timers also ran on the main thread.

    Undesirable, sure, but safe :)

  • Avatar of Relicum Relicum Nov 15, 2013 at 17:37 UTC - 0 likes

    @coldandtired: Go

    he is incorrect, running something on the Main Thread does not make it thread safe, unless their is still the potential of blocking the thread or overloading it with time tasks. Imagine starting a Timer every time this event ran LivingEntityDamageEvent . You'd soon have trhe server grinding to a halt. So be warned.

    Currently Developing SuperSkyBros and SuperSkySmash
    PM Me for custom requests

    SuperSkyBros

    BFAK:90660990,b67db4cc3684bda9a1c3502120dc091fefe2e0d983aa40fcef932f12ef122b3d

  • Avatar of coldandtired coldandtired Oct 24, 2013 at 14:31 UTC - 0 likes

    @flybelette: Go There's no need. Every world on the server has the same time (or at least it worked this way when I wrote it).

  • Avatar of flybelette flybelette Oct 24, 2013 at 12:27 UTC - 0 likes

    Hi ! How can i get the World with The MidnightEvent ? Thanks :)

Facts

Date created
Nov 12, 2012
Categories
Last update
Mar 08, 2014
Development stage
Release
Language
  • enUS
License
All Rights Reserved
Curse link
Extra Events
Downloads
4,057
Recent files

Authors