Quick help with a code

Discussion in 'Spigot Plugin Help' started by Plantking100, May 15, 2016.

  1. I know this is possible and probably very simple but i am having problems making an item that requires a certain level and that can do damage a range of damage so like
    Damage: 7-11
    LvL req: 5
    this is for skill api and mythic mobs if it mattters and here is an example of a working item for it just without what i need (lvl and damage range)

    Code (Text):
    SkeletonKingSword:
      Id: 276
      Data: 0
      Display: '&3Greatsword of the Skeleton King'
      Lore:
      - '&6A powerful sword used by'
      - '&6the King of Skeletons.'
      Enchantments:
      - DAMAGE_ALL:5
      - KNOCKBACK:2
      - FIRE_ASPECT:2
      Options:
        Health: 10
        MovementSpeed: 0.1
     
     
    #1 Plantking100, May 15, 2016
    Last edited: May 15, 2016
  2. Are you making this plugin yourself? Or is this for Config from another plugin?
     
  3. Use insert code to allow for us to see the spaces in the config.

    If you are coding this check for entity damage event or something along those lines then check the item in hand, then enchantments etc... Then set damage
     
  4. like that
     
  5. I agree with that, but also check if the item being used to inflict the damage has the right Lore (or metadata.)
     
  6. Have you checked the plugin help page / FAQ?

    What plugin is that config from
     
  7. this is from mythic mobs to make the items and skillAPI for the levels ik that they are compatible and that there is a easy way i just dont know how
     
  8. What is this even about? You've confused us.
     
  9. config is from mythic mobs
     
  10. Okay, then what are you trying to do, exactly?
     
  11. xD you're right lol
     
  12. If it's from another plugin, was the config walk throughs not explicit enough?
     
  13. This is the code for the items that i want to have the level requirement and damage range on (mythic mobs)
    Code (Text):
    #
    # This example file shows you how to set up special items
    # for your mobs to equip or drop.
    SkeletonKingSword:
      Id: 276
      Data: 0
      Display: '&3Greatsword of the Skeleton King'
      Lore:
      - '&6A powerful sword used by'
      - '&6the King of Skeletons.'
      Enchantments:
      - DAMAGE_ALL:5
      - KNOCKBACK:2
      - FIRE_ASPECT:2
      Options:
        Health: 10
        MovementSpeed: 0.1
    KingsCrown:
      Id: 314
      Data: 0
      Amount: 1
      Display: '&dCrown of the King'
      Lore:
      - '&6A kingly crowl that grants'
      - '&6the wearer unwavering power!'
      Enchantments:
      - PROTECTION_ENVIRONMENTAL:2
      - PROTECTION_PROJECTILE:2
      - PROTECTION_FIRE:2
      - PROTECTION_EXPLOSIONS:2
      Hides:
      - ATTRIBUTES
      - ENCHANTS
      Options:
        Health: 10
        KnockbackResistance: 10
    #
    BanditTunic:
      Id: 299
      Display: '&aBandit Tunic'
      Lore:
      - '&6A leather tunic taken from'
      - '&6the corpse of a bandit.'
      Options:
        Color: 255,40,40
     
    This is how ik it is possible (from skillAPI)
    Code (Text):
    Items:

      # Whether or not to check for class, level, and attribute
      # requirements in an item's lore
      lore-requirements: 'false'

      # Whether or not to check for skill requirements
      # in an item's lore
      skill-requirements: 'false'

      # Whether or not to check for stat bonuses in an item's lore
      lore-attributes: 'false'

      # Whether or not to drop weapons when unable to use them
      drop-weapon: 'false'

      # The text used for class requirements in the lore
      lore-class-text: 'Class Req: '

      # The text used for skill requirements in lore
      lore-skill-text: 'Requires {skill}: '

      # the text used for level requirements in the lore
      lore-level-text: 'Level Req: '
     
     
  14. it would but it is 2 plugins where one config says that it is compatible with another and then states little about it
     
  15. i want to make items only be used at certain levels and for items to also be able to do a range of damage like a random number between 1 and 5
     
  16. -_- not very fucking helpful
     
  17. What do u wish to know
     
  18. Which plugin? Use
    Code (Text):
    Write your config here
    format. (use the plus surrounded by a square, then click code)
     
  19. Code (Text):
    # ---------------------------------------------- #
    #              General Configuration             #
    # ---------------------------------------------- #
    # If you are unsure of how to use this file,     #
    # but would like to change how the plugin shows  #
    # text, visit the BukkitDev page at:             #
    # http://dev.bukkit.org/bukkit-plugins/skillapi/ #
    # and look at the default configuration section  #
    # ---------------------------------------------- #
    Accounts:

      # The main class group used for GUI displays
      main-class-group: 'class'

      # Currently disabled, ignore this
      one-per-class: 'false'

      # The max number of accounts a normal user can use
      max-accounts: '3'

      # The max number of accounts users can have with certain permissions
      # must be in the format '<permission>:<accounts>'
      perm-accounts:
      - 'skillapi.account.admin:10'

    # While targeting settings aren't necessary most of the time,
    # they can help make running ally checks much faster if
    # you are able to use them.
    Targeting:

      # Whether or not all monsters are enemies.
      # If you are using pets that include zombies/spiders/etc,
      # you shouldn't enable this.
      # If you want to enable it for specific worlds, list out the
      # worlds it should apply to in a list format such as:
      # monsters-enemy:
      # - world1
      # - world2
      monsters-enemy: 'false'

      # Whether or not all passive mobs are allies.
      # If there are custom passive mobs that you can fight,
      # you should not enable this.
      # If you want to enable it for specific worlds, list out the
      # worlds it should apply to in a list format such as:
      # passive-ally:
      # - world1
      # - world2
      passive-ally: 'false'

      # Whether or not all players are allies.
      # If you have any PvP, this should not be enabled.
      # If you want to enable it for specific worlds, list out the
      # worlds it should apply to in a list format such as:
      # player-ally:
      # - world1
      # - world2
      player-ally: 'false'

    Saving:

      # Whether or not to auto save data periodically
      auto-save: 'false'

      # How often to auto-save in minutes
      minutes: '30'

      # Whether or not to use an SQL database to save
      sql-database: 'false'

      # Details for connecting to the database
      sql-details:
        host: 'localhost'
        port: '54321'
        database: 'plugins'
        username: 'username'
        password: 'password'

    Classes:

      # Whether or not to use SkillAPI's health system
      modify-health: 'true'

      # The default health for players without a class
      classless-hp: '20'

      # Whether or not non-castable auto-leveled skills are shown
      show-auto-skills: 'false'

      # Whether or not attributes are enabled
      attributes-enabled: 'false'

      # Whether or not attributes can be refunded
      attributes-downgrade: 'false'

      # This casts the dynamic skill for the player when they level up,
      # allowing you to use dynamic mechanics for level up effects. If
      # there is no existing dynamic skill with the name, no effect
      # will be played. For level-specific effects, use the level condition.
      level-up-skill: 'lvlup'

    Mana:

      # Whether or not to use SkillAPI's mana system
      enabled: 'true'

      # How frequently mana is gained in seconds
      freq: '1'

    Skills:

      # Whether or not players are allowed to downgrade skills
      allow-downgrade: 'true'

      # Whether or not messages should be shown on casting a skill
      show-messages: 'true'

      # The radius in which to show cast messages to nearby players
      message-radius: '20'

      # Whether or not to apply damage knockback when damage is blocked
      # by defensive or offesnive buffs and debuffs
      knockback-no-damage: 'false'

      # Blocks to ignore when using the Block mechanic in dynamic skills
      # End values in an * to do all materials containing the value
      block-filter:
      - 'chest'
      - 'ender chest'
      - 'trapped chest'
      - 'redstone*'
      - 'wall sign'
      - 'sign post'

    Items:

      # Whether or not to check for class, level, and attribute
      # requirements in an item's lore
      lore-requirements: 'false'

      # Whether or not to check for skill requirements
      # in an item's lore
      skill-requirements: 'false'

      # Whether or not to check for stat bonuses in an item's lore
      lore-attributes: 'false'

      # Whether or not to drop weapons when unable to use them
      drop-weapon: 'false'

      # The text used for class requirements in the lore
      lore-class-text: 'Class Req: '

      # The text used for skill requirements in lore
      lore-skill-text: 'Requires {skill}: '

      # the text used for level requirements in the lore
      lore-level-text: 'Level Req: '

      # The text used for excluded classes in the lore
      lore-exclude-text: 'Excluded Class: '

      # The text used for attribute requirements
      lore-attribute-text: '{attr} Req: '

      # The text used for providing attributes
      attribute-text: '{attr}: '

      # How many players to check for the requirements each tick
      # This should be increased on larger servers to prevent
      # large delays before the same player is checked again
      players-per-check: '1'

    GUI:

      # Whether or not to lock the health bar to 10 hearts
      # This does not affect total health, only the display
      old-health-bar: 'true'

      # Whether or not to force SkillAPI to override
      # health scaling of other plugins
      force-scaling: 'false'

      # This is what to display using the level bar, if anything.
      # Options are: none, mana, level
      level-bar: 'level'

      # This is what to display using the food bar, if anything.
      # Options are: none, mana, exp
      food-bar: 'mana'

      # Whether or not to use the action bar
      use-action-bar: 'false'

      # The text to display on the action bar.
      # Available filters:
      #   {combo}       - the player's current click combo
      #   {class}       - the player's main class name
      #   {level}       - the player's main class level
      #   {exp}         - the player's main class exp
      #   {expReq}      - the player's main class required experience
      #   {expLeft}     - the player's main class experience until the next level
      #   {health}      - the player's current health
      #   {maxHealth}   - the player's max health
      #   {mana}        - the player's current mana
      #   {maxMana}     - the player's max mana
      #   {name}        - the name of the player
      #   {attr}        - the player's attribute points
      #   {sp}          - the player's main class skill points
      #   {value:<key>} - a skill value
      action-bar-text: '{combo}'

      # Whether or not to use title messages
      title-enabled: 'false'

      # Duration for title messages in seconds
      title-duration: '3'

      # Fade in time for title messages in seconds
      title-fade-in: '0.5'

      # Fade out time for title messages in seconds
      title-fade-out: '0.5'

      # Messages to display using the Title bar
      # Second lines of messages will be displayed in the subtitle
      # Ones you can use include:
      #   level_up
      #   exp_gained
      #   exp_lost
      #   status
      title-messages:
      - 'level_up'
      - 'exp_lost'

      # Whether or not to display class information on a scoreboard
      scoreboard-enabled: 'true'

      # Whether or not to add a prefix to players with their class name
      show-class-name: 'true'

      # Whether or not to display a player's level below their name
      show-class-level: 'true'

      # Whether or not to use map trees instead of the regular ones
      # View map.yml for further customization for this option
      # Also add more schemes by adding folders in the "img" folder
      # Allow for both map skill trees and regular ones by setting
      # this to "partial"
      map-tree-enabled: 'false'

    Click Combos:

      # Whether or not to use click combinations
      enabled: 'true'

      # Whether or not players can customize their combos
      allow-custom: 'false'

      # Whether or not left clicks are allowed at all
      use-click-left: 'true'

      # Whether or not right clicks are allowed at all
      use-click-right: 'true'

      # Whether or not shift clicks are allowed at all
      use-click-shift: 'false'

      # How many clicks are needed to perform a combo
      combo-size: '4'

      # Inactivity time in seconds before clicks for a combo are reset
      click-time: '1.0'

    Skill Bar:

      # Whether or not to use skill bars
      enabled: 'false'

      # Whether or not to show skill cooldowns in the skill bar
      show-cooldown: 'true'

      # The item to use as a placeholder in the skill bar
      empty-icon:
        material: 'PUMPKIN_SEEDS'
        data: '0'
        text: '&7Unassigned'

      # The default layout for skill bars
      # Players can customize unlocked slots
      layout:
        1:
          skill: 'true'
          locked: 'false'
        2:
          skill: 'true'
          locked: 'false'
        3:
          skill: 'true'
          locked: 'false'
        4:
          skill: 'true'
          locked: 'false'
        5:
          skill: 'true'
          locked: 'false'
        6:
          skill: 'false'
          locked: 'false'
        7:
          skill: 'false'
          locked: 'false'
        8:
          skill: 'false'
          locked: 'false'
        9:
          skill: 'false'
          locked: 'false'

    Experience:

      # Whether or not to use vanilla exp drops for class exp
      # Note: any dropped exp will not count towards class exp,
      # only enabled sources will count. By default, this is only
      # mob deaths.
      use-exp-orbs: 'true'

      # Whether or not to prevent gaining experience from mobs
      # spawned via a mob spawner block
      block-mob-spawner: 'true'

      # Whether or not to prevent gaining experience from mobs
      # spawned via a mob spawn egg
      block-mob-egg: 'true'

      # Whether or not to prevent gaining experience while
      # in creative mode
      block-creative: 'true'

      # Whether or not to display a message when gaining experience
      exp-message-enabled: 'true'

      # Whether or not to display a message when gaining a level
      level-message-enabled: 'true'

      # Whether or not to show a message when losing exp de to dying
      lose-exp-message: 'true'

      # The formula used for calculating required experience
      # The formula is: x*lvl*lvl + y*lvl + z
      formula:
        x: '1'
        y: '8'
        z: '16'

      # Whether or not to use a custom equation
      use-custom: 'false'

      # The custom formula to use with 'lvl' being the current player level
      custom-formula: '25(1.1^(lvl-1))'

      # The experience yields from each mob type
      # When exp orbs are enabled, these values are ignored
      yields:
        blaze: '10'
        cavespider: '5'
        creeper: '3'
        elderguardian: '10'
        enderdragon: '400'
        enderman: '5'
        endermite: '3'
        ghast: '5'
        giant: '20'
        guardian: '10'
        irongolem: '10'
        magmacube: '1'
        pigzombie: '5'
        player: '5'
        shulker: '5'
        silverfish: '2'
        skeleton: '3'
        slime: '1'
        spider: '3'
        witch: '3'
        wither: '500'
        witherskeleton: '5'
        zombie: '2'

    # How much logging to do when loading SkillAPI
    # When testing setting up skills/classes, increase this to 1-5
    Logging:

      # Logs for loading attributes
      attribute-load: '0'

      # Logs for attack/defense buffs applying
      buff: '0'

      # Logs for registration of skills and classes
      registration: '0'

      # Logs for GUI updates
      gui: '0'

      # Logs for mana updates
      mana: '0'

    Worlds:

      # Whether or not to enable the world restriction
      enable: 'false'

      # Whether or not to use the list as an enabling list
      # If true, only worlds in the list will let players use SkillAPI
      # If false, any world not in the list will let players use SkillAPI
      use-as-enabling: 'true'

      # The worlds to include in the enable/disable list
      worlds:
      - 'world'