Skip to content

Commit 86bf2e5

Browse files
committed
Fix custom tools
1 parent ec08b06 commit 86bf2e5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,6 @@ private static NbtMapBuilder createComponentNbt(Key itemIdentifier, CustomItemCo
325325
computeConsumableProperties(consumable, foodProperties, itemProperties, componentBuilder);
326326
});
327327

328-
computeUseEffectsProperties(itemProperties, componentBuilder,
329-
context.components().getOrDefault(DataComponentTypes.USE_EFFECTS, DEFAULT_USE_EFFECTS),
330-
consumableComponent.map(Consumable::consumeSeconds));
331-
332328
UseCooldown useCooldown = context.components().get(DataComponentTypes.USE_COOLDOWN);
333329
if (useCooldown != null) {
334330
computeUseCooldownProperties(useCooldown, itemIdentifier, componentBuilder);
@@ -371,6 +367,13 @@ private static NbtMapBuilder createComponentNbt(Key itemIdentifier, CustomItemCo
371367
computeProjectileProperties(componentBuilder);
372368
}
373369

370+
// Bedrock doesn't really use these otherwise
371+
if (throwable != null || chargeable != null || consumableComponent.isPresent()) {
372+
computeUseEffectsProperties(itemProperties, componentBuilder,
373+
context.components().getOrDefault(DataComponentTypes.USE_EFFECTS, DEFAULT_USE_EFFECTS),
374+
consumableComponent.map(Consumable::consumeSeconds));
375+
}
376+
374377
Unit entityPlacer = context.vanillaMapping().map(mapping -> {
375378
if (mapping.isEntityPlacer()) {
376379
return Unit.INSTANCE;

0 commit comments

Comments
 (0)