Stuck. Need Plugin help!

Discussion in 'Plugin Development' started by LilHambo, Jul 17, 2013.

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

    LilHambo

    I'm trying to make a plugin that when you ignite wood with Flint and Steel the wood doesn't break so the fire is infinite.
    Code:java
    1. @EventHandler
    2. public void onBlockIgnite(BlockBurnEvent event){

    This is all I have so far. What should I do next?
     
  2. Offline

    Metal Julien

    LilHambo 1. Add the ignited block from PlayerInteractEvent (Check for IteminHand = flint nd steel, check rightclick) to a List.
    2. Cancel the blockburnevent if the block is added to the list.
    3. Cancel the interactevent leftclick when the interacted block is in the list and the player isn't op
    4. Save the list to a config file on disable plugin, load it on enable
     
  3. Offline

    LilHambo

  4. Offline

    fanaticmw2

    List<Block> blockList = new ArrayList<Block>();
     
  5. Offline

    Zethariel

    @LilHamb
    Code:java
    1. @EventHandler
    2. public void BlockBurn(BlockBurnEvent event)
    3. {
    4. event.setCancelled(true);
    5. }

    Simple code to stop burning. No lists, required. You'll also need an event to catch when the fire will go out - MC fire doesn't stay on indeffinetly and you'll need to refresh it every once in a while, unless a player or another entity put it out.
     
  6. Offline

    Metal Julien

    Zethariel He wanted to make wood fired by flint and stone not to stop burning down, not every block I think
     
  7. Offline

    jayfella

    Code:java
    1. if (event.getCause() == IgniteCause.FLINT_AND_STEEL)
     
  8. Offline

    Zethariel

    Metal Julien
    Then it's just a question of adding an IF statement that checks if the burned block is wood
     
  9. Offline

    Garris0n

    Save the locations not the blocks.
     
  10. Offline

    Metal Julien

    Zethariel No, it's also the question if it's lighted by flint & stone by a player
     
Thread Status:
Not open for further replies.

Share This Page