GoKart is a Minecraft plugin that allows players to ride and control minecarts with energy management and refueling mechanics. It integrates with the EconomyAPI for handling in-game currency transactions when refilling the minecart's energy.
- Ride and control minecarts.
- Manage minecart energy levels.
- Refuel minecarts at gas stations using in-game currency.
- Handle minecart behavior with realistic physics, including jumping and movement adjustments.
-
Download the Plugin:
- Download the latest release from the releases page.
-
Place the Plugin:
- Move the
GoKart
plugin.phar
file into theplugins
directory of your Minecraft server.
- Move the
-
Restart the Server:
- Restart your server to load the plugin.
The plugin does not require any additional configuration out of the box. However, you can customize certain aspects of the plugin through the provided classes in the codebase.
- /gokart
- Opens the GoKart menu where players can interact with minecarts.
-
Ride a Minecart:
- Use a Minecart item from your inventory to mount and ride it.
-
Refuel Minecart:
- Use the command
/gokart recharge
to recharge your minecart entity.
- Use the command
-
shouldJump(Minecart $entity): array
- Determines if the minecart should jump based on the current block and energy.
-
shouldDrop(Minecart $entity)
- Checks if the minecart should drop based on its current position (e.g., falling into water).
-
shouldDespawn(Minecart $entity)
- Determines if the minecart should despawn if it falls into lava.
-
getMotion(Minecart $entity): array
- Calculates the motion vector for the minecart based on the rider's direction and energy levels.
-
refillEnergy(Minecart $entity, int $amount, int $price)
- Refills the minecart's energy, adjusting the player’s balance accordingly.
-
updateEnergy(Minecart $entity, array $startPos): bool
- Updates the minecart's energy based on its movement from the start position.
-
open(Player $player, Minecart $entity): CustomForm
- Opens the custom form for refueling the minecart.
-
confirm(Player $player, int $energy, int $amount): ModalForm
- Shows a confirmation form for refueling the minecart with the specified amount of energy.
-
createBaseNBT(Vector3 $pos, ?Vector3 $motion = null, float $yaw = 0.0, float $pitch = 0.0): CompoundTag
- Creates the base NBT tag for a minecart entity with the given position, motion, and rotation.
-
setEnergyNBT(Minecart $entity): CompoundTag
- Sets the energy NBT tag for a minecart entity.
Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a Pull Request on this repository.
If you encounter any bugs or issues, please report them on the Issue. Provide a detailed description of the issue, steps to reproduce, and any relevant logs.
This plugin is licensed under the MIT License. See the LICENSE file for details.
For any questions or support, please contact me on Discord.