Projectile pinned in block can only be picked up once

Started by Granknight on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Projectile pinned in block can only be picked up once

Using version 2024.2
So after removing the following code, custom projectiles will work like arrows and pin into the ground, and can be picked up, however this only works the first time it lands, after it is picked up for the first time the second landing will keep the projectile stuck into the ground, how can this be fixed?
Code:
    @Override

    public void tick() {
        super.tick();
        if (this.inGround) {
             this.discard();
        }
    }