Posted August 7, 20223 yr Hi everyone, I want to ask that "How can i make my mob to throw fire , or other elements on it's enemies" I prepared my mob and started animating it. I done all the preparations but i want to make my mob throw a custom item that i designed and fire on players. So,I want to ask that i will animate it throwing my custom items and fire but how can i implement the code or what i have to write in my code for making it throw that particular item on other players in-game and what damage it will give and in what range it can attack.
August 7, 20223 yr Look at what the Ghast does. In particular GhastShootFireballGoal. For the actual projectile, look at LargeFireball. You can look at other Mobs/Projectiles for different ways to implement this. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
August 7, 20223 yr Author @warjort Ya , I know that we can take clue from ghast for fireball or other elements but i am also asking that in the animation period , I also have to add fireball throwing animation etc. And How can i use it for implementing other things like Calling lightning , etc. Edited August 7, 20223 yr by Xavier.Dev
August 7, 20223 yr LightningBolts are just another entity you can spawn. The Ghast drawing is done in GhastRenderer, but that is just a simple texture change based on whether the Ghast is "charging" an attack. Its only animation is its tentacles - see GhastModel. 🙂 The animation stuff is not something I know a lot about. But it involves adjusting the model parameters based on state in the Entity (e.g. whether it is attacking) and includes a "timer" of how far through the entity is within the animation. e.g. see HumanoidModel.setupAnim() or HumanoidModel.setupAttackAnimation() You should look at one of the entities that does attack animations like the Skeleton(Renderer/Model) Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
August 8, 20223 yr Author @warjort Thanks for your tip and i am clearly understanding it. Just one more question,That the "minecraft:shooter" term That is used in Ghast ,Blaze ,Pillager when I looked in their code and the documentation provided by Microsoft. Is that the main and we have to define there what item will be shooted or the mob will shoot. Edited August 8, 20223 yr by Xavier.Dev
August 8, 20223 yr minecraft:shooter is bedrock not java: https://docs.microsoft.com/en-us/minecraft/creator/reference/content/itemreference/examples/itemcomponents/minecraft_shooter For java you create and spawn an entity. Search for addFreshEntity in GhastShootFireballGoal. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
August 8, 20223 yr Author @warjort On the whole search box in Google and YT. I am getting how to reflect the fire ball in game but in one website it says to write this code in your .json file but i think this is also for in-game minecraft CODE - • /summon minecraft:fireball ~ ~ ~ {ExplosionPower:25,direction:[0.0,0.0,0.0]} Can you tell if this code will work or not because there is also written write in your code + in-game also when summoning entity Edited August 8, 20223 yr by Xavier.Dev
August 8, 20223 yr The way to do it is the way I said. What you call "code" is a command a player with cheats enabled can type into the chat window. It does something similar. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
August 8, 20223 yr Author @warjort Yes , I was saying that | It is not a code ,it is a command of in - game chat.(THE WEBSITE SAID THAT TO WRITE IN CODE ) Ok,Now i will do as you said
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.