这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@DavyCraft648
Copy link
Contributor

@DavyCraft648 DavyCraft648 commented Oct 22, 2025

This pull request adds support for powder snow as a block and item, including its interactions with entities and buckets.

Powder Snow Block and Item Implementation

  • Added new PowderSnow block
  • Added powder snow bucket as a new item. Includes bucket empty/fill powder snow sounds
  • Introduced freezing mechanics for entities: entities accumulate freeze ticks when inside powder snow, which slow movement and eventually cause damage. Entities are protected from freezing if wearing leather armor
  • Synced freeze progress ratio to clients for visual effects and added new damage cause for freezing
  • Added new sound classes for powder snow bucket interactions

This PR does not implement:

1.17.0 - Caves & Cliffs

Related issues & PRs

#5964
#5163

Changes

API changes

  • Added PowderSnow class
  • Added SolidBucket class
  • Added Living::getFreezeProgressTicks()
  • Added Living::setFreezeProgressTicks(int $freezeProgressTicks)
  • Added Living::getFreezeProgressRatio()
  • Added Living::getFreezeThresholdTicks()
  • Added Living::getFreezeProgressState()
  • Added Living::setFreezeProgressState(?bool $state)
  • Added Living::canFreeze()
  • Added EntityDamageEvent::CAUSE_FREEZE

Tests

https://www.youtube.com/watch?v=QVkKMMUlHjE

Plugin:
https://gist.github.com/DavyCraft648/ca56d2587da2b08a983cf3e648e5c0c8

@DavyCraft648 DavyCraft648 requested a review from a team as a code owner October 22, 2025 22:03
@dktapps
Copy link
Member

dktapps commented Oct 23, 2025

I don't think #2041 should affect this. Carpets are a thin layer at the bottom of their cell, so you can detect when an entity enters that cell with onEntityInside(). #2041 only affects full-blocks which need to be collidable.

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Oct 23, 2025
@DavyCraft648
Copy link
Contributor Author

DavyCraft648 commented Oct 24, 2025

I think this seems to be something missing in pocketmine, Slime block should also not deal damage if there is carpet on top of it. Jumping on a Carpet can also damage Farmland and on Beds it also gives a bouncing effect if they are under it.
Do we need to create an onEntityLand function on the carpet that calls onEntityLand on the block below it?

@dktapps
Copy link
Member

dktapps commented Oct 24, 2025

I think this seems to be something missing in pocketmine, Slime block should also not deal damage if there is carpet on top of it. Jumping on a Carpet can also damage Farmland and on Beds it also gives a bouncing effect if they are under it. Do we need to create an onEntityLand function on the carpet that calls onEntityLand on the block below it?

Hmm, not sure. Maybe leave that out of this PR then.

@dktapps
Copy link
Member

dktapps commented Oct 24, 2025

I'm not very clear how powder snow is supposed to work. Are there any non-mobs affected by it? It seems weird to me that general entities should be affected.

@DavyCraft648
Copy link
Contributor Author

Freezing a burning entity should extinguish its fire, such as an arrow fired with the flame enchantment. However, we handle it in the PowderSnow block here.
Should we just move the freeze codes to Living?

@dktapps
Copy link
Member

dktapps commented Oct 24, 2025

Yeah, I think so. Unless there are any non-living entities that can have the freeze effects.

@DavyCraft648
Copy link
Contributor Author

DavyCraft648 commented Oct 25, 2025

I've attached a plugin to the test section for plugin developers who want to try it out, in case they want to create a troll plugin or custom enchant. Any suggestions would be helpful.

Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

From what I can gather, the implementation seems mostly OK. My main issues are with the API design.

Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

This is looking mostly done now I think

@dktapps
Copy link
Member

dktapps commented Nov 6, 2025

This looks good now. Will test soon and feedback

@dktapps
Copy link
Member

dktapps commented Nov 8, 2025

Looks like we have a simulation issue with the collision boxes. Since the collision AABB is different if the entity is wearing leather boots or not (they should be able to stand on the powder snow). For non player entities I don't think this will work currently.

I'm not too sure how that should be addressed though, since we don't really have the systems to deal with that...

@DavyCraft648
Copy link
Contributor Author

Hmm... Some mobs like foxes can also stand on powder snow (unless it does a jumping attack on a chicken in the powder snow). This might be a problem if we want to implement Scaffolding block. I think the collision is just as complex because it only prevents falling, but allows for passing from the side.
Should we enforce the collision as a full block for now?

@dktapps
Copy link
Member

dktapps commented Nov 11, 2025

No, that would prevent regular mobs from falling inside it.

This needs to be fixed properly with a more general solution. I have a rough idea how to deal with it, but collision detection is very performance-sensitive code, so it needs to be handled carefully.

@dktapps dktapps added the Status: Blocked Depends on other changes which are yet to be completed label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Gameplay Related to Minecraft gameplay experience Status: Blocked Depends on other changes which are yet to be completed Type: Enhancement Contributes features or other improvements to PocketMine-MP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants