This is going to be one of the most advanced videos that I ever put out on this YouTube channel took me a couple of days to make we are going to be integrating chat gp4 in Minecraft that’s right and I don’t I’m not saying just the chat feature I’m actually going to Show you how to make it work so that you can have a fully functional trading system not just chatting actually getting the items to you and taking items from your inventory so let me give you a quick example I’ve spawned a pirate we can see we have a pirate ship And then it says AO mate how can this old Sea Dog be of service to you today how about we trade I have gold and sometimes it waste Waits a bit it has to connect to a server it can even have for treasure maps interesting um how about You give me some emeralds and you can see that it’s actually pretty smart and you know it’ll stay on the topic it’ll stay in the role because this one actually defined the role to be a fisherman it doesn’t have emeralds anyways I would like cooked salmon now Is that a actually material name I think it’s called cooked caught how many for two Golds let me actually try to push him a little bit higher how about you give 24 it’s actually pretty smart you can negotiate something out of it and if you Try to push it too high it can actually reject oh 24 okay he actually did not reject it how about doing something ridiculous 64 let’s see how far we can push him and you can of course Define you know the hardness the best I can do is 24 okay And when you accept the deal it’ll actually give you a choice there we go to trade two gold ingots for 24 cooked card type agree I’m going to do it and now it’s obviously pretty smart I don’t have enough gold in my inventory so I have to give myself one more piece let Me actually give myself three so you can see demo type it agree again there we go and I’ve taken the gold and I have cooked C the trade was finished just a quick note the back end of open API uses something called credits or simply measures your usage it is extremely Cheap but it’s not free what you can do what I recommend you do you simply purchased five credits it’s extremely cheap and you should be able to experiment all day long because I think one call costs something between like three cents to the cha pt4 and if you go With cha pt3 then the price is even less so you know don’t get discouraged don’t be like well it’s a free YouTube video and I have to pay don’t worry I think five bucks if you want to invest into it it’s going to yield you probably days of experimenting with this beautiful thing So I guess that I should start by introducing you to the back end of Chad GPT I assume that you are already familiar with the front end that is if you go to chat. open.com right this is the main interface everybody knows about however they have also a developer Backend which is called platform. open.com you can use your your main CH GPT account to log in and this is something that we’re going to be actually using so this one works I guess similarly to the front end but it provides you with more options and there’s also an extensive developer Documentation which you can learn about uh right here and by the way I recommend checking out this opening keynote it’s pretty fantastic it’s pretty I guess scary what they are capable of doing now anyways I’m going to go to playground and I’m going to select chat we’re going To be using the Chad GPT 4 um 1106 which is the I believe turbo version the preview version and we’re just going to be tweaking these parameters a little bit and then we’re going to be uh basically basically just setting a context so you are a Trader pirate fisherman in Minecraft something like That and then the user will be hi and if I say submit then the assistant will you know start to say things similarly to what you’ve seen here so we’re going to be taking this using a library and and hooking it up with uh Minecraft what’s Also great is that you can ask it to return your your message as a Json right and then if I type in what do you trade it should return you see Json with a bunch of I guess default data which is really amazing because we can literally Program this to return I’ll say chat types so what is a chat type it’s just something that I came up with basically here aoy R Emerald right these are all uh just messages however here the offer is an offer type so you can basically tell it to switch from just chatting With you to offering you these items now guys if I’m going too fast please note that you know this is not a beginner necessarily tutorial because this is one of as I said the most advanced videos that I ever put out uh there is more Stuff that I will show you in the course project Orient that is also for beginners and also I I have over 40 lessons on Minecraft plugin development on this channel and I highly suggest you went through at least 5 to 10 First videos uh before you dive into this one However I’ll try to keep it as simple as possible and I’ll try to reference uh my other free videos to help you with your coding Journey great so that is the interface now in Minecraft what we’re going to do we’re going to have to open Up our P XML file that is if if you’re using Maven and don’t worry if this is you know too much you don’t have this just watch my first I believe first and second video so if you go to my YouTube and then you open up the playlist called Micra pling development you’ll see down at the bottom I have episode one and episode 2 so make sure you definitely need to watch these two and you also definitely going to want to need the episode 17 about libraries and apis these are completely free videos so Please go ahead and watch them right now because I’ll just assume that you have that knowledge so inside the P file we’re going to be having to add the chat GPT Java library and if you Google open AI Java SDK I believe then the theoc canning is the one that we’re going to Be having to use this is quite easy so when it comes to importing this this is actually hosted on the main Maven repository so you should not be needing to add anything anything great here I guess that only the sonot type I guess you can try without it if it doesn’t Work then add this repass three by the way I’ll post my full source code uh down below so you can click the blog post and inside my blog post you’ll be able to download the source code so you don’t have to type letter by letter obviously I don’t want you to waste your Time is the first thing then the other thing is you need to copy the dependency right here and then simply install it just like this one now make sure to keep the group ID to whatever it they have the artifact ID you need to put in service because we’re going to be using Uh the version of Library dealing with a service right they have API client and service so make sure to use that version is going to be whatever is the latest one so to find the latest one I think you you can either go to releases and then update to version 082 or here here’s a little trick so typically you can just copy the title from GitHub just like this one and then add space base mvn and Google this this is going to point out to the main Maven reposty link as I explained a couple of Minutes ago right here and then you can see the service package right here has 1.18 actually 2 let me see yeah that’s the same that I have so you can either go with this and if you open this up you can actually just copy the whole dependency with the version right here So it’s a little bit easier also make sure to have the scope set to provider because we’re going to be um not wanting to ship this if you have multiple plugins all having this library inside their jar this can lead to you know import conflict and there is a way to Bypass that but since spigot provides us a way to Lo load third party libraries when starting their server we’re just going to be using their featur so set the scope to provide it open up the plug-in. yml and then right here the libraries right here I think that I Teach this in the libraries video you essentially just want to create the path for speak to download the same Library into your libraryies folder when you start the server great now when it comes to the actual implementation there isn’t much thing to it and I’m going to be Showing you how to add a simple Command right here how to add a simple listener when the player is chatting and then we’re going to be storing a list of conversing players with the history of what I have said uh because unfortunately the way it works is that You have to upload the entire conversation history which with each message is is going to get bigger and bigger to the open API for it to get the context get the history of it so we’re going to be using a custom class called conversation to store the data in it’s Not that difficult I already made a AI Command right here I don’t I’m not going to show you how to make commands in this video cuz I already have a free video on making commands you can check it out on that Minecraft playing tutorial series on this tutorial series that you’re Watching so basically what this command does verifies that we are a player it’s going to get the player and then it’s going to verify that we’re typing in Ai and then the name and then the role so the name is whatever shows over the head Peter Plank and then the role is Whatever role we are supposed to be playing with this MPC because chagi PT can act you know differently as you noticed I was trying to get emeralds however this is a fisherman that doesn’t have emeralds so you can have different rols for different NPCs and obviously This is just a you know a thing of creativity so I do enage you to be creative with this and you don’t have to necessarily have roles but you can have any properties that you want to feed the Char BT in so I have you know this Simple thing right here and then I simply extract these two arguments and then what I do I simply spawn a skeleton by going into the player’s World spawning it at the exact location and also where I’m looking exactly so if I type in Ai and say test MPC that’s going To be a I don’t know prisoner there we go if you can see that it’s being spawned and it’s it’s going to be looking at the exact same position and also I’ll explain what this is in a second so that’s the first thing also make sure to disable gravity disable AI So that the NPC doesn’t move and doesn’t chase you doesn’t try to kill you if it’s a hostile skeleton you can also set it to invulnerable so that you can’t kill it and then you can set the custom name uh visible and then set a custom Name over the MPC head like this one by calling this in I believe couple of videos back I’ve made the colorized method right here so you can just check the source code this is very simple this will convert you know these characters into things like this but also supports Hex and RGB colors which is very cool and I simply give credits to the original um spigot pull request for the genus guy that coded it this video I don’t think that I’m using any other common method we’ll see we’ll see that in a moment so next thing I’m adding I’m Getting the equipment and I’m sending the helmet for whatever I’m holding in my hand because if you go to a site like minecraft-heads.com and you look for any head that you like then you can literally just give yourself this item so I can just copy this whole thing and Then I can open up the server console give myself this I don’t think that you’re able to post this command in the chat because it’s way too long but anyways I can get a helmet that looks like this it says pirate school and then I simply set it such that it’s going to Be used it’s going to be placed automatically on the MPC making it look pretty uh Dam cool so that’s just a little bonus that I’m going to throw on you right there also I I have to mark the NPC with its name and with its role using persistent data container again I Do have a separate video on how that works in short we’re simply going to be sending invisible tack for the MPC that is not deleted when the server restarts or stops because if I were to do set metadata then this metadata actually gets deleted when I stop or reload the Server the keys excuse me the keys right here I don’t have so I just have to paste them right here and again I’ve explained this in a separate video uh which is for free on YouTube which you can watch if you need to rehearse how that works and looks like I’ve added Something to the common class well basically I just added the tell method that works with a player and it’s simply a shortcut to be able to send player you know hex colored messages so I’m going to open up the spigot class if by the way I do have another free video here on The adventure API if you want to use Adventure instead please go ahead and watch that instead but here I’ll just I’ll just keep it as easy as possible using spiger I also made all the action Bar Method right here so I’m just going to use spigot again send message and Then type in chat message type action bar and then do just the same there we go so this one should be working now don’t forget as always and I see people forget this so much go to your main plug-in class register this command beautiful as well as go to your plugin. Yml and then register the AI Command right here there we go name roll just like this one next up let’s imp a listener again I do have a free video on how game events and listeners work so go ahead and watch the that one if you if you’re not sure what implements listener Means so this one is a simple listener make sure to register it in the UN enable method and here we have to listen for a bunch of stuff so I’m not going to bother you you know with typing letter by letter I think it’s stupid if somebody does that on YouTube and you Have to suffer through 5 minutes of them typing basically we’re going to be listening when I’m typing in the chat hello and then if I am having a conversation with an NPC then this chat will be taken away cancelled and handled in the NPC chat when I’m right clicking An NPC then we can actually start chatting with it so that’s why I have to listen to when I click something or somebody when I’m quitting I’m going to be automatically stopping the player conversation and then you’ll notice that the skeleton actually doesn’t burn in The sun this is just a fun bonus feature that I decided to add for you guys basically listening to entity combust event and if my skeleton has the NPC name tag uh and I don’t know if you can use get or maybe you can just Use has yeah I think this code is going to be even simpler now there we go so we can just check if we have the custom tag if yes cancel the event next up let’s make the conversation object basically we’re going to be storing a bunch of data as I Explained earlier in the custom class called conversation the data being player the player that is conversing the MPC being Minecraft Entity very simple then we have the role of the entity and then we have the actual conversation right here which I don’t know you can Just use a string Builder to make it as easy or you can use list but string Builder is even easier and whatever this is going to do is simply going to hold this entire conversation so this one is going to be high then it’s going to be This two then it’s going to be this three so it’s going to go like this right it’ll just expand expand expand with the conversation and as you guessed it going back to the listener we have to store a players that have an active convers conversation suver be sure to Open and import this class from the package inside your plugin not from bucket also import the maps right here there we go now when it comes to coding standards I would typically suggest against having data inside your listeners to split your plug-in logic however this is just the demon video so You know if you’re not making a a world’s greatest plugin and you just follow YouTube tutorials then this is might happen more often than you think I’m just going to put a warning here that typically as a you know high level developer this is something that I try To teach in my courses you should split your coding logic and you should have a listener just listening you should have the model the conversation in the model package just uh performing you know logic related to the convers and then you should probably have a third class called say player database Or conversation manager and inside that third class you can just keep this or what I also suggest as like Plan B maybe you can just copy this and then paste it inside the conversation right here and then you make it static and you simply add the management method uh such as add And remove uh and you have everything nice nicely inside a conversation class cool so let’s begin implementing what I’m going to do I’m going to start implementing when I’m chatting so I’m going to get the player and I’m trying to get the conversation object uh by my Unique ID and I’m also going to get the player message so if the conversation is not known that means that I’m conversing I’m speaking with an MPC first of all I just cancel the event so that others will not see uh will not see this right Here on the server then if my message has more than one letter you can see that I typed this letter with a small case this is just a small convenience guys I’m going to uppercase the first letter of the message and then keep the Rest as it is and then I’ll open up the conversation model there’s going to be a method called on talk which if it returns false that means that the conversation should stop so I’ll simply stop chatting by removing the player however if this returns true that means That um you know we can keep chatting and I simply tell the player you right and we’re going to be seeing our own output and then the MPC in the meanwhile is going to think of its next answer when it comes to implementing the right click enery I don’t think it’s Particularly anything special right here I’m just going to check if the ener no perhaps this is not needed on the latest Minecraft release right so I don’t have to and then here if we don’t have the key yeah I can also improve that sometimes when I’m coding behind the Scenes I just make the code even longer so this is the same as we did right here right if the right click enery is not an NPC I don’t care also this event is actually fired twice if I’m right clicking this one once fired for the Right hand one’s for the left hand and I don’t care about the left hand so I’m just going to listen for the main hand not the off hand which is the left hand then I’m going to get the player I’m going to check if we are already Conversing right and say Hey you are already speaking with an NPC type exit or type stop to stop I believe that I set it to stop yeah there we go you stopped talking to the prisoner great and then we’re going to be starting the new conversation for the player and the Right click MPC there we go and you can see that the roll I get automatically from the MPC perhaps as a coding standard okay I get it guys there’s going to be a bunch of comments about coding standards maybe it’s better not to have an additional logic there so Maybe the string roll could be just um received from the right clicked just like this one and since we’re already using the right click many times just like that then let’s just do this entity rooll there we go and then there is going to be a method called conversation Start and then at the end or maybe even before conversation starts I can save this and I can place the conversation inside the conversing players great and then finally what happens happens when I stop the game Sorry when I disconnect I’ll simply try to remove myself and This one will work this will not throw any errors even if I am not conversing because this will fail gracefully great so coming back to the conversation I have to connect to the open AI service and you can import this uh from well I can’t import this this is Weird if you’re having the same issue then go to your P file and then there’s supposed to be an icon saying load maving changes and sometimes intellig doesn’t do that automatically so you might need to click it there we go you don’t have to enable any suggestion Plugins I don’t care about them if you can’t see the icon right click the P file go to Maven and hit reload project right here and then inside the conversation there we go now you should be able to import it from the com package I even have my intellig to Auto Automatically do it uh you can find this option somewhere in import section of your settings but it’s not really that important now first thing when you’re creating a new instance of it is putting the open AI key so you can find it inside API keys right here and I suggest You just make a new secret key give it a nice name and then basically make sure to copy this entire thing s k and then just paste it right here the second argument is going to be the duration and I just suggest you put in a zero there Or maybe you can put in I don’t know 10 that means how the longest time that we’re going to waste wait for the response however I think that it’s going to throw an error if you know we go over time so you’re going to have to have More error handling there cuz in my testing code I just don’t care about it so I just set it to zero but maybe it’s a good practice to have it to something reasonable such as 8 seconds so that players don’t wait forever and they think that the NPC is still thinking When in reality you know open a is down or servers are overloaded by way too many people making mine care planes like that all right let’s go back and let’s implement the rest of this conversation class this is where the magic happens we’re going to start with the start Method then there is going to be the on talk method which you’ve seen in the listener also I needed to have a custom has enough items method they will simply check if I have uh whatever we agree to trade with in the inventory this has nothing to do with AI it’s just bucket Logic and then clear trade metadata that means that um when they are switching from just chatting to about to be offered a trade player is going to have this metadata inserted onto him so that we can differentiate the action and then there’s the process Q method which is I Guess the most interesting to all of you guys which will connect to the API itself so when it comes to the starting right here what I decided to do I decided to start the conversation with this prompt now it’s super long prompt I’m not going to read it for you but This is something that I just came out with it also reports replacing the roll with this roll right here and you should just ignore intelligent complaining this indeed will work because I have the roll uh right here so what I’m going to do I’m just going to pause the video you Can either read it for yourself maybe the prompt is not perfect I’m not I’m not a native English speaker but I try to basically make it return a Json thing a Json uh respawns and the Json respawns is going to contain the message type and then if the message type switches to I Guess trade where is that it’ll contain additional information with the actual trade trying to use valid bucket M material names for spood and I know that chpt has cut off around 1.17 I know that Char bt4 turbo is updated up to like April this year but I still feel more Confident just putting 1.17 in there that’s the first thing then I’m going to be starting to process the q and as you can see when I’m interacting with the Villager it says starting in the action bar so this is the action bar message in the process queue that I’ll be Implementing so we already have the common action by action Bar Method I can just call it as a demo and then what I have to do I have to call the entire connection asynchronously otherwise it can really lock your server as you’ve seen in the intro of this video Sometimes it takes up to like 5 Seconds just to get a respond so what I’m going to do I’m going to have a new bucket enabl right here as a new Anonymous class and then I’m going to run it asynchronously using the main plugin as An instance and I do have a video on how to understand these tasks so please go ahead and watch that if you struggle with them and we can also just print out the entire conversation so far so that you’ll be able to see what’s going on in The Cel really nicely and you can yeah you don’t even have to call to strength here okay are you ready for the magic line there it is so we’re going to be having to make a new chat completion request and you’ll be very surprised how good this library is it is extremely Simple actually it’s way easier than a couple of apis in paper itself sorry paper but the way we’re going to do this is by making a chat completion request Builder and then we’re simply going to be putting things here the exactly same way as we’re putting inside here so the M model right here we’re going to you can go show more models and you can just copy this so the model is right here let me actually just order this easy easy there we go and then Max tokens is going to be the maximum length of the message And this can go up to 4,000 which is really nice so we can just copy this too then the temperature this will simply mean how random and how varied these responses are and if if you hover your mouse upon any of these you’ll see um an explanation for every single one of them So I don’t really have to spend too much time you can just hover over this and you can also just Google examples on how these properties work there we go so I guess that the only thing left unexplained is the stop right here and yeah the stop sequence is here so you Can you can also Google this they have create article and how that works basically we’re going to have the messages being uploaded to API look like this one so human my message and then API like this and then the AI is supposed to finish this right so the stab right here is Going to look for human and AI so that the AI is automatically going to stop uh providing more response when we feed it more data it’s going to basically prevent it from I don’t know spinning itself infinitely or raise condition and you can of course try what happens Without it I honestly haven’t noticed it going crazy but I noticed uh giving it more consistent result when I had this here and again you can just Google what that means more uh this video is more more so about micro plugin development than me explaining AI I’m not an AI Guru And uh yeah this is still a new topic to me to be honest just as for everybody else great and final thing we have messages this is going to take an an array of two exactly two messages so you can just make a new message type first One being the system which is this right here and this one you are a pirate role in Minecraft right you can just tell it the context however I already explained the context in the conversation conversation starter and I found the a AI to take this extremely well so we Don’t really have to be lengthy in here we can just keep it nice and short and then the user is finally going to be you know the entire conversation that we’re having now getting the response is a little bit more tricky this is going to Return a list so you have to call the open AI service maybe I can rename it to openi service make more sense create chat completion we’re going to be putting the chat completion request which basically holds just parameters and then we can see what we can get so We can get you know the choices um and this will return what the API has returned yeah and I mean my AI is very smart actually tell if the choices are empty the AI failed to respawn I mean sure I can keep that code in there that was very unexpected And then we can basically get the first choice just like this and then we can get the message inside the response which is simply chat message and then we have to get the context of the chat message bit complicated and the context and the context is supposed to Be what the AI has said earlier so this is going to be I don’t know you can’t see it here but you’ll see in a minute and then basically the context is going to be the Json respond so we have to you know trim it delete the trailing and Leading white space from it and then I can simply split it line uh by line because I noticed that you know this will actually return the first line like this and the second and the last line like that which basically means markdown if you’re using the front end CH GPT That is used to format your respawns however now we have to actually get rid of it to parse the proper Json response so to do that I’m simply going to do an array copy and I’m going to basically just clean it um converting basically this array into a new array that is you Know two lines shorter and we’re basically just going to be copying from the not zero index but from the first index and then we’re going to be cutting off the last line as well so that’s how you get rid of the first and the last Line and then what I can do I can just use a new Json library that by default spigot includes and this helps us to parse uh the Json so you can call new Json or you know what guys maybe yeah for the coding standards I can just have This as a private final static Json field and then I can call from Json right here and then I can simply join the string using you know new line delimiter uh for the library to understand and then I’ll simply parse it into a map so this one is going to Return a hash map with the key status set to success message saying I’m doing great blah blah blah so then we can simply get the answer and get the answer to string because you know this can be actually a double as well when it comes to the trade amount and we can also Return the type that means that which you know conversation type or regime VR currently dealing with and then we can simply append the answer to the entire conversation stream as well as tell the answer to the player yeah just like this one so the test is the name of the NPC And then this is his answer and then this conversation right here is going to basically append it to after the AI so it’s going to look like something like this one now you’ve noticed that I’ve asked Chad GP to change the type the response type uh from I believe Chad and Then when we agree on the trade items then it’s going to set the type to trade so we can check whichever are at currently and if the conversation has switched from you know simply going back and forth to actually having agreed on the trade that means that the type is Equal to trade then we can also return the player item player amount and then MPC item and NPC amount maybe I can just do this for Simplicity and then yeah you have to do a little bit of a handstand to convert that into an integer because unfortunately this will then return a Double for for amounts which is unsupported in Minecraft as you know you can’t really get 1.5 items you can only get one up to 64 items right so we have to convert it into an integer and then get these data from the map as instructed um in the initial prompt and Then I can open up ver U from aash and I can simply just make it look nice basically the material is going to look like I don’t know raw fish and then here I am simply replacing the underscore and then this will also capitalize fully so this will convert this into this so It’s going to look nicely in the chat just something to throw out there just to give you guys more value and then I’ll simply tell the player hey there’s a trade to offer to trade this and your item your item amount your item name for whatever MPC offers and you can either Type in agree or stop or you can simply keep negotiating how beautiful is that and then you know we can listen um to whatever the player types in however we have to sort of store the trade data suver and I think that the easiest and The best way to do so is just to use buckets temporary method dat because they let us store the entire hashmap with all of these objects uh directly which is really really beautiful and this one of course gets disabled removed when I disconnect from the game but you Know when I disconnect from the game then the conversation is discarded so no worries about that cool so now you know we basically got to the point where the trade is offered so what happens if I type in agree now well it’s going to be registered in the on chat message right And it’s going to be basically processed in the on talk method right here so before we implement this we just have to make sure that the MPC actually is close to the player if we moved away you know more than 10 blocks I’ll just return false that means that the conversation is done Just to make it more realistic right and then I can just clear the trade metadata which I can Implement right now this will basically just make sure that the player doesn’t have an open trait uh when the conversation is done excuse me I’m right here also when I say stop in The chat or when I say exit it’ll simply end the conversation like this one and then we will append uh whatever we typed in and then we we’ll basically just append the AI at the end so that the AI has a chance to respond and then we’ll simply process The que taking the entire conversation right here and putting it back to the AI so this is the basic implementation of basically you chatting back and forth however here what we can do we can simply check if the player has metadata n PC trade so if we already agreed on The trade then this should work and then I simply want to you know stop the conversation and simply perform the trade right here now however we have have to listen if I type in agree and only then we can actually end the trade so if message equals to agree right if I Type in something else you’ll notice that will simply keep chatting which is really natural however here if I type in agree then I’ll just get um the trade map I can get it right here actually there we go and then I can get basically the same data as we were storing down Here and all of them can be final except for the player amount which I’ll explain in a second and then we have to check if the player has enough items right if we don’t have enough of the item of the given amount I’ll simply say hey you Don’t have enough I don’t know uh Diamond to sell five of them for example and let’s Implement has enough items this method is very easy just literally deals with the inventory handling so it iterates through all the slots in the inventory counts if we find the same Material type and then it it’ll simply return if this whatever we have in the inventory total is greater or equal how we how much we need right I’m not going to spend too much time explaining basic bucket API in this API in this AI video also one method that I forgot to Implement simply has free space that means that we have enough you know free space in the inventory to receive this item of this much and if we simply don’t have free space it’ll simply say you don’t have enough space to buy uh I don’t know five diamonds and then what We can do we can just take the items I actually used AI to help me generate this method so you can ask it to do the same uh this will simply iterate through the inventory it’ll simply decrease uh the amount of items that we’re supposed to give away and will simply decrease it By whatever how much we need to decrease and this is a smart method because say that I’m buying for two Golds and I have you know 1 2 three so this will take one gold here second gold here and it’ll stop so it’s very intelligent then once We’ve taken the items that we’re selling I’m going to be adding to the player uh the items that he is buying so this one is actually very simple because bucket handles that automatically then I’ll simply clear the trade metadata and then I simply say you agreed to the trade uh The NPC will now give you this much this much for this much this much of yours and the trade was finished okay guys here we go back in the game again so I’m testing this plugin I spawned an MPC uh by the way make sure to change your open A key you know replace my test key for this to work and also be sure to only have one Verge right here so you can’t do something like Peter Pan fisherman because you know the command only works with the first argument and the second argument maybe if you are Advanced maybe You can Google how to implement the quotes right here so that you know when you have quotes it’s going to let you put multiple words but you know for this quick quick one hour demo uh this is enough and we have the Peter and I right Click the Peter and it sayso there mate what can this old Sea Dog do for you today and then here the debug uh the cons line says the entire conversation so far so it says the following blah blah blah human we say hello so it says It for us as instructed right here and then the AI is basically tempted to oops respawn and let’s just say hey and okay this is strange this event is not canceled and I believe the reason is is that we have the chat listener in a different class and this chat listener Is made in a different video of mine that I did earlier on this YouTube channel and this is simply messing with it so uh the way to add compatibility is you either implement this at the very bottom right here or you simply have different event priority which I have That event video about one of the earliest videos that I made for this tutorial series however here I’ll just knock it off and we can keep going so I said hello and you can see right here this will then say the entire conversation again the old message and Then the new message want to trade gold I can say I have gold can I buy tropical fish and you’ll notice that these messages are different every single time that’s why it’s so immersive and so powerful to have that inside your Minecraft so can I have five fish for One gold for example and of course you can you know edit the prompt to say the pirate is not open to negotiation or something like that you can of course experiment with it and be smart be creative and uh you I think you’ll be very surprise what it can do so three Pieces of gold okay I agree to this and now it’s going to say the offer is to trade three gold ingots for five tropical fish bucket let me actually test if I don’t have enough say agree you don’t have enough gold in good to Sell three of them so I have to have at least um one 2 three like this one however it did not take it there’s a small issue so make sure to change the has free space return free space is greater or equal than the uh amount and Now if I type in agree there we go if it take it taken three and it gave me five buckets of tropical fish how amazing is that we have a lovely fish right here and you’ll notice that now you know I can say thanks but it doesn’t register because we automatically finished so Maybe the next level is to keep going the kind conversation so that you can stack your trades but I leave that up to you guys I hope that you en enjoyed this video if you want to go even deeper into Minecraft plugin development coding very advanced stuff connecting with you know The outer World check out project Orient it is a full 7we program we work with jet brains I am now a YouTube Partner you’re going to get certificates of completion there is life coaching and best of all you get lifetime access to it and the videos there are just so much Longer and so much much more deep deeper because I have more space to explain and of course if you get stuck you can join our live Co live coaching call and you can share your code live that that happens twice a week and I can just help You very very quickly so again I’ll leave the link to the program in the video description it contains a lot of stuff when it comes to like libraries and working with Advanced topics such as menus Advanced commands Advanced this Advanced that right you can basically basically see the full curriculum it’s a 7v course including mini games and how to build Sky Block egg Wars and stuff stuff like that uh and the full curriculum is available if you click the link in the description again I hope that you enjoy this video it took me way long time to build so I would appreciate If you at least give it a nice thumbs up comment below and sub to the channel if you haven’t already and I can’t wait to see you guys next time Video Information
This video, titled ‘Ep47. ChatGPT-4 Turbo In Minecraft (Advanced Full Guide)’, was uploaded by Matej on 2023-12-16 17:00:11. It has garnered 605 views and 30 likes. The duration of the video is 00:42:58 or 2578 seconds.
Is this the new Minecraft revolution? I will show you how to create a FULLY FUNCTIONAL ChatGPT-4 bot in Minecraft acting as a villager trader.
In this video, we’ll cover:
– ChatGPT-4 Turbo and Minecraft — I’ll show you how to make NOT only chatting bot; we will be making a complete trading system with negotiation and inventory handling (i.e. giving/taking items).
== COURSES == Minecraft Plugin Development: https://mineacademy.org/project-orion?st=yt&sc=tut_ep47 Forge Modding: https://mineacademy.org/forge-mastery?st=yt&sc=tut_ep47
== RESOURCES == Blog post: https://mineacademy.org/tutorial-47/?st=yt&sc=tut_ep47
Music: Pacific Hike – Silent Partner
#coding #code #tutorial #money #developer #java #minecraft #minecraftplugin #bukkit #spigot #spigotmc #paper #paperspigot #programming