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

Initial work on handle use item #433

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

Conversation

suprohub
Copy link
Contributor

@suprohub suprohub commented Dec 30, 2024

Description

Initial work on handle use item, also i add strip in cargo.toml for optimizations.

Testing

cargo test
cargo run
see world

Please follow our Coding Guidelines

Cargo.toml Outdated Show resolved Hide resolved
pumpkin-world/src/item/item_registry.rs Outdated Show resolved Hide resolved
@suprohub
Copy link
Contributor Author

We need to send sound, but its in future

@suprohub
Copy link
Contributor Author

suprohub commented Jan 1, 2025

All fixed, waiting review

@Snowiiii
Copy link
Member

Snowiiii commented Jan 6, 2025

You need to use consume_seconds from "minecraft:consumable" as the time for waiting

Comment on lines +96 to +101
pub consume_seconds: f32,
pub has_consume_particles: bool,
pub animation: Option<String>,
pub sound: Option<String>,
// TODO: Effects implementation??
pub on_consume_effects: Option<Vec<serde_json::Value>>,
Copy link
Member

Choose a reason for hiding this comment

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

Please, Before changing anything in the item_registry and trying to just look at the JSON what vanilla does just open up the vanilla Implementation. The Consumable component can be found in net.minecraft.component.type::ConsumableComponent

  • consume_seconds: optional float
  • animation: optional enum
  • sound: optional SoundEvent
  • has_consume_particles: optional bool
  • on_consume_effects: optional list of "ConsumeEffect"s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But some items have default values, like consume srxonds, its 1.6 by default, and why i need to add options if it has a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some food dont have any arguments, so where i can get consume seconds?

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.

3 participants