Need help to find procedure that i need

Started by Sanyok on

Topic category: Help with MCreator software

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need help to find procedure that i need

I'm trying to make it so that when you press the right mouse button with a weapon in your hand, a leap forward is made, the mob is pushed off and damage is done, but I can't find a procedure that pushes the mob away

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You will need to manually…
Sat, 01/27/2024 - 17:59

You will need to manually override the velocity of the player and the mob, using the 'override motion delta' function, which is found in the entity actions tab. This sort of dash attack would look something like this:

  • Use the 'player right clicked with item' global trigger for the procedure, and use an if bracket to check if the item in the player's main hand is a weapon.
  • If it is, use the 'override motion delta' function to set the player's x velocity to the 'x-look-angle-vector' of the target entity, their z velocity to the 'z-look-angle-vector' of the target entity, and their y velocity to something like 0.3 or 0.4. The look angle vectors are kind of hard to explain, but essentially get the x/z components of the direction the player is currently looking at, and will thus launch them in the direction they're facing. (You will probably want to multiply each of the look angle vectors by how far you want to launch the player- by default, this will only move them one block forwards.)
  • Damaging entities while the player is moving forwards is a little more complicated... I'd recommend adding a custom player-lifetime number variable, (I'll call it 'dash,') and a procedure that decreases the player's 'dash' by one every update tick if it's above zero. Then, when the player dashes, set the dash variable to however long you want their damaging effect to last. (The variable will act as a timer, so you know when the player should be doing damage to things.)
  • Lastly, make another procedure which, on player update tick, checks that a living entity exists in a 1.3 block radius centered on the player's x/y/z position, (using an if bracket, and a 'does entity exist in radius' function, from the world data tab), and then use an entity iterator bracket, (from the 'world actions' tab), to target every entity in this radius. 
  • Within the entity iterator bracket,  if the entity iterator does not equal the target entity, (you don't want to damage the player), deal damage to the entity iterator, and do the same motion override thing you did before, but this time targeting the entity iterator instead of the event/target entity.

That's probably kinda confusing, but hopefully helpful?

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can we discuss this theme in…
Sat, 01/27/2024 - 23:47

Can we discuss this theme in discord please, but i dont speak english well. I really dont understand how to do this

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Or can you screenshot this…
Sun, 01/28/2024 - 00:03

Or can you screenshot this blocktheme please. I very excited about the idea of doing this.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There are more complicated…
Mon, 01/29/2024 - 23:17

There are more complicated ways to do this, but this is a simpler procedure that should sort of do the same thing. You can change the '4's to determine how far to launch things, and the '0.5's to determine how high. (You can also change the '6' to increase the radius of the attack.) The first part swings the player's hand and launches them forwards; the second part damages and launches all nearby entities forwards.

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
THANK YOU VERY MUCH, i tried…
Fri, 02/02/2024 - 23:20

THANK YOU VERY MUCH, i tried to do this already one week, really your help was so important for me, thanks one more time.