Gravity-less Projectiles

Started by IsabelleTheStoop on

Topic category: Help with Minecraft modding (Java Edition)

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

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
 

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

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

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.

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.

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?

Joined Jun 2018
Points:

User statistics:

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