-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest.ts
37 lines (33 loc) · 994 Bytes
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import * as events from 'events'
import core = require('@magikcraft/core')
import reflection = require('./utils/reflection')
;(global as any).holograms = require('@magikcraft/core/holograms').default
export function init() {
require('@magikcraft/op-all/autoload')
console.log('Registering Creative mode handler')
events.playerJoin(({ player }) => {
setTimeout(() => {
const GameMode = Java.type('org.bukkit.GameMode')
// Initial join is a bit chaotic
player.setGameMode(GameMode.CREATIVE)
echo(player, `Creative Mode set.`)
console.log(`Set creative mode for ${player.name}`)
}, 1000)
})
}
export function create() {
const core = require('@magikcraft/core')
const hologram = core.holograms
const utils = require('utils')
const p = utils.player('sitapati')
const h = hologram.createHologram({
lines: ['Yolo'],
location: p.getLocation(),
})
return h
}
export function get() {
const hologram = core.holograms
const hs = hologram.getHolograms()
return hs
}