Gravity-less Projectiles

Started by IsabelleTheStoop on

Topic category: Help with modding (Java Edition)

Last seen on 10:28, 14. Mar 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Gravity-less Projectiles

So I've ran around, looking at past forums on this subject, but none of them could get the projectiles to function correctly.

I've done my research and figured out that I need to use the NBT tag "NoGravity" to disable the gravity on the entity. 
When I did this, it worked. The bullets no longer had gravity and zoomed through the air. However, there was one other problem: Every other entity also had no gravity.

I can't figure out how to fix this while still keeping the bullets gravity-less. Any help?

Here's the code that is triggered during "While projectile flying tick":

when (global trigger): Entity Spawns
Execute command / "data merge entity @s {NoGravity: 1b}" in the name of Event/target entity

Last seen on 12:54, 1. Nov 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just do if is NBT(Your…
Thu, 02/24/2022 - 18:11

Just do if is NBT(Your proyectile) do the command
 

Last seen on 03:52, 28. Jul 2023
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So from what I understand is…
Fri, 02/25/2022 - 01:38

So from what I understand is that you want the projectile to not be pulled down by gravity? All you do is get the no gravity block and replace event entity with immediate event entity. Pretty simple

Last seen on 18:26, 16. May 2022
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it looks like your command…
Wed, 03/16/2022 - 04:55

it looks like your command dosent have anything specifying your projectile

Last seen on 13:23, 19. May 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Go to your ranged item,…
Sat, 03/19/2022 - 03:59

Go to your ranged item, select "while projectile flying tick" and make this procedure:

 

Set no-gravity of [Immediate source entity] to True

 

Then to prevent it from flying forever:

 

Wait [number (depending on how far you want it to go)] ticks then on server-side

do despawn Immediate source entity.

 

It is very important that you change the [entity] to [immediate source entity]. Hope this helps.

Last seen on 02:50, 19. May 2024
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
omg i have got this stupid…
Thu, 08/25/2022 - 03:05

omg i have got this stupid problem for years

and it was just a google search away

i feel i lost 20 iq.

Last seen on 17:42, 19. May 2024
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Im having problems with…
Mon, 05/06/2024 - 15:37

Im having problems with setting the No Gravity to projectiles. Projectiles that apply potion effects also affects the shooter. Any way to solve this?

Last seen on 13:05, 9. May 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Same.
Mon, 05/06/2024 - 18:06

Same.