events.listen('item.right_click', event => {
	
  if (event.item.id == 'kubejs:unstable_endershard') {
	  
	event.server.runCommandSilent('execute as ' + event.player.name + ' run summon gateways:small_gateway ' + '~1 ~ ~ {color:purple}' || '~-1 ~ ~ {color:purple}' || '~ ~ ~1 {color:purple}' || '~ ~ ~-1 {color:purple}');
	
	event.server.runCommandSilent('effect give ' + event.player.name + ' champions:paralysis 4 0 false');
	
	event.server.runCommandSilent('execute as ' + event.player.name + ' run playsound farlanders:entity.mystic_enderman.confusion master ' + event.player.name);
		
	event.server.schedule(4500, event.server, function (callback) {
	callback.server.runCommandSilent('execute as ' + event.player.name + ' run spreadplayers 0 0 5000 100000 false ' + event.player.name);
	event.player.tell(text.blue('Whoosh!'))
	  })
	
	event.item.setCount(event.item.getCount() - 1)
	}
});