Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myservermod;
- import com.youthdigital.servermod.game.*;
- public class Player extends PlayerData {
- }
- /*Variables*/
- public int credits = 2;
- public Player(EntityPlayer parPlayerObject) {
- super(parPlayerObject);
- }
- @Override
- public void onUpdate() {
- if (Conditions.didRightClickBlock("blueTeamJoin")) {
- Actions.teleportPlayers("blueTeamBase");
- }
- if (Conditions.didRightClickBlock("redTeamJoin")) {
- Actions.teleportPlayers("redTeamBase");
- }
- if (Conditions.isStandingOnBlock("healthRedTeam") && Conditions.secondsGoneBy(1)) {
- Actions.restoreHealth(2);
- Actions.restoreHunger(2);
- }
- if (Conditions.isStandingOnBlock("healthBlueTeam") && Conditions.secondsGoneBy(1)) {
- Actions.restoreHealth(2);
- Actions.restoreHunger(2);
- }
- /*Store*/
- /*Night kit*/
- if (Conditions.didRightClickBlock("knight") && credits >= 8) {
- Actions.giveItems(Items.stone_sword, Enchantment.sharpness, 1, Enchantment.knockback, 1,
- Items.iron_chestplate,
- Items.iron_boots,
- Items.iron_helmet,
- Items.iron_leggings,
- Items.golden_apple, 3,
- Potion.moveSlowdown, 10000, 1);
- Actions.displayChatMessage("§aI dub thee §6§lKnight!");
- credits = credits - 8;
- }
- /*Archer Kit*/
- if (Conditions.didRightClickBlock("archer") && credits >= 8) {
- Actions.giveItems(Items.bow, Enchantment.infinity, 1, Enchantment.punch, 2, Items.arrow, 1,
- Items.chainmail_helmet, Enchantment.protection, 1, Enchantment.unbreaking, 2,
- Items.chainmail_chestplate, Enchantment.protection, 1, Enchantment.unbreaking, 2,
- Items.golden_apple, 3,
- Potion.moveSpeed, 10000, 1);
- Actions.displayChatMessage("§aShoot them all! §6§lArcher Kit");
- credits = credits - 8;
- }
- if (Conditions.didRightClickBlock("ironSword") && credits >= 1) {
- Actions.giveItems(Items.iron_sword);
- Actions.displayChatMessage("§aYou have purchased an §6§lIron Sword");
- credits = credits - 1;
- }
- if (Conditions.didRightClickBlock("bow") && credits >= 2) {
- Actions.giveItems(Items.bow, Items.arrow, 16);
- Actions.displayChatMessage("§aYou have purchased a §6§lBow");
- credits = credits - 2;
- }
- /*display*/
- if (credits > 0) {
- Actions.displaySmallInfo("§9§lCredits: " + credits);
- }
- }
- @Override
- public void onJoinedServer(){
- Actions.teleportPlayers("lobbySpawn");
- }
- @Override
- public void onStartGame() {
- }
- @Override
- public void onResetGameToLobby() {
- }
- @Override
- public void onRespawned() {
- Actions.teleportPlayers("lobbySpawn");
- }
Advertisement
Add Comment
Please, Sign In to add comment