// Clockwork Hydra enters the battlefield with four +1/+1 counters on it.
Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(4));
effect.setText("with four +1/+1 counters on it");
this.addAbility(new EntersBattlefieldAbility(effect));
// Whenever Clockwork Hydra attacks or blocks, remove a +1/+1 counter from it. If you do, Clockwork Hydra deals 1 damage to target creature or player.
this.addAbility(new AttacksOrBlocksTriggeredAbility(new ClockworkHydraEffect(), false));
// {tap}: Put a +1/+1 counter on Clockwork Hydra.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(), true), new TapSourceCost()));
}