-
[1.12.2] Correctly adding EntityAI tasks to EntityAnimals [SOLVED]
It is indeed called, at game load, as it looks like the task list is saved at game exit, then loaded on game load, so the EntityAIPet task persists in the task list, and it tries to add another copy of the task as the EntityAnimal spawns in, so addPettingTask = false (sorry, I'm not familiar with the forum formatting options yet) does get set.
-
[1.12.2] Correctly adding EntityAI tasks to EntityAnimals [SOLVED]
Yeah, I just refined it a bit and I'm coming back to report that it's a success! Here's the refined code for anyone looking to do a similar thing: Sorry if the formatting is a bit off, it's not cooperating with me.
-
[1.12.2] Correctly adding EntityAI tasks to EntityAnimals [SOLVED]
Hello again! I'm wondering what the best way to add a custom EntityAI thing to all EntityAnimals would be? I'm currently doing it on LivingSpawnEvent, but that feels a bit hacky, and I don't know how to check if the EntityAnimals already have the task. Would the best way to do this be at registration? Here's where I'm doing it: The EntityAIPet class is basically an AI task that allows the player to pet the animal for a small amount of XP every now and then. I can post the code if need be.
-
[1.12.2] Getting brewing recipe to only target certain potion types? [SOLVED]
Thanks for this! That worked perfectly.
-
[1.12.2] Getting brewing recipe to only target certain potion types? [SOLVED]
Just a quick bump. Been sick for a while, so was away from the forums. Sorry about that. So I've implemented net.minecraftforge.common.brewing.BrewingRecipe instead of IBrewingRecipe, and it's having the same behaviour, where it replaces all potions in the brewing stand, regardless of what they are. Is there a way to stop this? The code for the custom recipe is very simple, as below.
-
[1.12.2] Redstone lamp
I'd love a copy of your notes, if you could PM me them or something. It looks like great advice! And yeah, I should probably get out of this thread now and let you guys do your thing, as according to the EAQ. Thanks so much!
-
[1.12.2] Redstone lamp
Ah, excellent advice. Thank you again! I'm going to go about changing all my stuff to better fit this pattern. Is there a list of all of this advice somewhere? If not, there should be! I'd love to read it all. Who knows how many mistakes I'm making, just picking up bad habits from other modders who have tried to make my life easier.
-
[1.12.2] Redstone lamp
Thanks for the info Cadiboo! I'm currently implementing this into my mod, as I realise I'm quite guilty of this. Just a quick question: does the class being registered have to have a default constructor? I have ItemBase and BlockBase classes, which take their names from their constructors and have no default constructor, how would I go about fitting these into the @ObjectHolder standard?
-
[1.12.2] Getting brewing recipe to only target certain potion types? [SOLVED]
Well, that helped fix the second recipe that I was registering, so thank you! However, I still get the bug where Thick Potion > Ender Slime changes all other potion types in the brewing stand, for some reason. I just can't figure it out. How does vanilla Minecraft compare potions?
-
[RESOLVED][1.12.2] Put fire in a block
I'm not sure if you're supposed to compare BlockStates. Have you taken a look at how Flint & Steel spawns its fires?
-
[1.12.2] Getting brewing recipe to only target certain potion types? [SOLVED]
I've now got my Ender Pearls brewing away quite happily! It's actually the step before it that isn't so happy. Basically, it should go Water Bottle > Thick Potion > Ender Slime, but when I'm brewing the Ender Slime, it also overwrites all of the other potions in the brewing stand! For reference, I'm writing my own IBrewingRecipe handler (and it has to be a single class, because adding more than one recipe apparently doesn't work on the Forge version I'm on, which is 1.12.2-14.23.5.2768) I've gone back to the IBrewingRecipe and I'm hoping for the best, and I've tried checking against Item and PotionType. Admittedly, I know very little about potions, so I'm kind of out of my depth here. How does one compare potions? EDIT: Changing back to the separate IBrewingRecipes actually completely broke whatever recipe I decide to register second. Not sure what's happening there. Nothing in the logs about it.
-
[1.12.2] Brewing things that aren't potions [SOLVED]
Never mind, I just solved this: make sure you only try to put a stack size of one into the brewing stand's input slots.
-
[1.12.2] Brewing things that aren't potions [SOLVED]
Maybe I'm just trying to stretch Minecraft too far, but I'm trying to make it so you can brew Ender Pearls using a custom ingredient, and a custom item (not a potion bottle, just an empty Ender Pearl, which is an Item). Now, I've tried registering the recipe using these items, but it won't let me put the empty Ender Pearls into the brewing stand. I believe it should be letting me do this, because they're valid input (as specified in ContainerBrewingStand#isValidInput), as I've registered the brewing recipe, but for some reason they're just not going in. Is what I want to do not possible, or do I just need to work a little harder? Any help is appreciated!
-
[1.12.2] Cannot override getGrowthChance of BlockCrops?
Well, that's a bugger. Thanks, Draco!
-
[1.12.2] Cannot override getGrowthChance of BlockCrops?
I'm wondering if anyone can help me: I'm trying to @Override the BlockCrops#getGrowthChance function, but IntelliJ and Gradle keep complaining that there's nothing to override, even when I literally copy and paste the entire function into the new class. What's going on here? Here's the new class' overridden version, just for reference. @Override protected static float getGrowthChance(Block blockIn, World worldIn, BlockPos pos) { return 0.3F; }
IPS spam blocked by CleanTalk.