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.

[solved][1.16.5]How to make arrow faster but not incrase its damage?

Featured Replies

Posted

Hello, I have made enchantment that accelerates arrow fired by crossbow, but not only this increases speed, this also increases damage, I want it to have the same damage as before, how can i make damage the same?
What i'm doing is when firing arrow, detect it using EntityJoinWorld event and changing its velocity

if(enchants.containsKey(TCombatEnchants.SNIPE.get())){
	double damage = abstractArrowEntity.getBaseDamage();
	Vector3d vector3d1 = shooter.getUpVector(1.0F); 
	Quaternion quaternion = new Quaternion(new Vector3f(vector3d1), 0, true);
	Vector3d vector3d = shooter.getViewVector(1.0F);
	Vector3f vector3f = new Vector3f(vector3d);
	vector3f.transform(quaternion);
	Vector3d originalVector = abstractArrowEntity.getDeltaMovement();
	double length = originalVector.length() * 10;
	abstractArrowEntity.setDeltaMovement(vector3f.x()*length, vector3f.y()*length, vector3f.z()*length);
	abstractArrowEntity.hurtMarked = true;
	abstractArrowEntity.setBaseDamage(damage);
}

 

Edit:I have solved it by saving length of original velocity and setting damage when it hit entity to its base damage multiplied by saved length

Edited by tmvkrpxl0
solved

28 minutes ago, tmvkrpxl0 said:

how can i make damage the same?

I think that's not possible because the damage from the arrow depends on the arrow velocity
that mean if you increase the speed of the arrow, the damage is also increased

 

Edit: check out the method onEntityHit in the AbstractArrowEntity class for more information

Edited by Luis_ST

  • Author

I have succeed by saving length of original velocity and setting damage when arrow hit something to arrow's base damage multiplied by saved length

  • tmvkrpxl0 changed the title to [solved][1.16.5]How to make arrow faster but not incrase its damage?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.