So I know its possible, because there are a couple of mods that do this, but how would I go about tweaking vanilla methods without relying on a 3rd party mod. so for example, change it so you cant punch wood, or that beds will blow up in the overworld. Basically how do i modify the vanilla block's properties in my own mod. I was thinking of making classes that just extend the certain block i want to change and using @Overrides on the things i want to change, but I don't know if that would work. oh and, removing/overriding minecraft recipes too.
No, that wouldn't work. What you're describing seems to be a Coremod. This is a relatively old tutorial, but the concepts still apply. If you don't want to do that, you could try the method you described above, but instead of registering your blocks as new blocks, changing the entry in MC's registered block list to your block. For example, instead of having NewBed and OldBed, replacing OldBed with NewBed. (I highly discourage this, however, as it could lead (almost without a doubt) to massive problems within Minecraft's vanilla code and compatibility with other mods)
and what about removing recipes? i know that having the same recipe in my mod will make minecraft use my recipe instead, but what if i just dont want the recipe to exist? would i just return null for the output?
If you're using Forge (which you should be), it provides hooks and events that can be used to change vanilla behaviour.
You can use a combination of PlayerEvent.BreakSpeed and BlockEvent.BreakEvent to prevent players from harvesting logs without the correct tool. I have a 1.8.9 example of this here.
You can use BlockEvent.PlaceEvent to detect when a player places a bed in the Overworld and create an explosion.
You can use CraftingManager#getRecipeList to get the recipe list (this is a List<IRecipe>), then use its Iterator to iterate through it and remove any recipe you want to.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So I know its possible, because there are a couple of mods that do this, but how would I go about tweaking vanilla methods without relying on a 3rd party mod. so for example, change it so you cant punch wood, or that beds will blow up in the overworld. Basically how do i modify the vanilla block's properties in my own mod. I was thinking of making classes that just extend the certain block i want to change and using @Overrides on the things i want to change, but I don't know if that would work. oh and, removing/overriding minecraft recipes too.
Alright, keep this professional.
*ahem*
Butts.
No, that wouldn't work. What you're describing seems to be a Coremod. This is a relatively old tutorial, but the concepts still apply. If you don't want to do that, you could try the method you described above, but instead of registering your blocks as new blocks, changing the entry in MC's registered block list to your block. For example, instead of having NewBed and OldBed, replacing OldBed with NewBed. (I highly discourage this, however, as it could lead (almost without a doubt) to massive problems within Minecraft's vanilla code and compatibility with other mods)
and what about removing recipes? i know that having the same recipe in my mod will make minecraft use my recipe instead, but what if i just dont want the recipe to exist? would i just return null for the output?
Alright, keep this professional.
*ahem*
Butts.
If you're using Forge (which you should be), it provides hooks and events that can be used to change vanilla behaviour.
You can use a combination of PlayerEvent.BreakSpeed and BlockEvent.BreakEvent to prevent players from harvesting logs without the correct tool. I have a 1.8.9 example of this here.
You can use BlockEvent.PlaceEvent to detect when a player places a bed in the Overworld and create an explosion.
You can use CraftingManager#getRecipeList to get the recipe list (this is a List<IRecipe>), then use its Iterator to iterate through it and remove any recipe you want to.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.