Solved This is probably a stupid question but

Discussion in 'Spigot Plugin Development' started by lwccb, Jan 17, 2020.

Thread Status:
Not open for further replies.
  1. hi there,

    im trying to make a gui that can be used by staff to ban people but im not sure how to get the argument from the command /tempban (arg[0]) to display the name as the title in the gui and then when i click a time to ban in the gui the run the command /tempban (arg[0]) whatever i set it as in the config i know how to do that.

    i know this is stupid of a question but im really wanting to learn java plugin development and most of the youtube tutorials just spoonfeed answers with no explanation and i don't understand it please help me with this thanks.
     
  2. When you create a new inventory, you can pass in a parameter that specifies what title should be.

    Because players will interact with the inventory at a later time, you need a way to remember or associate your inventory with the player you want to tempban. A good way to do this is to use a Map to associate the inventory you created with the player the inventory is meant to ban: Map<Inventory, UUID>. When InventoryClickEvent is called, look up the inventory from the map and get the UUID from it. If it’s null, then it’s not an inventory you need to worry about because it wasn’t opened by your plugin. If it’s a valid UUID, then tempban that player.
     
  3. As an add-on to the above posts I would recommend, to learn some basic Java programmering knowledge, before jumping straight into Minecraft Plugin development. (You seem like you've never coded with java before.)

    You may ask why???
    But having the basic core knowledge remembered you can faster create plugins, and make them easier understandable for yourself, and other people in case they should continue, or work on your project at some time in the future.

    There's alot of great courses both free and paid on different sites. (Udemy as an example).

    Checkout this Crash Course to Java on the Spigot Wiki:
    https://www.spigotmc.org/wiki/crash-course-to-java-part-0/

    (I first began using different classes, methods, objects etc. like a few months ago... Please do/learn this if you haven't already).
     
    • Agree Agree x 1
  4. ive made a few little private things like the helloworld i did first off and then i made a /discord and /support command etc but that was a long time ago. but i will look into all the suggestions thanks
     
  5. I got a makro on my board for this:

    1) Go here https://www.youtube.com/channel/UCNXt2MrZaqfIBknamqwzeXA/playlists
    2) Watch everything in 'Java Programming Tutorial'
    3) Watch everything in 'Bukkit Coding Tutorial 1.13' or 'Bukkit Coding Tutorial' if you live in 2014
    4) Watch at least 2-3 Vids from 'Advanced Bukkit Coding'
    5) Come back and ask questions
     
  6. Thankyou i used a those sites you listed and the videos and found another plugins source code read through it and understand it
    thankyou everyone
     
Thread Status:
Not open for further replies.