-
Recently Browsing
No registered users viewing this page.
-
Posts
-
By diesieben07 · Posted
You cannot apply default values to all item stacks. There is no way. If you want your capability to have default values, you need to lazily initialize them whenever they are queried. For example in your capability: class MyCap { private String name = null; public String getName() { if (this.name == null) { this.name = "default value"; } return this.name; } } This sounds very suspicious. What are you talking about? -
Hi All, Been trying to figure this out for a while now. I want to make a change to the loot table so it will give me sugar cane. I have attached the json file I am testing with that should give suger cane (I replaced all the others with cane). Doesn't matter where I put it I can't get it to work. After each attempt I reload the world and tp to a spot I've never been to and then find a village (it is a flat world so not too hard). But I can't get it to work. Is there something I am missing. I've tried putting it in saves/worlsname/data/loot_tables/minecraft/chests/village as well as in datapack folders and so many other places mentioned in google searches.. Someone please put me out of my misery... Local game on PC, 1.15.2 Thanks! Fiz. village_plains_house.json
-
Hey, I stumbled across a bug in my mod, when using the workbench (and presumably any other sort of crafting station). I have an itemstack capability, that gets its default value through json files. So usually when the AttachCapabilityEvent<ItemStack> triggers, I can succesfully add these values to the item. However when the result slot in the workbench container updates to a new item, the attach event does not trigger and the capability stays empty. I added a hook using ItemCraftedEvent, so the values are being set, when the crafting results gets picked up, but I also added some costum tooltips, that displays the capability data. So currently it will not show any of my data, when the mouse hovers above the crafting result. Only after picking it up, the correct data can be seen. This might confuse the player, so I would like to know, if there is method for setting the default values the moment the resulting stack is generated. Also I fear, that the ItemCraftedEvent does not trigger for machines from other mods. This would mean, that it would be possible to create itemstacks with incorrect capability data. I hope my explanation is clear enough. If not, I can add some pictures to show you, what I mean.
-
By diesieben07 · Posted
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. -
By diesieben07 · Posted
Really old Minecraft versions are no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
-
Topics
-
Who's Online (See full list)