Skin Cows?

Discussion in 'Archived: Plugin Requests' started by WsupPanda, Feb 9, 2013.

  1. Offline

    WsupPanda

    I got this idea from thinking about a way to skin cows. I personally have no idea how to code plugins, so I decided to make a request. What I want is a way to skin the leather off of cows, like you do with sheep, without having to kill the cow. The way it should be made possible is this:

    Use shears to skin the cow, make a configurable amount of time needed between skinning the cow.(The skin will grow back like a sheep's wool does) So when you shear the cow, it'd give you 3 leather or so. Then, if you try shearing it again, it'll say "You can't skin this cow for another ___ seconds."

    Some permissions it should have:
    cowskin.shear.cow? I'm not sure, but a good name for the plugin can be CowSkin.

    Hopefully this can be made possible! The poor cows don't deserve death because you want leather :( If any extra information is needed, please let me know!
     
  2. Offline

    Hoolean

    By donating just $3 a month, we can save the cows. Cows are being horribly slaughtered everyday for their leather; it needs to stop and you can help. Donate today.

    xD
     
    chasechocolate and mncat77 like this.
  3. Offline

    Deleted user

    Yeah, this is a good idea, I guess you could mess around with the coding of sheep and put it in a plugin...
     
  4. I couldn't donate so I tried this:

    Show Spoiler
    Code:java
    1. package me.mncat77.plugins.cowskin;
    2.  
    3. import org.bukkit.Material;
    4. import org.bukkit.World;
    5. import org.bukkit.entity.Entity;
    6. import org.bukkit.entity.EntityType;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.event.EventHandler;
    9. import org.bukkit.event.Listener;
    10. import org.bukkit.event.player.PlayerInteractEntityEvent;
    11. import org.bukkit.inventory.ItemStack;
    12. import org.bukkit.metadata.FixedMetadataValue;
    13. import org.bukkit.plugin.java.JavaPlugin;
    14.  
    15. public class CowSkin extends JavaPlugin implements Listener {
    16.  
    17. private long skinDelay = 6000;
    18.  
    19. @Override
    20. public void onDisable() {
    21. }
    22.  
    23. @Override
    24. public void onEnable() {
    25. getServer().getPluginManager().registerEvents(this, this);
    26. }
    27.  
    28. @EventHandler
    29. public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
    30. Player player = event.getPlayer();
    31. ItemStack item = player.getItemInHand();
    32. if(item.getType() == Material.SHEARS ) {
    33. Entity entity = event.getRightClicked();
    34. if(entity.getType() == EntityType.COW) {
    35. long lastSkinned = 0;
    36. try {
    37. lastSkinned = entity.getMetadata("lastskinned").get(0).asLong();
    38. }
    39. catch(Exception e) {
    40. }
    41. World world = entity.getWorld();
    42. long skinTime = world.getTime();
    43. if(skinTime > lastSkinned + skinDelay) {
    44. entity.setMetadata("lastskinned", new FixedMetadataValue(this,skinTime));
    45. world.dropItemNaturally(entity.getLocation(), new ItemStack(Material.LEATHER,3));
    46. short durability = item.getDurability();
    47. if(durability < 238) {
    48. item.setDurability((short)(durability-1));
    49. }
    50. else {
    51. player.setItemInHand(null);
    52. }
    53. }
    54. }
    55. }
    56. }
    57. }


    No idea if it's gonna work or not :D.
     
  5. Offline

    keharriso

    Just a minor point, but isn't skinning a cow even crueler than killing it? I mean, would you really prefer being flayed alive to the mercy of a quick death?

    Maybe one of the plugin's features would be to remove a cow's ability to feel pain! :p
     
  6. Offline

    Hoolean

    Or allow cows to ascend into higher beings, creatures composed purely of consciousness with the ability to live their dreams as their lives. With the ability to bring dreams true and to bless others with the usage of their power. With the power, to improve your Minecraft server to the extent of complete and utter popularity.

    Or, of course, you could just use mncat77's code :p
     
    chasechocolate, keharriso and mncat77 like this.
  7. Offline

    WsupPanda

    No idea what to do with the code, can you put it in a jar possibly? mncat77
     
  8. Link

    Don't know if it works....
     

Share This Page