Gravity-less Projectiles

Started by IsabelleTheStoop on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Feb 2022
Points:
470

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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

Active 2 years ago
Joined Jan 2022
Points:
505

User statistics:

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

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

Active 3 years ago
Joined Feb 2020
Points:
638

User statistics:

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

it looks like your command dosent have anything specifying your projectile

Active 4 months ago
Joined Jan 2021
Points:
736

User statistics:

  • Modifications: 2
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 198
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.

Active 1 week ago
Joined Mar 2019
Points:
824

User statistics:

  • Modifications: 4
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 137
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.

Active 1 year ago
Joined Jun 2020
Points:
726

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 19
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?

Active 8 months ago
Joined Aug 2022
Points:
385

User statistics:

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

Same.

Active 3 months ago
Joined Jun 2018
Points:
819

User statistics:

  • Modifications: 1
  • Forum topics: 12
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 135
Maybe use an if statement in…
Tue, 10/08/2024 - 08:37

Maybe use an if statement in order to filter which entities are affected by the potion effect?

Active 7 months ago
Joined Jan 2025
Points:
32

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
I'm having a similar problem…
Sat, 01/04/2025 - 06:44

I'm having a similar problem, and multiple previous comments are mentioning an "Immediate Source Entity" block. Where do I find this?

Active 22 hours ago
Joined Feb 2024
Points:
135

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
@noxvern, just use the…
Tue, 04/29/2025 - 23:15

@noxvern, just use the procedure "if not event/target entity is the same entity as source entity do:" and it makes it not affect the shooter.

Active 22 hours ago
Joined Feb 2024
Points:
135

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
@evievargas, its all in the…
Tue, 04/29/2025 - 23:16

@evievargas, its all in the minecraft components thing.