Ranged weapon help

Started by myxical on

Topic category: Help with modding (Java Edition)

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ranged weapon help
Mon, 05/17/2021 - 11:59 (edited)

1. How do I make the projectile glow?
2. How to make the projectiles deal magic damage? I tried making a procedure that does some damage to the hit entity with the type "magic", but if I kill an entity using it the kill won't count (in the statistics). This can be a problem if there are advancements or quests to kill some entity.
3. How do I make it so my ranged weapon can shoot constantly when active with a higher cooldown? I don't see it anywhere and it would be a neat feature for the next update.
4. How do I disable gravity for projectiles so they don't fall down?
5. How do I make it so there is no invulnerability ticks on attacked mobs? There is a very short moment between hits that the attack won't register.
6. How to make ranged weapons use experience instead of ammo, and when xp = 0 then remove the ability to shoot?

Any help would be appreciated, thanks.

Edited by myxical on Mon, 05/17/2021 - 11:59
Last seen on 05:05, 19. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
3. in trigger "when ranged…
Sat, 05/13/2023 - 05:44

3. in trigger "when ranged item used" add (cooldown provided_itemstack for [] ticks), in [] write your cooldown between shots.

 

Last seen on 05:05, 19. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
4. in trigger "while…
Sat, 05/13/2023 - 05:51

4. in trigger "while projectile in air tick" add:

if (Get number NBT [age] of [immediate_source_entity]) = 0:

    (Set number NBT [x] of [immediate_source_entity] to [x velocity of immediate_source_entity])

    (Set number NBT [y] of [immediate_source_entity] to [y velocity of immediate_source_entity])

    (Set number NBT [z] of [immediate_source_entity] to [z velocity of immediate_source_entity])

    (Set number NBT [age] of [immediate_source_entity] to [1])

else:

   (Attempt to override motion vector of [immediate_source_entity] to vx: ([Get number NBT [x] of [immediate_source_entity]), vy: ([Get number NBT [y] of [immediate_source_entity]), vz:( [Get number NBT [z] of [immediate_source_entity])

Last seen on 05:05, 19. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
6. in trigger "when ranged…
Sat, 05/13/2023 - 05:58

6. in trigger "when ranged item used" add:

(Remove [] xp from event_target_entity), in [] write the xp amount.

and in trigger "can use ranged item" add:

if (get xp level of [event_target_entity]) > [0]:

    Return true

Return false