Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package me.jet315.minions.minions.types;
  2.  
  3. import me.jet315.minions.minions.Minion;
  4. import me.jet315.minions.minions.MinionEntity;
  5. import me.jet315.minions.utils.MinionFace;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.inventory.ItemStack;
  8.  
  9. //Must implement Minion class
  10. public class CustomMinion extends Minion {
  11.  
  12.  
  13.     //Must implement default constructor
  14.     public CustomMinion(Player p, boolean useHealth, int actionsAllowedPerHeathDrop, int health, int totalActionsProcessed, MinionEntity minionEntity, MinionFace direction, ItemStack minionDisplayItem, int level) {
  15.         super(p, useHealth, actionsAllowedPerHeathDrop, health, totalActionsProcessed, minionEntity, direction, minionDisplayItem, level);
  16.     }
  17.  
  18.     //The minions identifier, IE "Miner" or "Slayer"
  19.     @Override
  20.     public String getIdentifier() {
  21.         return null;
  22.     }
  23.  
  24.     //Your name
  25.     @Override
  26.     public String getAuthor() {
  27.         return null;
  28.     }
  29.  
  30.     //Code that is ran when the minion is loaded for the very first time
  31.     @Override
  32.     public void onFirstSpawn() {
  33.  
  34.     }
  35.  
  36.     //Code that is ran when the minion is loaded
  37.     @Override
  38.     public void onLoad() {
  39.  
  40.     }
  41.  
  42.  
  43.     @Override
  44.     public void performAction() {
  45.         if (inSpawnAnimation) return; // I suggest not performing any action if the minion is in the spawn animation
  46.         super.performAction(); //This is needed
  47.         //Good methods:
  48.         getMinion();
  49.         getMinion().getArmorStand();
  50.         getMinion().getAttachedChest(); //Use getMinion().hasMinionGotAttachedChest() before getting the chest
  51.         getLevel(); //Maybe you want to do different stuff depending on the level?
  52.        
  53.        
  54.        
  55.     }
  56.  
  57.     /**
  58.      * You DO NOT NEED TO OVERRIDE THIS METHOD, and I suggest you don't really as creating animations is a pretty long and annoying task
  59.      */
  60.     @Override
  61.     public void performAnimation() {
  62.         /**
  63.          * If you want to create your own animation, then you need to create EulaAngles for a part of the minion (like the arm) and each time this method is called perform the next animation
  64.          *
  65.          * What I suggest you do:
  66.          * have a counter variable, each time this method is called +1 to it
  67.          * check if counter variable is bigger than the list, if so reset it back to 0
  68.          * Create a list of EulaAngles so: (ArmMovement1,ArmMovement2,ArmMovement3,ArmMovement2,ArmMovement1)
  69.          * then each time this method is called, use
  70.          * getMinion().getArmorStand().setRightArmPose(listName[counter]);
  71.          *
  72.          * I suggest playing around with this
  73.          * Creating animations is a pretty annoying task though, if the default animation is cool enough, then I suggest you use this.
  74.          *
  75.           */  
  76.     }
  77. }