Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.22 KB | None | 0 0
  1. package com.niccholaspage.TehDeathPlugin;
  2.  
  3. import java.util.Random;
  4.  
  5. public enum DeathMessage {
  6.     PLAYER("%a fucking pwned %v wielding %h"),
  7.     CACTUS("The cactus won the shoot out against %v"),
  8.     DROWN("%v sank like the Titanic", "%v doesn't have gills"),
  9.     CHICKEN("%v tried to hit a chicken, but the chicken hit back", "%v thought chickens were weak"),
  10.     ENDERMAN("%v got owned by an Enderman"),
  11.     CREEPER("%v tried to hug a creeper", "A giant green penis snuck up on %v"),
  12.     SKELETON("%v got owned by a skeleton", "%v loves getting owned by undead arrows"),
  13.     SPIDER("%v attempted to ride a spider"),
  14.     ZOMBIE("%v tried to get rotten flesh"),
  15.     WOLF("%v attempted wolf abuse"),
  16.     FALL("%v tested gravity. Yup, still works.", "%v tried to roll. Better luck next time.", "%v was owned by gravity"),
  17.     SUICIDE("%v was done with life"),
  18.     HUNGER("%v was too skinny", "%v starved"),
  19.     TnT("%v was blown up by TnT", "%v tried to grief but failed", "%v became a million pieces"),
  20.     LIGHTNING("%v was standing in the wrong place in the rain", "%v was shocked by lightning"),
  21.     FIRE("%v is on fire today"),
  22.     GHAST("%v was fooling around in the nether"),
  23.     PIG_ZOMBIE("%v lost to an undead golden sword"),
  24.     WITHER("%v has lost to three heads"),
  25.     VOID("%v has fell into space"),
  26.     SUFFOCATION("%v became a sandwich"),
  27.     PROJECTILE("%v cannot dodge arrows"),
  28.     LAVA("%v thought lava was water", "%v lost the battle of lava vs human"),
  29.     POISON("%v, that wasn't lemonade"),
  30.     MELTING("%v because stew"),
  31.     MAGIC("%v was killed by witchcraft"),
  32.     FALLING_BLOCK("Minecraft is not a cartoon, %v"),
  33.     EPIC_FAIL("%v herped");
  34.    
  35.     private String[] messages;
  36.    
  37.     private DeathMessage(String... messages){
  38.         this.messages = messages;
  39.     }
  40.    
  41.     public String parse(String victim, String held){
  42.         return parse(victim, held, null);
  43.     }
  44.    
  45.     public String parse(String victim, String held, String attacker){
  46.         String randomMessage = messages[new Random().nextInt(messages.length)];
  47.        
  48.         if (victim != null){
  49.             randomMessage = randomMessage.replace("%v", victim);
  50.         }
  51.        
  52.         if (held != null){
  53.             randomMessage = randomMessage.replace("%h", held);
  54.         }
  55.        
  56.         if (attacker != null){
  57.             randomMessage = randomMessage.replace("%a", attacker);
  58.         }
  59.        
  60.         return randomMessage;
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement