Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So I added a custom horse like entity which extends HorseEntity.

I want that the horse makes a fire trail if sprinting. The fire trail currenlty is triggered when inside livingTick() when gallopTime is high enough, just like the gallopSound.

I tried using the .isSprinting() on player and on the entity, but both doesn't seem like to work.

Is there a way to check if the player on the horse is sprinting, couldn't find anything that works in this case?

    public void livingTick() {

        if (!this.world.isRemote) {
            if (this.isBeingRidden()) {
                if (this.getControllingPassenger() instanceof LivingEntity) {
                    LivingEntity passenger = (LivingEntity) this.getControllingPassenger();

                    if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)) {
                        return;
                    }

                    int i, j, k;
                    BlockState blockstate = Blocks.FIRE.getDefaultState();

                    for(int l = 0; l < 4; ++l) {
                        i = MathHelper.floor(this.getPosX() + (double)((float)(l % 2 * 2 - 1) * 0.25F));
                        j = MathHelper.floor(this.getPosY());
                        k = MathHelper.floor(this.getPosZ() + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F));

                        BlockPos blockpos = new BlockPos(i, j, k);

                      	// TODO: CHANGE this.gallopTime > 5 && this.gallopTime % 3 == 0 TO .isSprinting() or similar
                        if (this.world.isAirBlock(blockpos) && blockstate.isValidPosition(this.world, blockpos) && this.gallopTime > 5 && this.gallopTime % 3 == 0) {
                          
                            this.world.setBlockState(blockpos, blockstate);
                        }
                    }
                }
            }
        }

 

The version you are using is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

Currently supported versions are 1.19.2 (Latest) and 1.18.2 (LTS).

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.