matt1999rd Posted December 21, 2021 Posted December 21, 2021 hello everyone, I have done a mod in version 1.14 and 1.15 and I am actually updating it to version 1.16.5. But in this process I want to replace some block in it. How can I replace block before loading the world (after clicking on play button on the main menu screen). My block are some simple switchrail (see picture below) that have only two states : the axis of the straight line and the switch position of the block (straight or turn). After this modification, there must be three property : facing, hinge( if the switch turn is on right or left ), switch position. Quote
MFMods Posted December 22, 2021 Posted December 22, 2021 i assume it's the same block (as far as registration is concerned)? same modid:blockname? if the block was changed too much, i'd consider having two blocks: legacy block and new block. make legacy block tick every minute (like crops) and on tick, replace with the new one. nice and clean. Quote
matt1999rd Posted December 22, 2021 Author Posted December 22, 2021 (edited) yes it is the same modid but not the same registry name. The thing I want to do is to replace all occurrences of the block in the world. I tried to do it using the WorldEvent.Load function but I am not sure I can redefine all block especially the ones that are far away from the spawning position. (edit start) I can do it using ChunkEvent.Load but I am not sure of whether this event is reached when loading the world.(edit stop) The solution of replacing the block does not satisfy me as it keeps the bad block in the delivered mods jar file. Edited December 22, 2021 by matt1999rd new information found on event Quote
matt1999rd Posted December 28, 2021 Author Posted December 28, 2021 As I search in the minecraft code I could not find anywhere where the registry name is register before being destroy and replaced with default air block. I think it may be impossible to replace broken block in the game if the registry name has been removed Quote
Recommended Posts
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.