I know its a stupid question, but I really don't understand when to use return true or false on command, sorry
@MCreeper-eg9xy Жыл бұрын
If it still helps, you should always use return true. return false just displays the same command in chat after a player/console executes it so it's never really useful
@Aurorionx2 жыл бұрын
What would be the biggest difference between having custom events and just making use of a method. Cause you could also make a method that needs an winner, loser and final score.
@KodySimpson2 жыл бұрын
Its a good question, not too sure
@snizer2 жыл бұрын
@@KodySimpson Events are managed by bukkit for performance reasons, so spigot/bukkit will manage the priority of the events and when they should and shouldn't be triggered (Queue of events...). Another reason to use events is that events can be widely reutilized while a method has only one purpose (Single responsability principle).
@hytalePvP2 жыл бұрын
Great video, this was really helpful. Why do you have to make getters and not just make "winner" etc. public?
@KodySimpson2 жыл бұрын
That is bad design. Encapsulation is important
@connergreen31785 жыл бұрын
Can you do another advanced Inventory/GUI tutorial add more features Like for example what I'm trying to create now is a captcha that comes up and you need to answer it correctly or you get kicked but if you answer it correctly you can play (this is when you first join the server) And the only problem I have is I already created ALL of this I just don't know how to make it so they can't just press escape on their keyobard and just exit it without acc answering it
@vanshyadav45335 жыл бұрын
Listen to the InventoryCloseEvent, Get the title of the inventory closed and compare it to your captcha GUI's title/. If it matches the captcha gui's inventory name, kick the player with your required reason.
@KodySimpson5 жыл бұрын
Cool idea!
@connergreen31785 жыл бұрын
@@vanshyadav4533 This wouldn't work If the gui closes (which it can if you press a block) They'll still get kicked
@vanshyadav45335 жыл бұрын
@@connergreen3178 then make a hash map for each player, with the value as a Boolean which represents their validation. Let it's default value be false. Make it true once they've completed the captcha. Now, if they exit before completing it, check if the player's hash map value is false, if it is, kick the player. Expand it as you need, considering you'll probably need to store the data somewhere else. Good luck
@connergreen31785 жыл бұрын
@@vanshyadav4533 Yeah that's the problem I don't know how or what any of those words mean