Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make falling anvil deal damage #1913

Merged
merged 2 commits into from
Nov 3, 2021

Conversation

PetteriM1
Copy link
Member

No description provided.

Entity[] e = level.getCollidingEntities(this.getBoundingBox(), this);
for (Entity entity : e) {
if (entity instanceof EntityLiving) {
entity.attack(new EntityDamageByBlockEvent(event.getTo(), entity, DamageCause.CONTACT, (float) Math.min(40, Math.max(0, (startY - y) * 2))));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't startY - fall distance be resetted with every entity reload?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to just use fallDistance that is managed by Entity class

@Creeperface01 Creeperface01 merged commit 7f03dbc into CloudburstMC:master Nov 3, 2021
wode490390 pushed a commit to NetEasePE/Nukkit that referenced this pull request Dec 26, 2021
* Make falling anvil deal damage

* Use highestPosition

(cherry picked from commit 7f03dbc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants