Zombies pickup items

Discussion in 'Archived: Plugin Requests' started by Derphiria, Aug 28, 2012.

  1. Offline

    Derphiria

    Hello!

    i've searched through the entire plugin section and i have yet to find the plugin so i'm requesting a plugin which makes zombies pick up items from those he has killed and if you kill the zombie the items will drop from it.

    Example: player1 got 2 apples and a wooden sword and gets killed by zombie1 and the items will automaticly pop into the zombie1's "inventory" player2 kills the zombie and then the 2 apples and a wooden sword drops from the zombie.

    the plugin also needs to be able to do this with every other monsters.

    ps: it needs to be 1.2.5
     
  2. Offline

    makskay

    I very much like the idea here, and it'd definitely be possible to do with a little imagination. There's always the issue that an individual zombie carrying your items might despawn, but perhaps item-carrying zombies could be forced to persist, or perhaps the items could be returned to you a few at a time every time you kill a zombie.
     
  3. Offline

    Derphiria

    if it's possible to get the zombie to carry it untill it despawns or a certain time that would be good, but i saw this on a MineZ server and it's actually pretty good but i haven't found that plugin so i think they made it them selves. but it is possible though

    and maybe also have it so zombies have more health and power and faster running speed with a config setting :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  4. Offline

    Derphiria

    no one takes this job?
     
  5. Offline

    WarmakerT

    I'll do the pickup thingy.
     
  6. Offline

    Pippiter69

    Derphiria TMC Zombie SMP makes zombies do that.
     
  7. Offline

    Derphiria

    i thank you but that only does it for the zombies and not the other monsters. it's not going to be anything like MineZ like this plugin is made for. still want this custom plugin i requested :)
     
  8. Offline

    Derphiria

    so... who will take this adventure to make this plugin? :)

    bump..

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  9. Offline

    vsams14

    Might consider it... PM me on bukkitDev if you please. Also, do you still need it to be 1.2.5? I've more or less transitioned to 1.3.1, though those plugs are backwards compatible (mostly)...
     
  10. Offline

    RingOfStorms

    So many bumps :O look at those time stamps, me no see 12 hour differences QQ
     
  11. Offline

    Derphiria

    it's not a MUST for 1.2.5 but it would be nice. if you make it for 1.3.1 then that would help also, running a 1.2.5 tekkit, but it will update to 1.3.1 soon :)
     
  12. Offline

    XbannisherX

    i can try making this, if none here is putting effort in it ofcourse :p
     
  13. Offline

    WarmakerT

    You can keep going :3
     
  14. Offline

    XbannisherX

    You started?
     
  15. Offline

    WarmakerT

    Yeah, but I'm busy now. I started with this, but it's a lot easier to use a custom zombie class, like... A LOT easier. + The code's messy :p
    Code:java
    1.  
    2. package me.warmakert.zombiepickup;
    3.  
    4. import java.util.ArrayList;
    5. import java.util.HashMap;
    6. import java.util.Map;
    7. import java.util.Random;
    8. import org.bukkit.Location;
    9. import org.bukkit.Material;
    10. import org.bukkit.World;
    11. import org.bukkit.command.Command;
    12. import org.bukkit.command.CommandSender;
    13. import org.bukkit.entity.*;
    14. import org.bukkit.event.EventHandler;
    15. import org.bukkit.event.Listener;
    16. import org.bukkit.event.entity.EntityDamageByEntityEvent;
    17. import org.bukkit.inventory.ItemStack;
    18. import org.bukkit.plugin.java.JavaPlugin;
    19.  
    20. public class ZombiePickup extends JavaPlugin implements Listener {
    21.  
    22. Random random = new Random();
    23. ArrayList<ArrayList> allowed = new ArrayList<ArrayList>();
    24.  
    25. //Setup allowed array-lists.
    26. ArrayList<Material> helmet = new ArrayList<Material>();
    27. ArrayList<Material> chestplate = new ArrayList<Material>();
    28. ArrayList<Material> leggings = new ArrayList<Material>();
    29. ArrayList<Material> boots = new ArrayList<Material>();
    30. ArrayList<Material> hand = new ArrayList<Material>();
    31.  
    32. Map<Entity, ArrayList> items = new HashMap<Entity, ArrayList>();
    33.  
    34. public void onEnable(){
    35. setupAllowedItems();
    36. this.getServer().getPluginManager().registerEvents(this, this);
    37. for(World worlds : getServer().getWorlds()){
    38. for(Entity entity : worlds.getEntities()){
    39. if(entity instanceof Item){
    40. entity.remove();
    41. }
    42. }
    43. }
    44. startWalkScheduler();
    45. }
    46.  
    47. public void onDisable(){
    48.  
    49. }
    50.  
    51. public void setupAllowedItems(){
    52. helmet.add(Material.DIAMOND_HELMET);
    53. helmet.add(Material.IRON_HELMET);
    54. helmet.add(Material.CHAINMAIL_HELMET);
    55. helmet.add(Material.GOLD_HELMET);
    56. helmet.add(Material.LEATHER_HELMET);
    57.  
    58. chestplate.add(Material.DIAMOND_CHESTPLATE);
    59. chestplate.add(Material.IRON_CHESTPLATE);
    60. chestplate.add(Material.CHAINMAIL_CHESTPLATE);
    61. chestplate.add(Material.GOLD_CHESTPLATE);
    62. chestplate.add(Material.LEATHER_CHESTPLATE);
    63.  
    64. leggings.add(Material.DIAMOND_LEGGINGS);
    65. leggings.add(Material.IRON_LEGGINGS);
    66. leggings.add(Material.CHAINMAIL_LEGGINGS);
    67. leggings.add(Material.GOLD_LEGGINGS);
    68. leggings.add(Material.LEATHER_LEGGINGS);
    69.  
    70. boots.add(Material.DIAMOND_BOOTS);
    71. boots.add(Material.IRON_BOOTS);
    72. boots.add(Material.CHAINMAIL_BOOTS);
    73. boots.add(Material.GOLD_BOOTS);
    74. boots.add(Material.LEATHER_BOOTS);
    75.  
    76. hand.add(Material.DIAMOND_SWORD);
    77. hand.add(Material.IRON_SWORD);
    78. hand.add(Material.GOLD_SWORD);
    79. hand.add(Material.WOOD_SWORD);
    80. }
    81.  
    82. @EventHandler
    83. public void onEntityDamaged(EntityDamageByEntityEvent event){
    84.  
    85. }
    86.  
    87. public void startWalkScheduler(){
    88. this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    89. public void run(){
    90. for(World world : getServer().getWorlds()){
    91. for(Entity entity : world.getEntities()){
    92. if(entity instanceof Creature){
    93. if(!entity.getNearbyEntities(1.3, 1.3, 1.3).isEmpty()){
    94. for(Entity entities : entity.getNearbyEntities(1.3, 1.3, 1.3)){
    95. if(entities instanceof Item){
    96. if(allowPickup(entities) == true){
    97. pickup();
    98. getServer().broadcastMessage(randomColor() + "Item found!");
    99. }
    100. }
    101. }
    102. }
    103. }
    104. }
    105. }
    106. }
    107. }, 0L, 10L);
    108. }
    109.  
    110. public void pickup(){
    111.  
    112. }
    113.  
    114. public void dress(Entity entity){
    115.  
    116. }
    117.  
    118. public String randomColor(){
    119. String array[] = {"§a", "§b", "§c", "§d", "§e", "§f", "§0", "§1", "§2", "§3", "§4", "§5", "§6", "§7", "§8", "§9"};
    120. return array[random.nextInt(array.length)];
    121. }
    122.  
    123. public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]){
    124. Player player = (Player) sender;
    125. if(cmd.getName().equalsIgnoreCase("a")){
    126. if(args[0].equalsIgnoreCase("crystal")){
    127. Location loc = player.getTargetBlock(null, 100).getLocation();
    128. loc.setY(loc.getY() + 1.0D);
    129. player.getWorld().spawnEntity(loc, EntityType.ENDER_CRYSTAL);
    130. }
    131. if(args[0].equalsIgnoreCase("cleardrops")){
    132. for(Entity entity : player.getWorld().getEntities()){
    133. if(entity instanceof Item){
    134. entity.remove();
    135. }
    136. }
    137. }
    138. if(args[0].equalsIgnoreCase("clearmobs")){
    139. for(Entity entity : player.getWorld().getEntities()){
    140. if(entity instanceof Creature){
    141. entity.remove();
    142. }
    143. }
    144. }
    145. return true;
    146. }
    147. return false;
    148. }
    149.  
    150. public boolean allowPickup(Entity item){
    151. if(allowed.contains(((ItemStack)item).getType())){
    152. return true;
    153. }
    154. return false;
    155. }
    156.  
    157. }
    158.  
     
  16. Offline

    vsams14

    Now that I think about it, I have no idea what I was going to do, or how to code it. I suppose a custom Zombie class would be the best, but I don't have time to mess with all of that... I think I was thinking of doing a hashmap of <Zombie_ID, Inventory>, but I'm not sure if zombies have any unique identifiers. Halp?
     
  17. Offline

    RingOfStorms

    EntityId .. hmm wonder what this can do?
     
  18. Offline

    Derphiria

    it's not only gonna be for zombies, it's gonna be for almost all the monsters + wolves :)
     
  19. Offline

    RingOfStorms

    Every entity has an entity ID, so even wolfs, and pigs, and chickens, and even zombies. All you would do is have a Map<Entity, Integer> PigList = blabla or something like that.
     
  20. Offline

    Derphiria

    i don't know how to code stuff in java :/
     
  21. Offline

    Woobie

    Isnt this going to be implemented in 1.4? Btw why are you still using 1.2.5?
     
    WarmakerT likes this.
  22. Offline

    Derphiria

    Tekkit hasn't updated to 1.3 yet, it's still 1.2.5
     
  23. Offline

    KeybordPiano459

    This seems like a great idea. I would totally try, but I dunno how :(
     
  24. Offline

    Woobie

    WarmakerT is already working on this, i think,
     

Share This Page