ClassySK by novystxr

Object orientation for skript in the form of classes

Events

0

Expressions

6

Effects

2

Conditions

1

Types

3

Sections

1

Structures

1

Total

14

1.0.2 Hotfix 1 day, 4 hours and 13 minutes ago

- fixed an issue where classes would be registered before methods/field were validated meaning if it failed you would get 'A class named '%s' already exists' error. whoops

View Update

1.0.1 Hotfix 2 days, 1 hour and 57 minutes ago

Changes:

- Fixed index out of bounds exception when performing an add/remove from a single field containing no value
- Changed the method call pattern to support call chaining
- Method arguments are no longer internally formatted as lowercase, which could potentially cause issues

View Update

1.0.0 Full Release 2 days, 20 hours and 18 minutes ago

1.0.0 Full Release

Changes since the last pre-release

- New instance now supports nested sections. For example:

set {_instance} to new instance of Example:
myField: new instance of Example:
otherField: 1

otherField: 2


- Methods now support keyed expressions for list arguments
- Runtime integrity check for field/method calls: prints runtime errors if the signature at runtime isn't assignable to the type reported at parse time
- Class de-registration now happens cleanly every time the structure is unloaded, no longer needing a separate clean-up listener and reducing the chance of stale classes being left in server memory. Static fields and tracked instances are now stored independently.
- Class Wrapper has been changed to Class Reference since it no longer actually wraps an instance, this has been reflected in patterns. The class reference object is planned to be used in future updates as an entry point to reflection.
- Minor method optimizations

Features included in this version


- Fields and Methods (can be static or non-static)
- Public/Private access modifiers
- Serialization for instances (can be saved after restarts)
- Parse time instance type guessing (with optional [class hints](https://github.com/novystar/ClassySK/wiki/Class-Hints))
- Ability to get the class of an instance and check what type it is
- A new instance section where you can specify initial values for fields

View Update

Pre-release #2 14 days, 1 hour and 27 minutes ago

Potentially Breaking Changes
Class Options have been outright removed. I decided to remove them while the addon is still in pre-release since they were sort of a bandaid solution for things that should really be fleshed out features. I have plans to incorporate the same functionality in better ways (like additional keywords.. etc)

Other Changes:

  • Added -> to the method return pattern so now you can do public myMethod() -> boolean
  • Instead of if {_instance} is an instance of MyClass you can now also do if {_instance} belongs to MyClass
  • Fixed a bug with the cleanup manager where it would throw an exception if the script of a class was deleted or renamed without reloading the script.
  • Now checks the case sensitive config option rather than case-insensitive variables for if classes/methods/fields should be case sensitive.
  • Internal rework of the class structure, better entry validation and actually fails to parse if there was an error. Additionally, SecMethod and EffField are no longer registered globally. In theory this should ensure conflicts dont happen and slightly reduce parse times.

View Update

ClassySK 20 days, 22 hours and 33 minutes ago

ClassySK is an addon that adds proper object orientation capabilities to skript in the form of classes. Allowing you to write powerful, defensive code and explore OOP concepts within skript!

Roadmap
Nothing here is set in stone but these are my future ambitions regarding the project (in no particular order)
- Inheritance: extending other classes
- Abstract Methods: unimplemented methods that should be implemented by inheritors
- Constant fields: fields that cant be changed after creation
- Transient fields: Fields that don't get saved
- Method and Field Reflection
- Custom types (maybe): I have an idea to possibly achieve this using bytebuddy and converters but it is unlikely to happen until skript supports clean type deregistration.

Code Examples

class SmartActionBar:
public player: player
public refreshRate: integer = 1

private isActive: boolean = false
private values: strings

public play(value: string, duration: timespan):
add {_value} to self::values

if self::isActive is false:
self::start()

wait {_duration}
remove {_value} from self::values

public start():
set self::isActive to true

while self::isActive is true:
if size of self::values is 0:
exit loop

set {_text} to join self::values with "&7 | &r"
send action bar {_text} ? "" to self::player

wait self::refreshRate*1 tick

send action bar "" to self::player
set self::isActive to false


set {-actionBar::%player%} to new instance of SmartActionBar:
player: player
refreshRate: 1

{-actionBar::%player%}::play("<red>cool text", 3 seconds)

View Update

© Copyright 2014-2026 skUnity

All rights reserved.