Cancel Item Spawning

Discussion in 'Archived: Plugin Requests' started by LaughNgamez, May 13, 2014.

  1. Offline

    LaughNgamez

    I bet someone can write this plugin super quick, all I want is a plugin which prevents the dropping of diamonds when broke with anything including enchanted picks with fortune/silktouch.

    I want this plugin wrote since I use a different plugin to give players different items when they break diamonds in the first place. Please make this plugin if it will not interfere with another plugin triggering when the player breaks diamonds, so perhaps just make the diamonds despawn after 1 tick or something?
     
  2. Offline

    dentych

    LaughNgamez So you want people to be able to break diamond blocks but it shouldn't drop any diamonds or do you want the diamond block to be unbreakable and what other plugins shouldn't this plugin interfere with kthxbai
     
  3. Offline

    LaughNgamez

    I want diamond ore to be able to be broken but not to drop anything.

    dentych think it would be possible for you to write this? Diamond ore not dropping diamonds when mined with any pick, I also use a plugin called magicspells to trigger and give the player different items when they mine diamond, it triggers when they break the block.

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

    theViTALiTY

    Hello sir,

    With the way i understood your request, ive made a plugin that cancels a breaking of Diamond Ore, and by doing so it doesent drop anything.

    So if that is what u wanted, here is the link for it. Please note that i am a newbie developer, still making my way through plugin development, but im trying my best at it :)

    http://www.speedyshare.com/pende/NoDropDiamond.jar
     
  5. Offline

    LaughNgamez

    Thanks a bunch, I'll make sure to test it out ASAP!

    theViTALiTY Seems it causes the other plugin not to trigger :/
    Normally I'd have the plugin trigger to drop a few gold & iron ingots on the ground when a diamond is broken.
    Now with the plugin it does not work, I've tested removing the antidiamond plugin and it seems to be stopping it from triggering. Would it be possible for the plugin to stop the diamond dropping without interfering with the other plugins trigger?

    My ideal goal is to be able to have diamonds not drop and a few gold & iron ingots drop instead.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  6. Offline

    theViTALiTY

  7. Offline

    LaughNgamez

    theViTALiTY
    Just tried it out again, and this version also stops the other plugin triggering. Maybe you could just make the diamond despawn like 1 tick after it spawns so players can't pick it up and then it won't interfere with the other plugin?
    Also no problem about it not working, just the fact you're trying is really nice :D
     
  8. Offline

    theViTALiTY

    LaughNgamez

    Do you mind sending me on private message what plugin are you using to manage drops? So maybe i can figure out something instead going blindly :D
     
  9. Online

    timtower Administrator Administrator Moderator

    Not really required to use PM for that :p
     
  10. Offline

    LaughNgamez

    Sent :)
     
  11. Offline

    theViTALiTY

    timtower

    Well, since u got 11 plugins coded, i guess ur the guy who i can talk to and hope u can help us with this little problem :D

    Here is the code i used for plugin he wanted:

    show code

    Code:java
    1. package me.ViTALiTY.NoDropDiamond;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.Material;
    5. import org.bukkit.event.EventHandler;
    6. import org.bukkit.event.EventPriority;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.block.BlockBreakEvent;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class Main extends JavaPlugin implements Listener {
    12.  
    13. public void onEnable() {
    14. Bukkit.getServer().getPluginManager().registerEvents(this, this);
    15. }
    16.  
    17. @EventHandler (priority = EventPriority.LOW)
    18. public void onBlockBreak(BlockBreakEvent bbe) {
    19. Material block = bbe.getBlock().getType();
    20.  
    21. if(block == Material.DIAMOND_ORE) {
    22. // bbe.setCancelled(true);
    23. bbe.getBlock().setType(Material.AIR);
    24.  
    25. }
    26. }
    27.  
    28. }


    At first i cancelled event, then i removed the cancellation, and just replaced the broken diamond ore with air.

    Now the plugin he uses to manage drops is MagicSpells, and i asked him to send me complete package of MagicSpells with his configs, but when i loaded it up on my server, even without the plugin i made, MagicSpells give me nothing from breaking diamond ore.

    These are his 2 spells that are supposed to manage diamond ore drops:

    show config

    Code:
    Diamond:
        spell-class: ".instant.ConjureSpell"
        name: Diamond
        cooldown: 0
        can-cast-by-command: false
        can-cast-with-item: false
        calculate-drops-individually: true
        auto-equip: false
        items:
            - 265 3-5 100%
            - 266 2-4 100%
    DiamondBreak:
        spell-class: ".PassiveSpell"
        triggers:
            - blockbreak 56
        chance: 100
        cooldown: 0
        spells:
            - Diamond
     
  12. Offline

    LaughNgamez

    @theViTALiTY I tested that config I sent you and it works fine, I can upload a video if you want.
     
  13. Online

    timtower Administrator Administrator Moderator

    theViTALiTY
    And it also depends on how the other plugin functions.
     
  14. Offline

    flaaghara

    Sounds like something the plugin developer has to fix himself. I don't understand why he'd code the plugin such that other items (gold and iron ingots) drop from diamond ores but still the default diamond(s) drop anyways. Asking someone to create another plugin just to fix a development flaw with the other is not a good idea.
     

Share This Page