Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • When mob is attacking or colliding with a block
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Soulas97

When mob is attacking or colliding with a block

By Soulas97, June 17, 2014 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Soulas97    3

Soulas97

Soulas97    3

  • Stone Miner
  • Soulas97
  • Members
  • 3
  • 86 posts
Posted June 17, 2014

how to make that when, bull will charge at enemy and block will be in his way, he will just destroy it, and any other blocks in hi's way, except obsidian and bedrock

  • Quote

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Share this post


Link to post
Share on other sites

jabelar    593

jabelar

jabelar    593

  • Reality Controller
  • jabelar
  • Members
  • 593
  • 3266 posts
Posted June 17, 2014

This would cool but would be very difficult.  It is difficult because normally all entities use "path finding" to move between locations or to move towards and attack target.  So you'd have to first find a way to get the entity to "want" to move through the blocks.  Secondly, in addition to path finding, there are other methods that prevent an actual collision -- an entity simply can't move into most blocks so it can't really "collide" with a block.

 

I can think of a couple of approaches but I think they would be pretty difficult.  For example, you could replace the blocks between the entity and its target with some custom blocks that allow path finding to go through them, then as the entity went through them you could destroy them.

 

Another approach would be to take full control of the entity's movement when it was "angry" (i.e. had a non-null attack target) and have it go straight at the target and try to destroy the vanilla blocks just before the entity collides with them.

  • Quote

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Share this post


Link to post
Share on other sites

Soulas97    3

Soulas97

Soulas97    3

  • Stone Miner
  • Soulas97
  • Members
  • 3
  • 86 posts
Posted June 17, 2014

so how to make it, because i wanna to bull be a mob type that charges into enemy and if misses and hits a block destroys it, or when he charges block beneath him will be destroyed

  • Quote

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Share this post


Link to post
Share on other sites

Heltrato    1

Heltrato

Heltrato    1

  • Diamond Finder
  • Heltrato
  • Members
  • 1
  • 259 posts
Posted June 17, 2014

Done this before .

 

Method 1 .

 

Look at EntityAILeapAtTarget you can make your own AI and based it to it .

instead of adding motionY how about motionX only .

make a boolean that must be within range to execute.

 

Method 2. (My method)

 

Use PathEntitty + AAPool.expand thingy

  • Quote

Share this post


Link to post
Share on other sites

Soulas97    3

Soulas97

Soulas97    3

  • Stone Miner
  • Soulas97
  • Members
  • 3
  • 86 posts
Posted June 19, 2014

how to use that thingy ? im new :/

  • Quote

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Linky132
      [SOLVED] [1.16.5 ] Dust Block Texture Glitch

      By Linky132 · Posted 20 minutes ago

      I figured it out. I had the render type set to translucent, when what it should have been on was cutout. Thanks for the help.
    • Klarks
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks · Posted 45 minutes ago

      So what needs to be implemented? My Entity?  
    • Linky132
      (1.16.2) Making a new capability (3)

      By Linky132 · Posted 1 hour ago

      I could be wrong, but I think you might need to add this code in the constructor: FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); And you may need to change the setup method to non-static.
    • Linky132
      [SOLVED] [1.16.5 ] Dust Block Texture Glitch

      By Linky132 · Posted 1 hour ago

      Also, the texture doesn't glitch when the dust is in a straight line, or when it's in its dot form (not the '+' shape).
    • Linky132
      [SOLVED] [1.16.5 ] Dust Block Texture Glitch

      By Linky132 · Posted 1 hour ago

      Unfortunately, that didn't work, it still glitches. Any other ideas?
  • Topics

    • Linky132
      4
      [SOLVED] [1.16.5 ] Dust Block Texture Glitch

      By Linky132
      Started 18 hours ago

    • Klarks
      12
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started 18 hours ago

    • e2rifia
      13
      (1.16.2) Making a new capability (3)

      By e2rifia
      Started 6 hours ago

    • Somonestolemyusername
      18
      [1.15.2] How Would I make a custom bow?

      By Somonestolemyusername
      Started Tuesday at 11:30 PM

    • Edrax
      0
      Creating custom atlas?

      By Edrax
      Started 2 hours ago

  • Who's Online (See full list)

    • Klarks
    • Linky132
    • Sensenmann
    • JoB76205
    • StealthyNoodle
    • Danebi
    • st4s1k
    • TheidenHD
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • When mob is attacking or colliding with a block
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community