Guest User

Player.java

a guest
Jun 16th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. package myservermod;
  2.  
  3. import com.youthdigital.servermod.game.*;
  4.  
  5. public class Player extends PlayerData {
  6.  
  7. }
  8.  
  9.  
  10. /*Variables*/
  11. public int credits = 2;
  12.  
  13. public Player(EntityPlayer parPlayerObject) {
  14. super(parPlayerObject);
  15. }
  16.  
  17. @Override
  18. public void onUpdate() {
  19.  
  20. if (Conditions.didRightClickBlock("blueTeamJoin")) {
  21. Actions.teleportPlayers("blueTeamBase");
  22. }
  23.  
  24. if (Conditions.didRightClickBlock("redTeamJoin")) {
  25. Actions.teleportPlayers("redTeamBase");
  26. }
  27.  
  28. if (Conditions.isStandingOnBlock("healthRedTeam") && Conditions.secondsGoneBy(1)) {
  29. Actions.restoreHealth(2);
  30. Actions.restoreHunger(2);
  31. }
  32.  
  33. if (Conditions.isStandingOnBlock("healthBlueTeam") && Conditions.secondsGoneBy(1)) {
  34. Actions.restoreHealth(2);
  35. Actions.restoreHunger(2);
  36. }
  37.  
  38. /*Store*/
  39.  
  40. /*Night kit*/
  41.  
  42. if (Conditions.didRightClickBlock("knight") && credits >= 8) {
  43. Actions.giveItems(Items.stone_sword, Enchantment.sharpness, 1, Enchantment.knockback, 1,
  44. Items.iron_chestplate,
  45. Items.iron_boots,
  46. Items.iron_helmet,
  47. Items.iron_leggings,
  48. Items.golden_apple, 3,
  49. Potion.moveSlowdown, 10000, 1);
  50. Actions.displayChatMessage("§aI dub thee §6§lKnight!");
  51. credits = credits - 8;
  52. }
  53.  
  54. /*Archer Kit*/
  55. if (Conditions.didRightClickBlock("archer") && credits >= 8) {
  56. Actions.giveItems(Items.bow, Enchantment.infinity, 1, Enchantment.punch, 2, Items.arrow, 1,
  57. Items.chainmail_helmet, Enchantment.protection, 1, Enchantment.unbreaking, 2,
  58. Items.chainmail_chestplate, Enchantment.protection, 1, Enchantment.unbreaking, 2,
  59. Items.golden_apple, 3,
  60. Potion.moveSpeed, 10000, 1);
  61. Actions.displayChatMessage("§aShoot them all! §6§lArcher Kit");
  62. credits = credits - 8;
  63. }
  64.  
  65. if (Conditions.didRightClickBlock("ironSword") && credits >= 1) {
  66. Actions.giveItems(Items.iron_sword);
  67. Actions.displayChatMessage("§aYou have purchased an §6§lIron Sword");
  68. credits = credits - 1;
  69. }
  70.  
  71. if (Conditions.didRightClickBlock("bow") && credits >= 2) {
  72. Actions.giveItems(Items.bow, Items.arrow, 16);
  73. Actions.displayChatMessage("§aYou have purchased a §6§lBow");
  74. credits = credits - 2;
  75. }
  76.  
  77. /*display*/
  78. if (credits > 0) {
  79. Actions.displaySmallInfo("§9§lCredits: " + credits);
  80.  
  81. }
  82.  
  83. }
  84.  
  85. @Override
  86. public void onJoinedServer(){
  87.  
  88. Actions.teleportPlayers("lobbySpawn");
  89.  
  90. }
  91.  
  92.  
  93. @Override
  94. public void onStartGame() {
  95.  
  96. }
  97.  
  98. @Override
  99. public void onResetGameToLobby() {
  100.  
  101. }
  102.  
  103. @Override
  104. public void onRespawned() {
  105.  
  106. Actions.teleportPlayers("lobbySpawn");
  107.  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment