Own Explosion dont Heal #174


  • New
  • Defect
Open
Assigned to nitnelave
  • _ForgeUser21229099 created this issue Apr 28, 2016

    My grenade:

            @EventHandler	
        	public void Granaten(PlayerInteractEvent e){ 
        	if(e.getAction() == Action.RIGHT_CLICK_AIR){ 
        	Player p = e.getPlayer();
    	    	ItemStack Granate = new ItemStack(Material.DIAMOND, 1);
                ItemMeta meta52 = Granate.getItemMeta();
                Granate.setItemMeta(meta52);
        	
        	if(p.getItemInHand().getType() == Material.DIAMOND){			 
        	final Item Grenade = p.getWorld().dropItem(p.getEyeLocation(), Granate);	
        	Grenade.setVelocity(p.getEyeLocation().getDirection().multiply(1.8));
        	
    
          	 if(p.getInventory().contains(Material.DIAMOND)){
    
            	 p.getInventory().removeItem(Granate);
            	 p.updateInventory(); 
            	 }
            	Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
            		public void run() {
            			
    	               	if(Grenade.isOnGround()){
    	               		Grenade.remove();
    	               		World world = Grenade.getWorld();
    	               		
    	               		world.createExplosion(Grenade.getLocation(), 4);
    	                     
    	               		
    	                     world.playEffect(Grenade.getLocation(), Effect.WITCH_MAGIC, 9);
    	                     world.playEffect(Grenade.getLocation(), Effect.LAVA_POP, 9);
    	                     
    	             }
              }
            }, 80L);
             }
        	}
        	}
    

    My Problem:

    If the Grenade Explose it doesnt Heal the Blocks...
    But when I Place a TNT it will heal the Blocks...

    Can u help me?

  • _ForgeUser21229099 added the tags New Defect Apr 28, 2016

To post a comment, please login or register a new account.