InSim Base is a pre-made template to kickstart your InSim development without worrying about handlers, packets, and user management. It's all set up so you can focus on the logic and mechanics of your InSim.
- Make sure your Node.js version is 20 or higher. Check using the command
node -v
, or download the required version here. - Install pnpm to manage packages and run the code:
npm install -g pnpm
. - Clone the repository or download the project ZIP (
<> Code -> Download ZIP
). - Install dependencies:
pnpm install
. - Rename the
.env.example
file to.env
and fill it with your server's data. - Start InSim using
pnpm dev
.
We've simplified development to the fullest, so you don't need to change anything in the src
folder. All the logic and mechanics of your InSim should be developed in the plugins
folder.
- Check out available examples like test events and test layouts.
- Examples include connection packets and a timer that runs every minute.
To facilitate development, the Player
is immutable anywhere in the code. Player data will always be available. Additionally, we have several useful features:
- Translation System: Automatically detects the player's language and translates content according to the corresponding translation file.
- Player Data Saving and Loading System: All data in the
Player
class is saved in a.json
file in thedatabase
folder with the player's username. - Immutable Data System: Ensures player data integrity.
- Managed Messaging System.
- Managed Button System: With
onClick
type events. - And much more.
Instead of directly editing the Player
class, you can use methods to modify properties, as shown in the example below:
// Set '50' to this property.
player.set<number>('account.money', 50);
// Returns 50.
player.get<number>('account.money');
// Deletes the 'money' property, and it returns null.
player.remove('account.money');
// Deletes all properties.
player.clear();
These methods work for any data related to the Player
class, for example:
player
.setName('MrSev7en')
.set<boolean>('is_owner', true)
.set<number>('bank.balance', 100)
.set<number>('horse_power', 500);
Feel free to create an Issue
on GitHub or contact me on Discord: @MrSev7en
.