[INACTIVE][SEC/FUN] KillBlock v1.2 - Mobtraps in blocks [860]

Discussion in 'Inactive/Unsupported Plugins' started by Baummann, Jun 13, 2011.

  1. Offline

    Baummann

    KillBlock - Mobtraps in blocks
    Version: 1.2 CraftBukkit 860

    What does it do?:
    If a mob walks onto a KillBlock the mob will despawn.

    What's the block's ID?:
    The block ID is (anyblock):9. It does NOT work with WorldEdit. But CuboidPlugin can do it.

    How do I use it?:
    Type /killblock create and punch as many blocks you want. Those blocks will be turned into KillBlocks. Type /killblock stop to stop creating KillBlocks

    Commands:
    /killblock create|stop

    Permissions:
    killblock.create - Access to /killblock create|stop

    Download:
    Click here

    Source code:
    Click here

    Changelog:
    v1.0 - First release
    v1.1 - No longer craftable now using /killblock create to select KillBlocks
    v1.2 - Config file!
     
    KragTheDark likes this.
  2. Offline

    ipie5

    Nice plugin
    I use it and it works great
     
  3. Offline

    thedarkdima

    its an mod or an plugin?
     
  4. Offline

    kahlilnc

    I am thinking plugin. :p
     
  5. Offline

    thedarkdima

    if its an Plugin then Nice :)
     
  6. Offline

    captainawesome7

    @Baummann woah. I started making a plugin exactly like this one, but netherrack and the crafting recipe was different, how did you get the ID to stick through crafting and placing? With netherrack it didn't work :/
    By ID i mean durability
    *edit* while looking at your source, you aren't allowed to use com.bukkit. Use me.Baummann instead
    *edit2* Well it seems that you must have run into the same problem, you just make all blocks placed that are stone a kill block... pointless crafting recipe...
     
  7. Offline

    Baummann

    oh damn... all my plugins use com.bukkit. Well I used a damage value.
    To make a crafting recipe just use this:
    Code:
    ShapedRecipe recipe = new ShapedRecipe(new ItemStack(87, 1, (short) 2));
    recipe.shape(new String[] {"first line", "second line", "third line"});
    recipe.setIngredient('#', Material.STONE);
    //The character # in your crafting recipe is stone
    getServer().addRecipe(recipe);
     
  8. Offline

    captainawesome7

    I know dude, I'm saying that when you craft an item, like stone, and the damage value is 2, it doesn't stick. The item that comes out of the crafting grid has a damage of 0, not whatever you set (in your case, 2) in the recipe. Also, when you place a block using your plugin, all stone are turned into kill blocks.
     
  9. Offline

    Baummann

    Could you post your source code here? Oh... My plugin error... I probably forgot to update dropbox, I'll do that now.
     
  10. Offline

    captainawesome7

    Not atm. Anyways, do you understand what I'm saying? When you add a recipe for an itemstack of stone with a durability of 2, it doesn't give you an item stack with a durability of 2. It has a durability of 0, because there is no default block with that durability.
     
  11. Offline

    Baummann

    Yes I do understand what you're saying. Maybe you're missing the BlockListener, this is how mine looks like:
    Code:
    package com.bukkit.Baummann.KillBlock;
    
    import org.bukkit.event.block.BlockDamageEvent;
    import org.bukkit.event.block.BlockListener;
    import org.bukkit.event.block.BlockPlaceEvent;
    import org.bukkit.inventory.ItemStack;
    
    public class KillBlockBlockListener extends BlockListener {
        public static KillBlock plugin;
    
        public KillBlockBlockListener(KillBlock instance) {
            plugin = instance;
        }
    
        public void onBlockPlace(BlockPlaceEvent event) {
            if (event.getItemInHand().getTypeId() == 1) {
                event.getBlockPlaced().setTypeId(1);
                event.getBlockPlaced().setData((byte) 2);
            }
        }
    
        public void onDamage(BlockDamageEvent event) {
            if ((event.getBlock().getTypeId() == 1) && (event.getBlock().getData() == 2)) {
                event.setCancelled(true);
                event.getBlock().setTypeId(0);
                event.getBlock().setData((byte) 0);
    
                event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), new ItemStack(1, 1, (short)2));
            }
        }
    }
    
     
  12. Offline

    captainawesome7

    Lol the above clearly shows that you do not know what I am trying to tell you. Here you go:
    1. This plugin is called KillBlock.
    2. There is a separate recipe for a kill block, so:
    3. The kill block is supposed to be separate from regular stone
    4. With your plugin installed, any regular stone put down is a kill block, because:
    5. In your block listener, you only check for the id. So any block with the id of 1 (stone) is turned into a kill block when you change the data to 2.
    6. Finally:
      This plugin is not succeeding in creating a new block type. It just changes any stone put down into stone with a durability of 2.
     
  13. Offline

    Baummann

    The plugin works fine for me. I uploaded a fixed version, try that one.
     
  14. Offline

    captainawesome7

    Oh my god!
     
  15. Offline

    Baummann

    Ok then:
    1. Yes it's called KillBlock.
    3. Yes it is.
    4. Not to me.
    5. onDamage: if ((event.getBlock().getTypeId() == 1) && (event.getBlock().getData() == 2))
    Checked both in onDamage
    onBlockPlace... F*** you're right
    6. Hang on a sec... Now it doesn't work...
     
  16. Offline

    captainawesome7

    Yep, just tested it. Mobs despawn when they touch stone, as well as a stone with a durability of 2 (because its still stone).
     
  17. Offline

    Baummann

    Maybe it did work for me because I used cuboidian stone/existing stone
     
  18. Offline

    captainawesome7

    LOL FINALLY!!! When you set a blocks durability when crafting, ie: stone with a durability of 2, it DOES NOT STICK. When the crafted item is put into a player's inventory, the stone has an id of 0. It only sticks when it is already in vanilla, such as wool and dye.
     
  19. Offline

    Baummann

    How is the JumpBlock plugin working then? :p
     
  20. Offline

    captainawesome7

    Jump block works because the block he is using, 43 with a durability of 4, DOES exist in vanilla mc. BUT, it isn't a block that you can craft.
     
  21. Offline

    Baummann

    Oh yeh the block that makes my minecraft crash...
     
  22. Offline

    captainawesome7

    What was that supposed to mean? Are you implying that the block (double slab with an id of 4) isn't in regular MC? Cause it is. I have them all over my server, they exist.
     
  23. Offline

    Baummann

    spawn the id 43:4 open your inventory, drag your mouse on it and your minecraft crashes. Or is that only on macs?
     
  24. Offline

    captainawesome7

    I have a mac. I spawn 43:4, open my inventory, drag my mouse on it, and it works fine... The blocks are all over my server:
    2011-06-14_11.15.33.png 2011-06-14_11.15.54.png
     
  25. Offline

    Baummann

    The half steps do
     
  26. Offline

    captainawesome7

    Lol no
    2011-06-14_11.25.29.png
     
  27. Offline

    Baummann

  28. Offline

    captainawesome7

    Maybe you should delete ur old .jar and re download.
     
  29. Offline

    Baummann

    You wont believe how many times I did that ^^
     
  30. Offline

    captainawesome7

    Hmm. Maybe its like my retarded clouds. I assume that Minecraft clouds aren't supposed to be green+brown, but when I re-download they stay the same :(
    Clouds :( (open)

    2011-06-14_11.40.03.png 2011-06-14_11.40.07.png
     

Share This Page