Damn bro, thank you. I've always avoided Java for obvious reasons but i got myself to it using minecraft as my playground. another language added to my repertoire, partly thanks to you.
@@KodySimpson Hey, love your tutorials so far! I was wondering if you could do a tutorial on custom animal behaviour. e.g. how to make a "pet" follow you around and do stuff like attack certain mobs. I've heard that it's quite hard to do and so far I haven't been able to found any tutorials on this, so I'm not sure if it's possible.
so, i started your series yesterday. And on a scale of 1 - 100,000. My Java knowledge would be 5. I am new To Java. However, a lot of people i know, are excellent java devs. and when i asked them how to learn java in the most efficient way. They suggested i Learn by making plugins. Learn New things, while making practice plugins. Then, if i want, learn advanced techniques later when i need to. And a lot of themm suggested your channel. So i guess i'll try it. will let you know about my progress every 20 days ;) Btw, great series so far.
To fix the exp bottle breaking blocks, use this instead: @EventHandler public void onHit(ProjectileHitEvent e) { if (!(e.getEntity() instanceof ThrownExpBottle)) return; Block block = e.getHitBlock(); if (block == null) return; block.breakNaturally(); } This will basically check if the projectile is an expbottle, if it hit a block, then break the block. The event used in the video will always return null (because spigot is stupid and that's what they wanted to implement)
It can be more simple just adding a if condition like this: @EventHandler public void onXPBottleBreak(ExpBottleEvent e) { Block block = e.getHitBlock(); if(block != null) { block.breakNaturally(); } }
When I try to do ctrl q and hover over something to see it’s documentation it only displays a couple things but not the description of what it does which is something that would be extremely helpful to me. If anyone knows why this is happening or how I can fix it then please let me know.
if you are using intellij, then first press ctrl, when you get a blue underlining and text, then press Q. you should then go to another file with the description. you can also hover over the method/command and itll give you a small description
How do you know in what order the plugins will react to a event when multiple plugins listen to the same one? Can you give your plugin priority on certain events or something? For example you are trying to do something on ExpBottleEvent but another plugin already did something to it or even canceled it. Or worse, you are trying to cancel an event but another plugin already reacted and did some stuff according to it.. I hope you are still answering under old videos ^^
Listener is an interface so it must be implemented on that class, classes are for extension usually. I recommend watching some Java OOP vids itll help a lot because it is a lot to explain here, but great question overall
@@KodySimpson thanks. I know most of the popular programming languages like C and C++, they probably have implements and extends, and I never even noticed
Hello Kody, I wanted to make a plugin, that slowly progresses and becomes more and more advance by adding stuff to it as I progress through the tutorials. If I was to create a plugin's version 1.0 and then I wanted to update the plugin and call it version 1.1. How could I do that? Would be nice, if the file names would update to the new version aswell. But I am having problems doing that.
you do that in the pom.xml file, theres an option there called ____ , it takes the blank and puts it in the name, so if you change that to 1.1, if you build it again itll call it *pluginname* 1.1, you do have to rebuild the plugin everytime you change the version though, not sure if just purely changing the plugin name will cause an error or not.
i made a plugin that pervents even creative players from breaking berdrock! ps:pls if you can, recommend some jave tutorials that woud help me with this because i do not have the time to watch 99 episodes.
To make your exp bottle destroy a block you have to write this: @EventHandler public void onProjectileHitEvent(ProjectileHitEvent e) { Block block = e.getHitBlock(); block.breakNaturally(); }
Damn bro, thank you. I've always avoided Java for obvious reasons but i got myself to it using minecraft as my playground. another language added to my repertoire, partly thanks to you.
Glad you like it, thanks for being a member
All of these tutorials are soo cool I love them. Keep going, it is fun to watch the videos and you explain the stuff very well.
Glad you like them!
@@KodySimpson Hey, love your tutorials so far! I was wondering if you could do a tutorial on custom animal behaviour. e.g. how to make a "pet" follow you around and do stuff like attack certain mobs. I've heard that it's quite hard to do and so far I haven't been able to found any tutorials on this, so I'm not sure if it's possible.
These tutorials are really cool man. While I was watching your shear prevention I decided to make a flight prevention plugin and it worked!!!
listening him talk about cancelling events is 10/10 perfect english. starts at 8:00
so, i started your series yesterday. And on a scale of 1 - 100,000. My Java knowledge would be 5. I am new To Java. However, a lot of people i know, are excellent java devs. and when i asked them how to learn java in the most efficient way. They suggested i Learn by making plugins. Learn New things, while making practice plugins. Then, if i want, learn advanced techniques later when i need to. And a lot of themm suggested your channel. So i guess i'll try it. will let you know about my progress every 20 days ;)
Btw, great series so far.
To fix the exp bottle breaking blocks, use this instead:
@EventHandler
public void onHit(ProjectileHitEvent e) {
if (!(e.getEntity() instanceof ThrownExpBottle)) return;
Block block = e.getHitBlock();
if (block == null) return;
block.breakNaturally();
}
This will basically check if the projectile is an expbottle, if it hit a block, then break the block.
The event used in the video will always return null (because spigot is stupid and that's what they wanted to implement)
sad how you had to comment this, when kody could have fixed it instead of going off on his random thoughts and next "lessons"
@@totalsoupsloud everyone makes mistakes
actually it would be a lot easier if you just wrote "assert block != null;"
It can be more simple just adding a if condition like this:
@EventHandler
public void onXPBottleBreak(ExpBottleEvent e) {
Block block = e.getHitBlock();
if(block != null) {
block.breakNaturally();
}
}
@@yudi.takedaHello, I'm sorry to tell you that I didn't get the effect of breaking blocks with your method, and I don't know what caused it to fail
Thanks for spigot tutorials! Very useful in my efforts in becoming a plug-in god!!!
Thank you!!! Keep up the great work plugin god
i am gonna watch whole series
Great tutorial 👍
Greetings from Tucson, AZ!
Thank you from Dallas!
@@KodySimpson How many years do you code? Since the high school or earlier?
ur videos r sooo good really ty ty! they actually rlly helped me with making my own plugins. Thanks
Happy to hear that! Keep up the great work.
canceling events? what is this Twitter?
Lol you had me confused at first
It was a good one i give you that
What appearance theme are you using on intellij? Loved the vid btw
Right now I am using the default dark theme in jetbrains, I think at the time of recording I was also using that theme but i could be mistaken
You can also shear a snowman, try it....
You can also shear a snowman ;)
When I try to do ctrl q and hover over something to see it’s documentation it only displays a couple things but not the description of what it does which is something that would be extremely helpful to me. If anyone knows why this is happening or how I can fix it then please let me know.
same issue
if you are using intellij, then first press ctrl, when you get a blue underlining and text, then press Q. you should then go to another file with the description. you can also hover over the method/command and itll give you a small description
Thanks for the video!
How do you know in what order the plugins will react to a event when multiple plugins listen to the same one? Can you give your plugin priority on certain events or something?
For example you are trying to do something on ExpBottleEvent but another plugin already did something to it or even canceled it.
Or worse, you are trying to cancel an event but another plugin already reacted and did some stuff according to it..
I hope you are still answering under old videos ^^
Why is listener being implemented instead of being extended? I'm new to java and they both look the same, could you show me how they are different?
Listener is an interface so it must be implemented on that class, classes are for extension usually. I recommend watching some Java OOP vids itll help a lot because it is a lot to explain here, but great question overall
@@KodySimpson thanks. I know most of the popular programming languages like C and C++, they probably have implements and extends, and I never even noticed
What do you mean by get?? getPlayer gets the player and puts him where?
Dropped a like and aubbed. It's the least I can do. 😊
Hello Kody, I wanted to make a plugin, that slowly progresses and becomes more and more advance by adding stuff to it as I progress through the tutorials. If I was to create a plugin's version 1.0 and then I wanted to update the plugin and call it version 1.1. How could I do that? Would be nice, if the file names would update to the new version aswell. But I am having problems doing that.
I'm having a bit of trouble understanding exactly what you mean, I would just go back into the project and make the changes you need to make.
you do that in the pom.xml file, theres an option there called ____ , it takes the blank and puts it in the name, so if you change that to 1.1, if you build it again itll call it *pluginname* 1.1, you do have to rebuild the plugin everytime you change the version though, not sure if just purely changing the plugin name will cause an error or not.
thanks
i don't have EntityType ,help. I used Sheep but its not work...
I was trying the same thing and its giving me same issue.. did you find any solution?
I dont know but the check for sheep is not working
Its like not checking if its sheep or not
I need some help!
ok found the problem
@@wolfmine7408 i don't have "EntityType" may you help me?
Does anyone know what is the name of the IntelliJ theme he is using?
obama
@@KodySimpson Where can it be found though? (A bit late, lol)
@@MrKakotu check me videos i have a theme video
nice!
Thanks!
Emmet certified
i made a plugin that pervents even creative players from breaking berdrock!
ps:pls if you can, recommend some jave tutorials that woud help me with this because i do not have the time to watch 99 episodes.
lol forgot the "new" when registering my listener... spent days on this
RIP
I think maybe it's broken because it registers air blocks as the hit blocks
ok?
ok
Why do you write Block twice? in "Block block = e.getHitBlock()"
im guessing the fist one that has the uppercase B, references the actual block, and then the second one is your variable name?
@@nathanielpillar8012 exactly
To make your exp bottle destroy a block you have to write this:
@EventHandler
public void onProjectileHitEvent(ProjectileHitEvent e) {
Block block = e.getHitBlock();
block.breakNaturally();
}
but doesn't that make it so all projectiles delete blocks and not just XP bottles?
@@_V_G_ Just do e.getEntity().getName()