Custom crafts with permissions

Discussion in 'Archived: Plugin Requests' started by Pr4w, Jul 13, 2014.

  1. Offline

    Pr4w

    Hi ! :)

    Plugin category: MECH/ITEMS

    What I want: So basically I am working on a new RPG-style server, and one of the ideas, to go with the Classes we are working on, is to have some new and improved items, based on existing items, such as "Dragon Armor", "Sword of Fire", or what-not. It really shouldn't be too complicated to do I don't think.

    I have looked around quite a bit, but haven't found anything... Which is odd, I figured this is something people would really like.

    The basic idea is being able to create "Custom" crafts, with their own recipes. Basically being able to define a recipe that gives you an item with a name, description, and enchantments, and being able to control the craft of these items with permissions.

    So for example, crafting an "Enhanced Diamond Sword", recipe is Diamond sword + 3 diamonds, gives you a new Diamond Sword with the name "Enhanced Diamond Sword", a configurable description, and some enchantments on it.
    Same would go for armors, "Red Dragon Armor" : Diamond Armor + diamonds + redstone, gives you an armor that has a better defense, enchantments, a custom name and description.

    The idea is that enchantments will be "nerfed" on the server, and these new and improved sets of items will play a role in the game and economy.

    Also, having the crafts handled with Permissions also plays a role in RP, meaning only certain "Classes" can craft some of these improved items.

    The whole point is adding some of that Single Player Adventure Mode fun, with the custom items/quest items, into the game and being able to create classes/quests/"new" items based on that.

    Is this possible? :)

    Thanks!
    Mark
     
  2. Offline

    Pr4w

    Shameless 3-page-self-bump?
     
  3. Offline

    xXSilverswordXx

    Pr4w from what ive seen other developers state, you cant craft items with custom lores and names
     
  4. Offline

    Onlineids

  5. Offline

    xXSilverswordXx

    could you give me an example of how you do this? it would help me (and a guy deving a plugin for me) a lot
     
  6. Offline

    MomsKnife

    Should look like this (if someone notices a mistake pls point it out, it's 4am, and I'm pretty tired.
    Code:java
    1. public void onEnable() {
    2. getLogger().info("YourPlugin has been enabled!");
    3.  
    4. ItemStack customItem = new ItemStack(Material.MATERIAL);
    5. ItemMeta customItemMeta = customItem.getItemMeta();
    6. customItemMeta.setDisplayName("Custom Name");
    7.  
    8. ArrayList<String> customItemLore;
    9. customItemLore = new ArrayList<String>();
    10. customItemLore.add("Lore1");
    11. customItemMeta.setLore(customItemLore);
    12.  
    13. customItem.setItemMeta(customItemMeta);
    14.  
    15. ShapedRecipe recipe = new ShapedRecipe(new ItemStack(customItem));
    16. recipe.shape(new String[] {"000", "010", "000"});
    17. recipe.setIngredient('I', Material.AIR);
    18. recipe.setIngredient('C', Material.MATERIAL);
    19. getServer().addRecipe(recipe);
    20. }
     
  7. Offline

    timtower Administrator Administrator Moderator

    MomsKnife The yourplugin has been enabled is overkill, bukkit is also doing that already.
     
  8. Offline

    Pr4w

    MomsKnife timtower Would any of you guys be willing to add permissions, enchantments, a config file and compile it? :D

    Edit: Basically YAML config file would be like

    Item:
    - Name: 'Dragon Sword'
    - Description: 'Bla bla bla'
    - Enchantments: ['KNOCKBACK:3, THIS:4, FLAME:3, BLA:4]
    - Recipe: ['000', '000', '000']
    - itemOutput: 276 (Diamond Sword)
    - craftPermission: customCraft.diamondsword
     
  9. Offline

    timtower Administrator Administrator Moderator

    Not me, working on other stuff.
     

Share This Page