Everything posted by Draco18s
-
[SOLVED][1.15.2] Infinite Durability items cannot combine with itself on the anvil to make higher level enchantments.
I don't believe vanilla code allows items to be combined for enchantments unless they are also damageable (and infinite durability items aren't damageable).
-
[1.15.2] Subscribing to events
The code: https://github.com/Draco18s/ReasonableRealism/tree/1.14.4/src/main/java/com/draco18s/harderores/loot/function The loot table: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/loot_tables/blocks/ore_hardiron.json#L27 Registering things: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L97-L99 (Note: I haven't worked on the code in some time and registration may have changed to be done as a registry object like blocks and items)
-
[1.15.2] Subscribing to events
And functions as well. For example I have a block that uses a blockstate to store variants (its easier to deal with changing an integer value than change to a new block for the majority of harvesting cases), but needs to drop different items (due to item variants not really being a thing any more) when silk-touched (a less common harvesting situation), so I created a function that generates the correct item. Additionally, should you have an effect that would require the HarvestDropsEvent to modify loot in some way (e.g. an enchantment that causes skeletons to drop bonemeal instead of bones), check out the Global Loot Modifiers.
-
Want a trigger for breaking block
You'd need to change the criterion to deserialize a tag. Then: https://mcforge.readthedocs.io/en/1.13.x/utilities/tags/#using-tags-in-code Names might be a little different, but that's the general idea.
-
[Solved]Reverse engineering
The right-click menu is great. Find references, open type hierarchy, navigate to definition and so on.
-
Want a trigger for breaking block
Good news! I've actually written this one already. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/api/advancement/BreakBlockTrigger.java#L31 In general, they're pretty straight forward though. Copy an existing one, change the trigger method to do whatever you want, including taking whatever params you want, and work backwards fixing errors. I think advancement criterions can be registered as any other registry item (haven't checked in a while), but if not, this might help: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/EasyRegistry.java#L97 Oh, and you'll need this event handler too: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/HardLib.java#L57-L62
-
[Solved]Making recipes and drops.
You don't need a custom recipe class if you're just using mod items. Custom recipe classes are for handling things in some non-standard way. Writing NBT data to the result, migrating itemstack damage, etc
-
[Solved]Making recipes and drops.
Mind, this is old code and does some things in ways that aren't entirely recommended, but I did use the correct systems. Anyway, here's a custom recipe class: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/api/recipe/RecipeTagOutput.java#L31 And an example recipe file: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/recipes/ores/gold_dust.json (The recipe produces output based on a tag, grabbing the first item present in that tag) Registration: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/HardLib.java#L51 That stores it in an arry, which then uses the registry events as normal here: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/EasyRegistry.java#L187 Don't do this yourself, the Forge systems have evolved and this isn't necessary. Its a left-over from when 1.7.10 -> 1.10 changed how things were registered and I didn't like how it wasn't so clean to register blocks and their item forms and wrote my own wrapper (so I could to things like this).
-
[1.15.2] how to use LivingKnockbackEvent with projectiles
This sounds like a damage source vs. true damage source problem.
-
[Solved]Making recipes and drops.
Here's a working example for a basic block: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/loot_tables/blocks/millstone.json Note that the "data" parameter you have is obsolete, blocks don't have metadata since The Flattening (1.13).
-
[Solved]Making recipes and drops.
Recipe serializers for custom recipes need to be registered. This is true Show what you tried.
-
i want to make a sickle
What have you done so far?
-
How can i rotate models around z axis in blockstates?
...what font are you using...no, I don't want to know. That's your problem to deal with. Use a better font.
-
How can i rotate models around z axis in blockstates?
is not "y"
-
Want to modify every MONSTER loot table
https://github.com/MinecraftForge/MinecraftForge/pull/6401
- Adding NBT to item
-
[1.15.2]How do I fire events?
Fair enough, but in general, Forge fires events and doesn't listen for them.
-
Adding NBT to item
All of those fields cannot be used. Items are singletons. Problematic Code #9
-
[1.15.2]How do I fire events?
Just because you fired the event doesn't mean Forge is listening. And Forge is never listening to its own events. Events are for mods to listen to and do what they want. (read: that's not how you set the eye height)
-
Adding NBT to item
You can't do this.
-
How can i rotate models around z axis in blockstates?
You don't. You use a combination of X rotation and Y rotation.
-
[1.14/1.15] Replacing repair item of vanilla armor material?
Here's a correct @ObjectHolder annotation. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L243
-
[1.15.2] Custom blast smelting recipe
Obtaining recipes is handled by advancements.
-
[1.15.2] Float capability not exact
https://floating-point-gui.de/
-
[1.15.2] General Texture Atlases/Stitching Question
Non-power-of-2 textures don't work great in Minecraft. See this thread:
IPS spam blocked by CleanTalk.