CustomNPC-Plus
CustomNPC-Plus copied to clipboard
Some The bug of the respawn of the NPC
Good afternoon. Can I order some fixes from you to modify the custom Npc plus? The fact is that there is a very annoying bug in the original Custom Npc, because of which enemy NPCs (for example, those who are placed in a dungeon) do not count down to respawn after death, if the player is not in the same chunk with them. As a result, a player who comes to the dungeon after another player finds that the dungeon is empty, and he has to stand and wait in the chunk until the enemy NPC is respawn again, if the respawn time of the NPC is for example 5 minutes or more.
There is also another related error. Custom Npc as the best mod for NPCs is often used on servers to play over the network on cores such as thermos or crucible, but there is an error in these server cores, due to which NPCs who died outside the chunk where they were created are automatically deleted by the server core to avoid failure. About 3 years ago, I ordered the fix of these errors from my programmer friend, but unfortunately, since then I have lost both his contacts and the correction itself. Can you fix it for a fee? And I, and a very large number of people who want to play with this mod with friends, will be very grateful to you, I can pay for your work using pay pal, just tell me how much you want for your work.
Now I want to tell you exactly how we fixed this bug with the help of this programmer. A new block called Custom npc spawner has been added to the mod. This block was assigned an linked npc, the time of the npc's respawn after death, the distance in blocks at which the npc appears when the player is nearby, and the function of whether this block sees players through walls. And we set the "Natural Disappearance" respawn mode for the linked NPC. Since with this method, the NPC as an entity disappears while the player is not in the chunk, and in their place is a block installed by the administrator, in addition to correcting the errors that I described above, we significantly optimize the server itself, since it does not need to constantly keep a bunch of inactive entities in the server memory.
(The server administrator assigns the linked npc to this block by right-clicking on it and selecting in the GUI that opens. Also in this GUI, the time of respawn, the distance to the player for spawn and the parameter responsible for detecting players through walls are prescribed. This block will call this npc from under it - for example, if the NPC has a growth of 2 blocks, then we place the rebirth block 2 blocks above the ground. The block itself is invisible to players in survival mode, but visible to administrators in the creative. Also, the block has no collision and arrows and other projectiles can fly through it)
There is also an annoying bug: if there is too much information in the player's data (data on completed quests, read dialogues), then when he is killed and revived, the server is overloaded with the volume of the player's data file and freezes for half a second, which is terribly annoying. We fixed this bug by optimizing the player's death data file. Thank you for reading, I really hope you can accept this order from me. If it is convenient for you, then you can contact me in discord. My discord: wasteland4013 I apologize in advance for my English, it is not my native language.