Throwing an item, returning it back to the thrower.

Started by Pexuls on Sat, 10/01/2022 - 01:15

Topic category: Help with modding (Java Edition)

Last seen on 15:12, 3. Dec 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Throwing an item, returning it back to the thrower.
Sat, 10/01/2022 - 01:15

So, I wanna make a weapon kinda similar to a boomerang. You can click a keybind to throw it, it kinda makes a spinning animation, goes forward, stops, and then comes back. Kinda like Darth Vader's lightsaber throwing scene. Not sure really how to make that in MCreator, or if its even possible without the use of coding, but that'd be great to know how to use. If anyone has any ideas, comment them here!

Last seen on 23:55, 2. Dec 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can override motion…
Thu, 10/06/2022 - 01:42

You can override motion vectors of projectiles.(immediate source entities) my suggestion is to make the weapon fire a projectile that has the same model as your weapon, shrink your itemstack when you right click it so it leaves your inventory, then have a motion vector pull the projectile back, and when it gets close to you, make a entity iterator procedure that despawns the immediate source entity and adds the weapon item back to your mainhand. hehe sounds complicated, it would probably take me an hour or so to do it.

Last seen on 23:55, 2. Dec 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
also, you can make…
Thu, 10/06/2022 - 01:43

also, you can make projectiles spin when you add the model.

Last seen on 15:12, 3. Dec 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
do you know how i could keep…
Thu, 10/06/2022 - 13:36

do you know how i could keep the NBT data (etc: enchantments/name) of the tool thats being thrown, along with how to make the item go forward and back, what blocks should I use for the motion vector. Direction of the player's head?

 

 

 

 

 

 

 

Last seen on 23:55, 2. Dec 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
For the motion vector,…
Fri, 10/07/2022 - 03:12

For the motion vector, simply firing the projectile would make it go forward, to make it come back would be the hard part. You could use the instance where "when projectile hits mob entity" and make it fire a projectile back at you somehow. And if it doesn't hit a mob, you would need to use the "while projectile is flying tick" to set it to override motion vector after a set time in ticks has passed. The motion vector procedures are complicated. There's info out there that uses cos and darn I forget the other one, to launch things in the direction you are looking. Research alot lol. As for keeping NBT, I'm afraid I haven't used that before... Sorry I can't be more help right now, I would need to put alot of effort into this and I don't have the time.

Last seen on 15:12, 3. Dec 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Its fine, im not really good…
Fri, 10/07/2022 - 13:41

Its fine, im not really good at either, but thanks for the help!

Ill play around with procedures and make a motion vector that goes maybe in the negative direction of the way the player is looking.

If I find anytihng out, I'll post the finished version of the procedures here.

Last seen on 23:55, 2. Dec 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oh, also, motion vectors act…
Fri, 10/07/2022 - 15:36

Oh, also, motion vectors act funny in multiplayer. Some don't execute the procedures. They will work for the host of the world but not for server players for some reason. I'm having troubles figuring out how to fix that in my mod. Just a warning. They're great for singleplayer but not multiplayer