How to increase damage to blocks?

Discussion in 'Plugin Development' started by Tb90, Aug 15, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Tb90

    Hello, i have written a plugin, which should decrease the time to destroy a block.

    So far I use the onBlockDamage() method and after few conditions the block will destroy, with setType(Material.AIR).
    Well this isn't the way I would prefer...

    Now the question, how you can handle the damage dealing on blocks/entities?

    Thanks for the answers ;)
     
  2. I'm not a Java developer so I don't know how you would do this but here is an idea on how it could be done on Obsidian, reducing time from 16 seconds to 3:
    Get onBlockDamage() and wait 3 seconds. If the event has not been canceled (or however you would know if the user stops damaging it) then setType(Material.AIR) and put a dropped version in its place. Also, you could find what the block was damaged with and change the wait time accordingly.
    -
    A less good looking method for Obsidian for example could be onBlockDamage() then setType(Material.DIRT) then when the block is destroyed drop an Obsidian block.
    -
    Method 1 would be better if it would work but how broken the block looks to the user (the cracks) would only be only just under 1/5 of the full crack.
     
  3. Offline

    Amaroq

    This can be done, technically, but it will not be noticed on the client. The client is what handles block breaking, so you would have to modify that to do it in a visually pleasing way.

    I'm sure that Spoutcraft will implement something that works this way.
     
  4. Offline

    Tb90

    @calum Aitchison of course, this I have implemented and my Problem is the unrealistic Blockdestroy (for example the missing cracks and blockdestroy-soundeffects)

    @Amaroq If I want to change properties on the client, then I only have to use the player(bukkit)?
     
  5. Offline

    cholo71796

    @Tb90 As far as I know, there is no way to set the cracks on the block by a plugin alone.
     
  6. Offline

    Tb90

    ok thx...
     
  7. Offline

    Amaroq

    You can use Spoutcraft. I'd recommend that. They have a massive client API for it. But only people with the client can do see the difference. Otherwise, it'll look odd for everyone else.
     
Thread Status:
Not open for further replies.

Share This Page