Jump to content

Custom Mob Element Throwing attacks


Xavier.Dev

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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 by Xavier.Dev
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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 by Xavier.Dev
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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 by Xavier.Dev
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.