Here you go:
@Override
public boolean func_111207_a(ItemStack itemstack, EntityPlayer player, EntityLivingBase target){
if(!target.worldObj.isRemote){
if(target instanceof EntityCreeper){
if(player.onGround()){
target.motionY = 2.5;
} else {
player.addChatMessage("This item only works while on the ground!"); }