Exemple #1
0
  @Override
  public void onAttached() {
    super.onAttached();
    getOwner()
        .getNetwork()
        .setEntityProtocol(VanillaPlugin.VANILLA_PROTOCOL_ID, new OcelotEntityProtocol());

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
    getOwner().add(DeathDrops.class).addXpDrop((short) (getRandom().nextInt(3) + 1));
  }
Exemple #2
0
  @Override
  public void onAttached() {
    super.onAttached();
    getOwner()
        .getNetwork()
        .setEntityProtocol(VanillaPlugin.VANILLA_PROTOCOL_ID, new SlimeEntityProtocol());
    if (getAttachedCount() == 1) {
      int spawnHealth = 1;
      if (getSize() == 2) {
        spawnHealth = 4;
      } else if (getSize() == 4) {
        spawnHealth = 16;
      }
      getOwner().add(Health.class).setSpawnHealth(spawnHealth);
    }

    // TODO: Damage depends of the size. Not the difficulty.
  }