In this video i’m going to be showing you how dream codes his minecraft challenge videos if you’ve watched any of dream’s videos in the past year you know he does a lot of stuff that’s definitely not in vanilla minecraft to do this he uses plugins which he codes himself I’ve been coding a while myself and have just recently got into coding minecraft plugins for fun be sure to check out some of the minecraft videos on my channel using plugins that i’ve made myself just like dream and subscribe for more coming in the future so the first thing we actually need to Do before we even start coding at all is to download the right stuff there are actually only four things you need to download to make minecraft plugins the first is an ide there are a bunch of different ids for java which is the programming language that We’re going to be using the one that i’ll be using is eclipse next is a folder that we’re going to put all of our plugins into once we make them then we’re going to have java we don’t need this java.txt we actually need to go to java.com or whatever to download java And make sure that if you have a 64-bit computer to download 64-bit java and then we’re also going to need the spigot version for whatever version of minecraft we’re using so i’m programming in 1.15.2 for this one and i’m just going to throw this jar file into our plugins folder The first thing that happens when you open your ide is it’s going to ask you for a workspace so i’m going to change the workspace to this plugins folder so i just set it to that folder and we launch so now to start our mod or plug-in what We’re going to do is just click create a java project i think an easy one to do is just being able to spawn whatever creature you want to into the game because i’ve seen a couple videos of dream that he does that in so let’s say a creeper Creeper spawn and we can just click finish from there so now we see that we have this creeper spawn and it’s going to have our java library we don’t really have to do anything with that but we do have to add our spigot files because we’re going to be using those So we want to right click on here go to build path add external archives and then click on spigot 1.15.2 so that adds all the spigot stuff that we’re going to be using for our mod to our project so now we’re all set up we’re ready to start coding So the first thing we want to do is create our main file which is going to run when the mod actually runs so to do this we just click on our source folder and we make a new package and we want to name that me dot your name so i’m just gonna do Jack dot the name of our mod so i’m doing creeper spawn and then we can click finish make sure all that’s spelled correctly and then now we’re gonna add a java class to that we’re just gonna call it main with capital m so i’m just gonna do some stuff really Quick to tighten this up and most of the things that i’m doing are pretty much constant for every single mod you’ll make at least for the main so you put extends and then java plug-in so you see that we have a red line on your java plug-in and this is where The ide comes into play so we have to import java plug-in from bucket so everything that we’re going to be importing from now on is from this bucket so we just click on there you should see the red line disappear and we’re good to go now all we have to add to Here is something that says override with a capital o and we can add the last part of our main class which is the on enable so this runs every time that our plug-in is enabled so basically at the beginning when we start our server so we’re done with our main class For now so we’re going to come back to this later and now we can actually write the code for our command so in this package that we already have made we’re going to create another package so we’re just going to right click on that click new package and then Add a dot and you can think of a dot as a new folder in a directory of folders and then we’re going to name this commands so now we have our commands folder and we’re going to add a new java class to this which is our command And we can just say creeper command okay so i’ve just added the rest of all the default kind of stuff and we can walk through it really quickly so this is all the imported stuff this gets added automatically once you add this but pretty much all this stuff can be Copy pasted if you’re going to copy this it can all be copy pasted as right now the only things that really change are the name of the command which we’re going to be using later and then this is a constructor which basically makes the command itself and then this is The most important thing in this part this actually sets the command which is going to be written in the server by the player so to get this command to run when we’re in the actual game we’re going to do slash creepspawn and then this is what the command actually does So when the command is run it goes into here and we have these values so the command sender is the player that sends the command the command is the command itself the args are the other values within the command so if you’re doing slash time set day we would have the values Set and day and then we could use those to do different things within the command itself but for this one where we’re just going to be spawning creepers all we need to do is basically get the player get their location and then spawn creepers there and i’m Just going to do a very simplified version of the one that dream used in a couple of his videos just as a proof of concept this is a lot of coding stuff so i recommend that if you do want to learn how to do this stuff More in depth check out the videos in the description and also look up more information on java or just coding in general because a lot of the stuff translates language to language so we’re going to get the player and we’re just going to name the player p And we’re going to use that and we have to type cast which basically means we’re going to be taking command sender and turning it into a player and so now we’re just converting sender into a player which we can use to get other information from we don’t have player imported yet to use So we’re going to import that so now we have our player all set up and now we want to get the location of the player and we can do p dot get location and that gets the location of the player we don’t have location so we’re going to import location And you want to make sure so you can see that there are these other locations but we only want the location from bucket or spigot so we’re just gonna use a simple for loop to spawn our mobs so i’m just gonna do hint i equals zero and then we’re gonna go while i Is less than 10 and then i plus plus so this is just going to run through it 10 times so basically it’s going to do what’s ever inside this for loop 10 times and so this is where you might come to a standstill how do you spawn a creeper or how do you Do whatever so this is where there’s a really good resource which is actually the spigot javadocs and it has all the information on anything you’d ever want to do within making a minecraft plugin so we want to spawn a creeper so we can just type in Spawn in the search bar and you get all these different options and i i actually know what we’re going to be using so we want to use spawn entity and if you click on it you can go to spawn entity and it is a method of a world Class and it takes a location and a type so we have our location that we want to spawn it at we want to spawn it at the actual player location which we already have and we want to spawn a creeper so to do this we want to look up Entity type and see what kind of entity types are available if we can even spawn a creeper and it looks like we can so there’s an entity type called creeper which we can spawn and to get the world we can do p dot get world i believe yes and then we’re gonna have A world type and that’s just gonna be w and then again we’re gonna have to import this and that’s gonna be the org dot bucket so now all we have to do is w dot spawn entity so and this is another great thing about the ids if you’re typing A method that you want to use all you have to do is put the dot and then it shows up with every single method that is possible for that given class that you’re working within so we want to spawn an entity so we can just click on spawn entity We want to spawn it at location lock and entity type creeper so we’re just gonna put entity type dot creeper so now that should work what this is gonna do is it’s gonna load in the command it’s going to say if this command gets run creep spawn gets run it’s going to run Whatsoever in here we’re going to get the player that runs it we’re going to get the player’s location then we’re going to get the world that the players in then 10 times we’re going to spawn a creeper at the player’s location so now we have our creeper command completely done everything’s all set With this and all we have to do now is go back into our main file which we made a while ago and just type in new creeper command this and then we’re going to import it but this time since we actually wrote it we’re going to import it from our own Code so now everything with our main file and our creeper command file is completely done and there’s one last step we have to do so to get the plugin to actually recognize where it wants to start we have to show what the main file is within so we’re going to go to source New and we’re just going to have a file and we’re going to call it plugin dot yml and this has some specific stuff that it needs so it needs the name of the plugin and we have to format it just like this so our plugins name is creeper spawn It needs a version number so we’re just going to do 1.0 author new jack and then it needs the main file and we have to point it to the exact main file that it’s at so our main file is in this file so me.jack.creeperspawn.main Is where our main file is so we have to type in me dot jack dot creeper spawn dot main and make sure all the capitals are the same lowercase all the same everything has to be the same and then there’s one last thing we have to put because we put Commands into here we have to do commands and then we’re going to hit enter and then click space twice you can do tab but it’s a little finicky sometimes so it’s better just to do two spaces and then if we go back to our command the name of our command Is creep spawn so we do creep spawn and then another two spaces and we can do aliases if we want so that’s other things that you could put that would also work so if we wanted to do like cs for creep spawn for short then that would work as well so we can Save this and we are basically done our final step is to close all this up we right click on creeper spawn and we go to export and we click java and we export it as a jar file and then we choose where we want to Export it so i’m going to export it to our plugins we’re going to save it as creeperspawn.jar and i’ll click save finish it’s going to say there are some warnings and that’s just because there are warnings with our within our code as long as they’re not red X’s or things that won’t allow the code to actually run it’s fine click ok and now we’re done i’m going to load up this plugin on a server and try it out for myself just to show you that it works all right so we’ve joined into A world in the server that i’m going to be testing this out in and i’m just going to set my game mode to creative because i don’t feel like getting exploded and all we should have to do is click slash cs and there you go 10 creepers just spawn right on my location So that basically shows how he did it he did a little bit different by spawning it over an entire chunk but you can see that it’s basically the same logic it just uses a little bit different we can also use our other thing which is slash creeper spawn And that does the same exact thing spawning 10 creepers on my location so those are kind of the basics of how you create a plug-in of something that dream would kind of use in a video of his and you can see in the background here that I kind of have uh some spoilers going on for a video that i’m putting out in a couple days from now so uh be sure to subscribe if you want to see what all this lava is doing in the overworld hope to see you guys when that video drops and I will catch you then bye You Video Information
This video, titled ‘How Dream codes Minecraft Challenges’, was uploaded by GLAK Jack on 2020-07-22 16:15:01. It has garnered 243846 views and 7774 likes. The duration of the video is 00:14:52 or 892 seconds.
How Minecraft But Challenges Are Coded
This is a walk-through on how some of the Minecraft but challenges on Dream’s channel are coded.
I run a Minecraft channel called GLAK Jack, where I do Minecraft challenges, and things like “Minecraft, but”. Subscribe to see those videos when they come out! (New videos every Wednesday and Saturday!) @dream #Minecraft #Coding #Challenge
Patreon (Plugins): https://www.patreon.com/GLAKJack
LINKS:
PART 2: https://youtu.be/L25QTF9RzKE
Spigot: https://getbukkit.org/download/spigot Eclipse: https://www.eclipse.org/downloads/packages/ (IDE for Java Developers) Java: https://java.com/en/download/
Spigot Docs: https://hub.spigotmc.org/javadocs/spigot/index.html In-depth Tutorial #1: https://www.youtube.com/watch?v=XaU8JKQW0Ao In-depth Tutorial #2: https://www.youtube.com/watch?v=OVom3tKrCv8 ======================================== ● SUBSCRIBE ► https://goo.gl/7U9gRq ● My Twitch ► https://bit.ly/3c3cOPe ● My Twitter ► https://bit.ly/3gxFnYn ● Razer Discounts ► https://razer.a9yw.net/54X72 ● Email (Business Only) ► [email protected] ======================================== ——————————–MY GEAR——————————– Keyboard: https://razer.a9yw.net/r5Akj Mouse: https://razer.a9yw.net/x10Vx Headset: https://razer.a9yw.net/kx7L0 Mat: https://razer.a9yw.net/emOd1 Laptop: https://razer.a9yw.net/A4qLK Gaming Chair: https://goo.gl/wJvZ7L ======================================== Outro Music: Otis McDonald – Not for Nothing