RangedAttack code help needed, please.

Started by Sam87Gamer on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RangedAttack code help needed, please.

I needed some help regarding getting a procedure to execute on an entity when it shoots. 

This is the code that originally is used for activating a ranged attack. However I've tried to make it into this:

This however gives me errors and refuses to work. I've tried adding on super.performRangedAttack(); but that didn't work either.

Anybody have any idea how can I make it so everytime I shoot this procedure gets executed? The point of the procedure is to remove an item from a block that the entity is inside of. It simply removes an item from slot 0 at block x y z. Any actual procedures created for a ranged weapon do not work for entities, only players, and I wanted to bypass that by putting it directly here. I've also tried to place it inside of the ranged weapon entity itself but I had no luck no matter what I tried.