Knockback block break

Started by AcousticJamm on

Topic category: Help with modding (Java Edition)

Last seen on 18:27, 23. May 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Knockback block break

So one of my custom entities has attack knockback of 12. This was inspired by those anime moments where a character is knocked into a wall with force so great, it damages the wall. However, I don't know how I am going to be able to do this. What I want is the specific mob's knockback to break blocks. However, I don't want it to break really hard blocks like obsidian or bedrock. I'd say the limit is stones and ores. How can I do this?

Last seen on 16:18, 11. Feb 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I came up with a concept;…
Sat, 07/17/2021 - 14:30

I came up with a concept; Testing for the velocity of any entity with an X velocity of 10 or greater, if this is the case, then test for the block in front and break the block if the block is dirt (twice for both head and feet positions).
Is this what you had in mind?

Last seen on 06:21, 7. Apr 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Close, but not too close, I…
Sat, 07/17/2021 - 14:34

Close, but not too close, I made it explode and not explode obsidian and bedrock, and I didn't add "remove block" or "velocity". I don't know if you need that, but try it if you want to

Last seen on 16:18, 11. Feb 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
  One issue I see with…
Sat, 07/17/2021 - 15:02

  One issue I see with Professor Blue's procedure is when it is executed: Exploding when the entity is not encased in obsidian or bedrock whenever the entity takes damage. However, all blocks have already a variable that show how resistant they are to explosions, obsidian only vulnerable to Wither explosions and bedrock being invulnerable. So perhaps using an explosion is better than using whatever that Remove block code block is!

  In the end we will still need to test for the entities' velocity to filter out executing situations. (It would be neat to fall from 200 blocks up and land in a crater too, not only from attack knockback)

I have created another procedure with this, it works in all directions as well, but requires a lot of Get Block code blocks to make sure the entity is not exploding while flying through the air:

Last seen on 18:27, 23. May 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have created another…
Sat, 07/17/2021 - 15:47

I have created another procedure with this, it works in all directions as well, but requires a lot of Get Block code blocks to make sure the entity is not exploding while flying through the air:

Sounds good. Think you can make me the complete procedure?

Last seen on 16:18, 11. Feb 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I do not know how to share…
Sat, 07/17/2021 - 17:42

I do not know how to share files through MCreator forms, everything needed for the procedure should be in the photo already. All 10 Get Block code blocks had been compressed into that single block so the screen photo would be easier to take.

If Get block at x: x+1 y: y z: z OR
Get block at x: x-1 y: y z: z OR
Get block at x: x y: y z: z+1 OR
Get block at x: x y: y z: z-1 OR
Get block at x: x y: y-1 z: z OR
Get block at x: x y: y+2 z: z OR
Get block at x: x+1 y: y+1 z: z OR
Get block at x: x-1 y: y+1 z: z OR
Get block at x: x y: y+1 z: z+1 OR
Get block at x: x y: y+1 z: z-1