Spigot Plugin Development - 32 - Custom Events

  Рет қаралды 17,600

Kody Simpson

Kody Simpson

Күн бұрын

Пікірлер: 16
@yuso4613
@yuso4613 3 жыл бұрын
Spigot Plugin Development - 31 disappear?
@lorenzosanzi4989
@lorenzosanzi4989 2 жыл бұрын
I know its a stupid question, but I really don't understand when to use return true or false on command, sorry
@MCreeper-eg9xy
@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
@Aurorionx
@Aurorionx 2 жыл бұрын
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.
@KodySimpson
@KodySimpson 2 жыл бұрын
Its a good question, not too sure
@snizer
@snizer 2 жыл бұрын
@@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).
@hytalePvP
@hytalePvP 2 жыл бұрын
Great video, this was really helpful. Why do you have to make getters and not just make "winner" etc. public?
@KodySimpson
@KodySimpson 2 жыл бұрын
That is bad design. Encapsulation is important
@connergreen3178
@connergreen3178 5 жыл бұрын
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
@vanshyadav4533
@vanshyadav4533 5 жыл бұрын
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.
@KodySimpson
@KodySimpson 5 жыл бұрын
Cool idea!
@connergreen3178
@connergreen3178 5 жыл бұрын
@@vanshyadav4533 This wouldn't work If the gui closes (which it can if you press a block) They'll still get kicked
@vanshyadav4533
@vanshyadav4533 5 жыл бұрын
@@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
@connergreen3178
@connergreen3178 5 жыл бұрын
@@vanshyadav4533 Yeah that's the problem I don't know how or what any of those words mean
Spigot Plugin Development - 33 - Silk Touch Spawners
27:35
Kody Simpson
Рет қаралды 8 М.
I built an Omni-Directional Ball-Wheeled Bike
27:55
James Bruton
Рет қаралды 1,2 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
The Async Await Episode I Promised
12:04
Fireship
Рет қаралды 1,1 МЛН
Spigot Plugin Development - 60 - Player Vault Plugin
29:47
Kody Simpson
Рет қаралды 10 М.
Spigot Plugin Development - 13 - Entities 🚰
12:30
Kody Simpson
Рет қаралды 19 М.
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2,1 МЛН
Spigot Plugin Development - 58 - Persistent Data Storage
22:58
Kody Simpson
Рет қаралды 28 М.
Vim in 100 Seconds
11:53
Fireship
Рет қаралды 1,2 МЛН
The Secrets of Photorealism
24:38
Blender
Рет қаралды 878 М.
Spigot Plugin Development - 12 - Cooldowns
13:55
Kody Simpson
Рет қаралды 18 М.