IanO-B

Untitled

May 12th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CustomMob extends MinecraftMob{
  4.  
  5. String name;
  6. String type;
  7. String hostility;
  8. String colour;
  9.  
  10. Scanner keyboard = new Scanner(System.in);
  11.  
  12. public CustomMob(String name, String type, String hostility, String colour){
  13. this.name = name;
  14. this.type = type;
  15. this.hostility = hostility;
  16. this.colour = colour;
  17. }
  18.  
  19. public String getName(){
  20.  
  21. return name;
  22. }
  23.  
  24. public String getType(){
  25.  
  26. return type;
  27. }
  28.  
  29. public String getHostility(){
  30.  
  31. return hostility;
  32. }
  33.  
  34. public String getColour(){
  35.  
  36. return colour;
  37. }
  38.  
  39. public String changeName(){
  40. Scanner keyboard = new Scanner(System.in);
  41. System.out.println("What would you like the new name to be?");
  42. name = keyboard.next();
  43. return name;
  44. }
  45.  
  46. public String changeType(){
  47. System.out.println("What would you like the new type to be?");
  48. type = keyboard.next();
  49. return type;
  50. }
  51.  
  52. public String changeColour(){
  53. System.out.println("What would you like the new colour to be?");
  54. colour = keyboard.next();
  55. return colour;
  56. }
  57.  
  58. public String changeHostility(){
  59. System.out.println("What new hostility would you like? 1) Friendly, 2) Passive, 3) Hostile");
  60. Integer choice = keyboard.nextInt();
  61. if (choice == 1) {
  62. hostility = "friendly";
  63. } else if (choice == 2){
  64. hostility = "passive";
  65. } else if (choice == 3){
  66. hostility = "hostile";
  67. }
  68. return hostility;
  69. }
  70. public static void main(String[] args){
  71. Scanner keyboard = new Scanner(System.in);
  72. System.out.println("Welcome to the Custom Mob Creator");
  73. System.out.println("Input your new Mobs name.");
  74. String newName = keyboard.next();
  75. System.out.println("Input your new Mobs type.");
  76. String newType = keyboard.next();
  77. System.out.println("Input your new Mobs colour.");
  78. String newColour = keyboard.next();
  79. System.out.println("Input your new Mobs location.");
  80. String newLocation = keyboard.next();
  81. }
  82.  
  83. }
  84.  
  85. import java.util.ArrayList;
  86. import java.util.Scanner;
  87.  
  88. public class MinecraftMob {
  89.  
  90. String location;
  91.  
  92. public String getLocation(){
  93. return location;
  94. }
  95.  
  96. public String changeLocation(){
  97. ArrayList<String> biomes = new ArrayList<>();
  98. biomes.add("1) Plains");
  99. biomes.add("2) Water");
  100. biomes.add("3) Underground");
  101. biomes.add("4) The Nether");
  102. biomes.add("5) The End");
  103. for (int x = 0; x < biomes.size(); x++){
  104. System.out.println(biomes.get(x));
  105. }
  106. System.out.println("Choose the location for your new Mob.");
  107. Scanner keyboard = new Scanner(System.in);
  108. int location = keyboard.nextInt();
  109.  
  110. if (location == 1) {
  111. return biomes.get(0);
  112. } else if (location == 2) {
  113. return biomes.get(1);
  114. } else if (location == 3){
  115. return biomes.get(2);
  116. } else if (location == 4){
  117. return biomes.get(3);
  118. } else if (location == 5){
  119. return biomes.get(4);
  120. }
  121. }
  122.  
  123. }
Add Comment
Please, Sign In to add comment