Solved Asynchronous Items mod possibility

Discussion in 'Bukkit Help' started by jjyy97, Nov 11, 2012.

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

    jjyy97

    I am rather new to this forum, so feel free to mention if this should go somewhere else.

    I was wondering if it was possible to use bukkit to create a new item server-side which uses an existing item for client-side representation (except perhaps with a different name). I figure that since items can be renamed now, it must be possible to create, for example, a specific sword that server-side can preform functions like instant kill, but client-side appears to be a regular sword with a special name (like "admin sword of instant death"). I want to code the mod myself, but wish to know the feasibility of such a mod.
     
  2. Offline

    JWhy

    Code:
    ItemStack anduril = new ItemStack(Material.GOLD_SWORD);
    NamedItemStack namedAnduril = new NamedItemStack(anduril);
    namedItemStack.setName("Anduril (Sword from Middle-Earth)");
    And on onEntityDamageByEntityEvent(...) you check whether it's an Anduril sword and modify the damage of the attack (setDamage(1337)) or just add damagee.setHealth(0)
     
  3. Offline

    jjyy97

    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page