1.8.8 MySQL

Discussion in 'Spigot Plugin Development' started by christianboo2, Feb 15, 2020.

  1. Hello, everytime a user places a spawner i want to store it in a database, whats the best MySQL table layout for this? I need to keep track of how many total spawners a user has, how many of each type(eg spider, skeleton). Thankyou for seeing
  2. It depends on what data you need, just use normalization.
  3. SteelPhoenix


    location, type, amount should be sufficient no?
  4. I dont really need the location, I was thinking something more like
    User | TotalAmount | Spider | Skeleton| etc etc
    But idk if thats an inefficient way to do it
  5. I still dont know what table structure to use, all i need is the total amount of spawners, and how many of each type, and the users uuid obv
  6. what if the player breaks the spawner, how will the system know that the player broke his own spawner? location save is needed
  7. Its gonna be used for factions, shouldve classified further in the first message, it will get the faction tag and remove one frmo the fac
  8. No you don't need to save the location. If a spawner breaks just remove one from the amount, doesn't matter what is the location.
  9. I explain that its gonna be used for factions
  10. How about the following four (4) tables ?

    user | spawner | location | monster_type

    User = column id, player uuid and spawner id,
    spawner = column id, spawner_id
    location = column id, spawner_id and location
    monster_type = column_id, spawner_id

    Of course it depends on your implementation, your needs may be just one table with all the fields.