Solved FallingBlock Material Type?

Discussion in 'Plugin Development' started by ChintziSecilMC, Jun 26, 2015.

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

    ChintziSecilMC

    I was wondering how you make FallingBlocks with different types like stone for example instead of sand

    Like how do i make it so this registers a type of sand? :
    Code:
        @EventHandler(priority = EventPriority.NORMAL)
        public void onEntityChangeBlock(EntityChangeBlockEvent e) {
            if (e.getEntityType() == EntityType.FALLING_BLOCK) {
            }
        }
     
  2. Invisible

    Reynergodoy

    if entitytype == stone {
    setentitytype.falling_block
    }
    just an idea on how it should works :) (concept )
     
  3. Offline

    ChintziSecilMC

    @Reynergodoy kk ill try it

    @Reynergodoy Didnt work D:

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

    MnMaxon

    @ChintziSecilMC
    This should work:
    Code:
        @EventHandler
        public void onEntityChangeBlock(EntityChangeBlockEvent e) {
            if (e.getEntityType() == EntityType.FALLING_BLOCK) {
                e.setCancelled(true);
                e.getBlock().setType(Material.AIR);
                Location loc = e.getEntity().getLocation();
                loc.getWorld().spawnFallingBlock(loc, Material.BEDROCK, (byte) 0);
            }
        }
     
  5. Offline

    ChintziSecilMC

    @MnMaxon It did thank you very much :D
     
Thread Status:
Not open for further replies.

Share This Page