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

Add player_bucket_fill and player_bucket_empty events. #1387

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

Lildirt
Copy link
Contributor

@Lildirt Lildirt commented Jul 17, 2024

Payloads:

event_type: player_bucket_empty
hand: main_hand
item: {meta: null, name: BUCKET, qty: 1}
location: {0: -295.0, 1: 118.0, 2: -29.0, 3: world, world: world, x: -295.0, y: 118.0, z: -29.0}
macrotype: player
player: Lildirt
event_type: player_bucket_fill
hand: main_hand
item: {meta: null, name: WATER_BUCKET, qty: 1}
location: {0: -295.0, 1: 118.0, 2: -29.0, 3: world, world: world, x: -295.0, y: 118.0, z: -29.0}
macrotype: player
player: Lildirt

I debated on whether to include item with this, as it is the result item after the event has processed. However, getting the held item of the player will give you what they were holding before the event happened, so I suspect it has some use.

Also, I mocked the events around pistons for this kind of format, which is why I have a base event that is being extended by both.

@PseudoKnight
Copy link
Contributor

Looks good to me. It's well thought out. I agree with your assessment of 'item'. I guess the key should be changed to be more clear, but it's not that important. I also agree that there doesn't seem to be a point to including the clicked block and face. We can always add it later if it proves to be useful in some way, but player_interact can handle that already.

Anyway, I'm ready to pull this.

@PseudoKnight
Copy link
Contributor

Maybe some small tweaks to the docs.

I would use "into the world" for the empty event description.

Even though it matches other events, could explicitly say that 'hand' is either 'main_hand' or 'off_hand'.

@PseudoKnight
Copy link
Contributor

Oh, getHand() was only added to these events in 1.19.2.

@Lildirt
Copy link
Contributor Author

Lildirt commented Jul 19, 2024

Added 1.19.2+ gatekeep for getHand() and your suggested doc change.

@PseudoKnight PseudoKnight merged commit af10139 into EngineHub:master Jul 19, 2024
2 of 4 checks passed
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