Code Monkey home page Code Monkey logo

Comments (4)

Moderocky avatar Moderocky commented on August 10, 2024 1

If possible, I think we should add a built-in section to tie this to an existing Bukkit event, perhaps with a class[es] section.

I'm imagining something like:

[local] [custom] event %string%: # <- name is now here
	patterns: # list of patterns, required
		# patterns
        classes:
                org.bukkit.event.YourEvent # will make this behave the same as using "on YourEvent:"
	event-values: # list of types, optional
	parse:
		# code, optional
	check:
		# code, required

from skript-reflect.

TPGamesNL avatar TPGamesNL commented on August 10, 2024

solved:

[local] [custom] event %string%: # <- name is now here
	patterns: # list of patterns, required
		# patterns
	event-values: # list of types, optional
	parse:
		# code, optional
	check:
		# code, required

will also add a pattern: #pattern as an entry, not a section

from skript-reflect.

TPGamesNL avatar TPGamesNL commented on August 10, 2024

At first I wasn't sure about where to initialize event-values and extra data with the classes section, now I think there are 2 possibilities:

  1. Have an expression like event-caller / calling event which can be used in the check section to set event-values and extra data.
  2. Have a prepare section or something alike where the event-values and extra data are set, with the event expression. This section will only be run if the event was called by an event in the classes section.

Also maybe use event classes instead of classes

from skript-reflect.

TPGamesNL avatar TPGamesNL commented on August 10, 2024

At first I wasn't sure about where to initialize event-values and extra data with the classes section, now I think there are 2 possibilities:

  1. Have an expression like event-caller / calling event which can be used in the check section to set event-values and extra data.
  2. Have a prepare section or something alike where the event-values and extra data are set, with the event expression. This section will only be run if the event was called by an event in the classes section.

Also maybe use event classes instead of classes

Nvm not doing that, as it can easily be done in a seperate trigger

from skript-reflect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.