-
I'm trying to spawn items (like when the client is dropping an item or destroying a block), but I can't seem to do that. I'm trying to spawn an pub fn drop_loot(
mut commands: Commands,
layers: Query<&EntityLayerId>,
mut drop_events: EventReader<LootDropEvent>,
) {
drop_events.iter().for_each(|event| {
let layer = layers.single();
info!("dropping loot at {:?}", event.position);
let mut stack = Stack::default();
stack.count = 1;
stack.item = ItemKind::Diamond;
let bundle = ItemEntityBundle {
item_stack: stack,
position: Position::new(DVec3::new(
event.position.x as f64,
event.position.y as f64,
event.position.z as f64,
)),
layer: *layer,
..Default::default()
};
commands.spawn(bundle);
});
} ( The furthest I've gotten was this, every other experiment around this resulted in just nothing happening. Can someone point me into the right direction? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is definitely a bug. I've filed #537 for it. |
Beta Was this translation helpful? Give feedback.
This is definitely a bug. I've filed #537 for it.