Jefferzoonn Posted May 4 Report Share Posted May 4 I'm trying to create a mod that simply consists of having a block that if you jump on top of it throws you up with great force, but I can't understand the api documentation, I don't even know what methods to look for, for example To cancel the fall damage, does anyone know of an api guide or if someone would be so kind as to make one, it would be great, at least with the basics to know how to use it. Excuse my English, I have used the google translator Link to comment Share on other sites More sharing options...
genovefa Posted August 26 Report Share Posted August 26 Looks like one of the wiki pages actually makes a trampoline block as an example. https://wiki.vintagestory.at/index.php/Modding:Advanced_Blocks Link to comment Share on other sites More sharing options...
Omega Haxors Posted September 23 Report Share Posted September 23 (edited) The API documentation is shit, what I do is take the source code and read that. For your example you want to read the damage event and cancel (or modify the damage of it) if conditions are met. When you don't have something to hook on to you can either hook onto the tick itself or make your own tick handler and hook onto that. It's clumsy and I wouldn't suggest doing so unless you have to. Eventually I have to get around to rewriting all of my mods because they use an obscenely inefficient method which lags the game to shit. Treat all coding in this game as an event handler. Something happens, and then your code will react to that. Ultimately that's how things get done. Edited September 23 by Omega Haxors Link to comment Share on other sites More sharing options...
l33tmaan Posted September 24 Report Share Posted September 24 On 9/22/2023 at 10:42 PM, Omega Haxors said: Eventually I have to get around to rewriting all of my mods because they use an obscenely inefficient method which lags the game to shit. Hey, how exactly do you determine the performance hit your mods incur, and more importantly, why they impact performance? Link to comment Share on other sites More sharing options...
Omega Haxors Posted September 27 Report Share Posted September 27 On 9/24/2023 at 8:44 AM, l33tmaan said: Hey, how exactly do you determine the performance hit your mods incur, and more importantly, why they impact performance? I'm usually a low-level programmer so I tend to think of each part eventually breaking down into machine code. One method to test for lag is kind of horrifying, but it's to load the server with a reliable source of lag then measure dropped ticks. Link to comment Share on other sites More sharing options...
l33tmaan Posted September 27 Report Share Posted September 27 Oh, so you mean "just load your server". Hah! I will see myself out, now. Link to comment Share on other sites More sharing options...
Recommended Posts