tutorial:mixin_redirectors_methods
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tutorial:mixin_redirectors_methods [2021/01/15 03:11] – Fix the mixin example to target the right class obw | tutorial:mixin_redirectors_methods [2021/01/15 04:20] (current) – Fix instance method example - removed "static" modifier & rename class obw | ||
---|---|---|---|
Line 35: | Line 35: | ||
<code java [enable_line_numbers=true]> | <code java [enable_line_numbers=true]> | ||
@Mixin(Entity.class) | @Mixin(Entity.class) | ||
- | abstract class ItemStackMixin | + | abstract class EntityMixin |
@Redirect(method = " | @Redirect(method = " | ||
at = @At(value = " | at = @At(value = " | ||
- | private | + | private ItemEntity replaceDroppedItem(Entity droppingEntity, |
return droppingEntity.dropItem(item == Items.DIAMOND ? Items.AIR : item, yOffset); | return droppingEntity.dropItem(item == Items.DIAMOND ? Items.AIR : item, yOffset); | ||
} | } |
tutorial/mixin_redirectors_methods.txt · Last modified: 2021/01/15 04:20 by obw