Basic API help please.

Discussion in 'Plugin Development' started by Parsalin, Sep 1, 2014.

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


    How would I set how much damage can be does while holding air? i sort of expected this to be easyer. Will it be when damage is caused ill have to check if its by player and set his damage stat then? ((i can do this but well dang...))

    What should I look at for modifying items in game. First just lore and such but further more details or is lore about the only way to do it? ((I am looking forward to attributes on items in 1.8))

    Id like to discuss the different ways to save data in java, and what would be the most efficient in minecraft. I see the most people say config files. I dont really plan to store alot just some simple variables but sort alot of them... if i go skills anyways. So tell me your opinions Each player added to a config file or can you suggest somthing else.

    Thanks to any help you can all offer.
  2. Offline


  3. Offline



    Set damage: Code a listener checking if the player is holding Material.AIR, then set the damage to what you want

    Modding items in game: You can change the lore and the name of the item. I am also looking forward to attributes in 1.8

    Different ways to store data: This topic is so big that you need to precise your question.
    Mainly use YAML config.
    If you want to store player data, make this:
        var1: 15
        var2: false
        var3: 'Johnny'
    Please remember that you should store player's UUID instead of NAME, due to upcoming Name-change update
    Any other data: use your creativity!
    Parsalin likes this.
  4. Offline


    Thanks so much this is very helpful. I was aware of the uuid changes comming though.
    I am specificly trying to create a character sheet of info so things like damage output and damage mitigation. id rather not reference a config file every single time, but i can do that.
  5. Offline


    For data storage, I think the two most popular ways are yaml config files, and SQL. Though I don't see why you can't use another form, unless there is something I don't know about. Mainly depends on personal preference and the type/amount of data you are storing for efficiency.
  6. Offline


    Referencing config is not so bad, because it's contents are stored i memory, so it's not a laggy IO operation. The only IO in configs are save() and load().

    Bukkit plugins are basically a type of java programs, so you can use your tricks from general java, like using Sockets, storing data in JSON or any data format and style. YAML and SQL is advised, because it's fast, and the first one is user-friendly.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 10, 2016
  7. Offline


    SQL, fast? I surely hope you don't execute your MySQL on the main thread :p.
  8. Offline


    sorry. meant yaml is fast :D
Thread Status:
Not open for further replies.

Share This Page