Explosions explode item frames.

Discussion in 'Plugin Development' started by DatCookiez, Nov 15, 2013.

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

    DatCookiez

    Hey Guys,
    I have the code:
    Code:java
    1. player.getLocation().getWorld().createExplosion(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), 4F, false, false);

    and for some reason, item frames still break. How is this possible?
     
  2. Offline

    xTrollxDudex

    realiez
    Wait what? An item frame is a block? I'm not sure, let me check the javadocs

    Edit: Yeah, they're not blocks. You'd have to cancel HangingBreakEvemt
     
  3. Offline

    JRL1004

    realiez Item frames are not blocks, they are entities. Simply setting the explosion to not deal block damage will not stop the item frames from taking damage then breaking. You will need to find another way to stop the frames from being destroyed.

    EDIT: Try was xTrollxDudex said.
     
Thread Status:
Not open for further replies.

Share This Page