events.listen('item.right_click', event => {
	
  if (event.item.id == 'kubejs:unstable_endershard') {
	  
	event.player.runCommandSilent('summon gateways:small_gateway ~ ~ ~ {Motion: [0.0d, 0.0d, 0.0d], color:purple ,Fire: -1s, name: "Unstable Worm Hole"}');
	
	event.player.playSound('farlanders:entity.mystic_enderman.confusion');
	event.player.playSound('minecraft:block.glass.break');
	event.server.runCommandSilent('effect give ' + event.player.name + ' champions:paralysis 7 0 true');
		
	event.server.schedule(5500, event.server, function (callback) {
	callback.server.runCommandSilent('execute as ' + event.player.name + ' run spreadplayers ~ ~ 50000 100000 false ' + event.player.name); 
	callback.server.runCommandSilent('tellraw @a {"text":"' + event.entity.toString() + ' Used An Unstable Wormhole","color":"dark_purple"}');
	  })

	  
	if (!event.player.isCreativeMode()) {
	
	event.item.setCount(event.item.getCount() - 1)
	}
	}
});