tutorial:a_new_page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorial:a_new_page [2021/03/05 18:47] – created oroarmor | tutorial:a_new_page [2022/12/16 06:55] (current) – check complete daomephsta | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== Example |
- | + | ||
- | ==== Introduction ==== | + | |
- | + | ||
- | Model providers are used to dynamically change the model of items based on data from '' | + | |
- | + | ||
- | ==== Practical | + | |
- | + | ||
- | For this example, let's say we have we have a custom bow item called '' | + | |
- | + | ||
- | <code java [enable_line_numbers=" | + | |
- | + | ||
- | FabricModelPredicateProviderRegistry.register(EXAMPLE_BOW, | + | |
- | if (livingEntity == null) { | + | |
- | return 0.0F; | + | |
- | } | + | |
- | return livingEntity.getActiveItem() != itemStack ? 0.0F : (itemStack.getMaxUseTime() - livingEntity.getItemUseTimeLeft()) / 20.0F; | + | |
- | }); | + | |
- | + | ||
- | FabricModelPredicateProviderRegistry.register(EXAMPLE_BOW, | + | |
- | if (livingEntity == null) { | + | |
- | return 0.0F; | + | |
- | } | + | |
- | return livingEntity.isUsingItem() && livingEntity.getActiveItem() | + | |
- | }); | + | |
- | </ | + | |
+ | Hey, you clicked the link! | ||
+ | But i’m afraid this is not the correct way to create a page, you need to specify your own page name instead of a_new_page, so go on, do it! |
tutorial/a_new_page.1614970063.txt.gz · Last modified: 2021/03/05 18:47 by oroarmor