Jump to content

[SOLVED] Enchantment or electricity effect on a block


hasanchik

Recommended Posts

Hello there,

So i'm trying to figure out how to make a enchantment glint or electricity (from a charged creeper) kind of effect appear on an already existing block. I'm new to modding so I do not know at all how to do this. I'm trying to make a mod that gives copper a good use and introduces an electricity system. I took my inspiration from this video: https://www.youtube.com/watch?v=Tpm3yx1FFqo&t=400s

As you can see at the timestamp 400s the video shows "charged" copper blocks which is what i'm going for here.

Here's another example: https://www.reddit.com/r/Minecraft/comments/ysbm94/putting_the_enchantment_glint_on_blocks/ If you were to go with this approach you would need to replace the enchanting texture with another one. 

Is it also possible to make these textures appear on the surface of the block and not a bit above it like armour? And just to clarify, is it also possible to make this happen an already existing block like cut copper? 

I fully know the Java language, but I do not know how to mod.

 

(i acidentally pressed enter while i was making the topic, oops)

 

 

Edited by hasanchik
i hope this doesn't bump the topic every time i edit it
Link to comment
Share on other sites

  • hasanchik changed the title to Enchantment or electricity effect on a block
  • Thanks 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

In that post it uses block entities. Is this possible with normal blocks? Furthermore, do block entities even have an impact on performance? Sorry if I ask too many questions, I just need to gather some info before I can work on this more

Link to comment
Share on other sites

Not really. AFAIK, the normal blocks can only use the hardcoded RenderTypes known to the Chunk builder code. See RenderType.CHUNK_BUFFER_LAYERS.

 

Obviously there is overhead in BlockEntitys over normal Blocks. They use more memory because they can have custom state. And more cpu if they also tick.

In your usecase, using a custom renderer will have worse performance than using a static model, because minecraft won't be able to cache as much information.

That is somewhat mitigated in the example code above since it mostly just delegates to static (prebaked) model rendering code.

  • Like 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Thank you for your insight, but how do you change the functionality of an already existing block though? I'm talking about the copper block here which has no (real) functionality AFAIK. What i  mean by that is to extend a simple block without any funcionality that is not a class (like stone) into a block that has functionality which is a class (like TNT). Is this possible without modifying existing registries? Will this maybe cause some issues, and is it much better and easier to make your own custom block? 

Sorry for the rate reply, i had school and all of that stuff 😅

Link to comment
Share on other sites

In general, overridding/changing vanilla stuff is a bad idea, unless you can do it in a way that plays nicely with other mods.

Simple test: What would happen if another mod does something similar to what your mod does?

 

Better is to implement your own block, then let the end user/mod pack developer choose to use your block,

e.g. by changing crafting recipes to use your item instead of the vanilla one

or give the user some mechanism to morph the vanilla block into your block

 

The other issue with changing vanilla blocks/items is you will run into Mojang's hardcoding.

e.g. see the WeatheringCopper class for a hardwired use of Blocks.COPPER_BLOCK

Mojang don't design their classes to be reused by modders.

 

  • Like 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

  • hasanchik changed the title to [SOLVED] Enchantment or electricity effect on a block

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.