Skip to content

Commit

Permalink
More events and a event list.
Browse files Browse the repository at this point in the history
  • Loading branch information
hparcells committed Aug 8, 2020
1 parent 7a9014a commit 08bc1f6
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [1.1.0] - 2020-08-08
### Added
- More Events
- **Diamond**: Gives you a diamond.
Expand All @@ -16,12 +16,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Fire Trail**
- **Explosive Beds**: Boom!
- **Slippery Buckets**: Dumps bucket contents at your feet.
- **Full Heal**: Sets your HP to max.
- **Full Hunger**: Sets your hunger and saturation to max.
- **Zero Hunger**: Removes all your hunger and saturation.
- **Food Poisoning**: All food items will give you food poisoning.
- Effect Events
- Speed
- Jump Boost
- Blindness
- Mining Fatigue
- Haste
- Event list in the `EVENTS.md` file in the GitHub repository.

### Fixed
- Fixed an issue involving effects not being removed. (#1)
Expand Down
191 changes: 191 additions & 0 deletions EVENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Events
> Haha yes.
Events are categorized into three. Good, passive, and bad.

## Table of Contents
- [Good](#good)
- [Passive](#passive)
- [Bad](#bad)

## Good

### Beef
- **Description**: Gives you 16 steak.
- **History**
- **v1.0.0**: Added.

### Diamond
- **Description**: Gives you a diamond.
- **History**
- **v1.1.0**: Added.

### Diamond Pickaxe
- **Description**: Gives you a diamond pickaxe.
- **History**
- **v1.0.0**: Added.

### Full Heal
- **Description**: Heals you.
- **History**
- **v1.1.0**: Added.

### Full Hunger
- **Description**: Fills your saturation and hunger.
- **History**
- **v1.1.0**: Added.

### Haste
- **Description**: Applies max haste for the duration of the event.
- **History**
- **v1.0.0**: Added, but disabled because it doesn't work.
- **v1.1.0**: Fixed, and enabled.

### Nice XP
- **Description**: **Sets** your XP to 69.
- **History**
- **v1.1.0**: Added.

## Passive

### Aw man?
- **Description**: Plays a creeper hissing sound.
- **History**
- **v1.0.0**: Added.

### ~~Chat Kick~~
- **Description**: Kicks you for spamming when you send any message.
- **History**
- **v1.1.0**: Added, and currently disabled because it doesn't work.

### Gardener
- **Description**: Gives you 16 of *a lot* of different flowers and decoration plants.
- **History**
- **v1.0.0**: Added.

### H
- **Description**: Gives you a H banner.
- **History**
- **v1.0.0**: Added.

### Tree
- **Description**: Summons a tree where you are standing.
- **History**
- **v1.1.0**: Added.

## Bad

### Anvil
- **Description**: Places an anvil above you.
- **History**
- **v1.0.0**: Added.

### Aw man.
- **Description**: Spawns a creeper above you.
- **History**
- **v1.0.0**: Added.

### Bedrock Feet
- **Description**: Places bedrock under where you are standing.
- **History**
- **v1.0.0**: Added.

### Blindness
- **Description**: Applies blindness for the duration of the event.
- **History**
- **v1.0.0**: Added, but disabled because it doesn't work.
- **v1.1.0**: Fixed, and enabled.

### Butterfingers
- **Description**: Drops the currently held item.
- **History**
- **v1.0.0**: Added.

### ClearLag
- **Description**: Kills all items on the ground.
- **History**
- **v1.1.0**: Added.

### Explosive Beds
- **Description**: Any beds clicked will explode.
- **History**
- **v1.1.0**: Added.

### Fire Trail
- **Description**: Fire will be set under your feet for the duration of the event. Even if you extinguish it.
- **History**
- **v1.1.0**: Added.

### Food Poisoning
- **Description**: All food eaten will apply the hunger effect for 30 seconds.
- **History**
- **v1.1.0**: Added.

### Half a Heart
- **Description**: Sets your HP to half a heart.
- **History**
- **v1.0.0**: Added.

### Hard
- **Description**: Sets the world difficulty to Hard for the duration of the event.
- **History**
- **v1.1.0**: Added.

### Hot
- **Description**: Sets fire under your feet one time only.
- **History**
- **v1.0.0**: Added.

### I am speed.
- **Description**: Applies max speed for the duration of the event.
- **History**
- **v1.0.0**: Added, but disabled because it doesn't work.
- **v1.1.0**: Fixed, and enabled.

### Jump
- **Description**: Applies max jump boost for the duration of the event.
- **History**
- **v1.0.0**: Added, but disabled because it doesn't work.
- **v1.1.0**: Fixed, and enabled.

### Mining Fatigue
- **Description**: Applies max mining fatigue for the duration of the event.
- **History**
- **v1.0.0**: Added, but disabled because it doesn't work.
- **v1.1.0**: Fixed, and enabled.

### Skydive
- **Description**: Teleports you 100 blocks up.
- **History**
- **v1.0.0**: Added.

### Sky Lava
- **Description**: Sets one lava source block at Y=255 where you are standing.
- **History**
- **v1.0.0**: Added.

### Slippery Buckets
- **Description**: Any buckets emptied will have their contents emptied at your feet.
- **History**
- **v1.1.0**: Added.

### Trip
- **Description**: Drops your entire inventory on the ground.
- **History**
- **v1.0.0**: Added.
- **v1.0.1**: Fixed duplication glitch involving the armor and off hand item.

### Zero Hunger
- **Description**: Sets your hunger and saturation to zero.
- **History**
- **v1.1.0**: Added.

### Zero XP
- **Description**: Sets your XP to zero.
- **History**
- **v1.1.0**: Added.

### Zeus
- **Description**: Strikes you with lightning.
- **History**
- **v1.0.0**: Added.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Chaos
> Fun with random Minecraft events.
## About
Chaos is Minecraft plugin that runs random events (good or bad) periodically through out. The default is set to a
random time between 30 and 40 seconds. Read more about the events in the EVENTS.md file in the GitHub repository.

## Usage
- `/chaos [add|remove] [username]` will add or remove players from the list of players that will be affected
by the outcome of the chaos events. Note: this does reset whenever the plugin is reloaded.
Expand All @@ -18,6 +22,9 @@ by the outcome of the chaos events. Note: this does reset whenever the plugin is
A config will be generated in a `plugins/Chaos` folder. Two values will be provided, a minimum and a maximum value
for how long events should last.

## Demo Video
[https://www.youtube.com/watch?v=mSM8qk2JbMU](https://www.youtube.com/watch?v=mSM8qk2JbMU)

## Disclaimer
This plugin has the possibility to cause permanent damage in your world, or make you *very very* sad. Please do not
use this plugin on a world you *really* care about.
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/netlify/hparcells/chaos/ChaosThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.netlify.hparcells.chaos.events.*;
import com.netlify.hparcells.chaos.events.explosivebeds.ExplosiveBedsEvent;
import com.netlify.hparcells.chaos.events.firetrail.FireTrailEvent;
import com.netlify.hparcells.chaos.events.foodpoisoning.FoodPoisoningEvent;
import com.netlify.hparcells.chaos.events.slipperybuckets.SlipperyBucketsEvent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
Expand Down Expand Up @@ -50,7 +51,12 @@ public class ChaosThread implements Runnable {
new DiamondEvent(),
new FireTrailEvent(),
new ExplosiveBedsEvent(),
new SlipperyBucketsEvent()
new SlipperyBucketsEvent(),
// new ChatKickEvent(),
new FullHealEvent(),
new FullHungerEvent(),
new ZeroHungerEvent(),
new FoodPoisoningEvent()
};
private ChaosEvent currentChaosEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.netlify.hparcells.chaos.events;

import com.netlify.hparcells.chaos.Chaos;
import com.netlify.hparcells.chaos.ChaosEvent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public class FullHealEvent extends ChaosEvent {
public void onEnable(String username, Chaos plugin) {
Player target = (Bukkit.getServer().getPlayer(username));

if(target != null) {
target.setHealth(20);
}
}

public String getName() {
return "Full Heal";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netlify.hparcells.chaos.events;

import com.netlify.hparcells.chaos.Chaos;
import com.netlify.hparcells.chaos.ChaosEvent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public class FullHungerEvent extends ChaosEvent {
public void onEnable(String username, Chaos plugin) {
Player target = (Bukkit.getServer().getPlayer(username));

if(target != null) {
target.setFoodLevel(20);
target.setSaturation(20f);
}
}

public String getName() {
return "Full Hunger";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netlify.hparcells.chaos.events;

import com.netlify.hparcells.chaos.Chaos;
import com.netlify.hparcells.chaos.ChaosEvent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public class ZeroHungerEvent extends ChaosEvent {
public void onEnable(String username, Chaos plugin) {
Player target = (Bukkit.getServer().getPlayer(username));

if(target != null) {
target.setFoodLevel(0);
target.setSaturation(0f);
}
}

public String getName() {
return "Zero Hunger";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netlify.hparcells.chaos.events.chatkick;

import com.netlify.hparcells.chaos.Chaos;
import com.netlify.hparcells.chaos.ChaosEvent;
import org.bukkit.event.HandlerList;

public class ChatKickEvent extends ChaosEvent {
private ChatKickListener chatKickListener = new ChatKickListener();

public void onEnable(String username, Chaos plugin) {
plugin.getServer().getPluginManager().registerEvents(chatKickListener, plugin);
}

public void onDisable(String username, Chaos plugin) {
HandlerList.unregisterAll(chatKickListener);
}

public String getName() {
return "Chat Kick";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.netlify.hparcells.chaos.events.chatkick;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class ChatKickListener implements Listener {
@EventHandler
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
event.getPlayer().kickPlayer("Kicked for spamming.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerBedEnterEvent;

import javax.swing.text.html.parser.Entity;

public class ExplosiveBedsListener implements Listener {
@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netlify.hparcells.chaos.events.foodpoisoning;

import com.netlify.hparcells.chaos.Chaos;
import com.netlify.hparcells.chaos.ChaosEvent;
import org.bukkit.event.HandlerList;

public class FoodPoisoningEvent extends ChaosEvent {
private FoodPoisoningListener foodPoisoningListener = new FoodPoisoningListener();

public void onEnable(String username, Chaos plugin) {
plugin.getServer().getPluginManager().registerEvents(foodPoisoningListener, plugin);
}

public void onDisable(String username, Chaos plugin) {
HandlerList.unregisterAll(foodPoisoningListener);
}

public String getName() {
return "Food Poisoning";
}
}
Loading

0 comments on commit 08bc1f6

Please sign in to comment.