ScoreboardScreenReloaded

What is it?

 

    Unlike the ordinary scoreboards, you can set up more fancy looking scoreboard that posses the value under the key and give animation to it if you are willing to. You can also create your own animation using full Javascript to come up with your own list of strings that will be consecutively shown to the users.

 

 

Feature:

 

    Anti-flickering system.

    Fully tested in Spigot/Bukkit server and Bungeecord environment

    Simple yet powerful

    Depends on PlaceholderAPI

 

Install:

    

    Both GLib and ScoreboardScreen should be present. You can find both files in the Files tab above.

    You also need placeholderAPI. You can easily find it everywhere on the internet.

 

  - You must have to use this plugin with GeneralLib.jar that is in the very bottom of the Files section.  It's surprising how nobody downloaded the dependency at all!!!

 

Setup:

 

    Setup is quite intuitive, and you will have no problem setting them up. Most settings in config.yml is not used, so you don't have to touch it.

 

    In scoreboard.yml, you will have to make your own scoreboard there.

 

    There are two sections present in scoreoboard.yml: Title and Objectives.

    The Title is the title of the scoreboard, and Objectives is where you put actual values to be shown to the users.

 

   In our example:

 

Title:
  Value: YourServer #be careful that the scoreboard title has length limit!
  Animation:
    Value: exampleAnimation.js &7 &a #scriptName, param1, param2, ...
    Tick: 5 #animation interval (will run per 5 tick). 5 if not specified.
Objectives:
  Something: #Name of objective
    Value: 'aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd' #value for the objective
    Animation:
      Value: longString.js 20
  PlayerName:
    Value: '%player_name%'
  Longer:
    Value: '1234567890123456789012345678901234567890'

     Each 'Contents' again has two parts: Value and Animation.

 

Change since 2.1.0: 

    - Name of objective will not be shown on the actual scoreboard. This means that you have to add every single likes of scoreboard one by one. But it will gives you more accessibility to make your own pretty looking scoreboard!

 

    Usually, it's not necessary to put Animation for the Contents, then you can put only Value. That will show up to users without any animation.

    But, if you want animation, Animation also has two parts: Value and Tick.

Title:
  Value: YourServer #be careful that the scoreboard title has length limit!
  Animation:
    Value: exampleAnimation.js &7 &a #scriptName, param1, param2, ...
    Tick: 5 #animation interval (will run per 5 tick). 5 if not specified.

     Like this, you can specify what animation script to use, its arguments, and the interval as tick.

     If you take a look at the animation/exampleAnimation.js,

 

function animate(str, primary, accent){//any script file should have function named 'animate' which is the entry point of script
	//first param(required) - it's the original string that is not yet animated. (the Value: part of scoreboard.yml)
	//second+ params(optional) - the parameters that you defined in scoreboard.yml. (primary = &7, accent = &4 for this example)
	primary = animate.color(primary);
	accent = animate.color(accent);
	
	//array of string that will be shown
	//animation order will follow the index of array
	var strs = [];
	
	for(var i = 0; i < str.length; i++){
		var temp = primary;
		
		for(var pos = 0; pos < str.length; pos++){
			if(pos == i){
				temp += accent + str[pos] + primary;
			}else{
				temp += str[pos];
			}
		}
		
		strs.push(temp);
	}
	
	strs.push(primary+str);
	strs.push(accent+str);
	strs.push(primary+str);
	strs.push(accent+str);
	
	//finally, just return the array
	return strs;
}

animate.color = function(str){//a simple function to convert color code
	var ChatColor = Java.type('org.bukkit.ChatColor');
	return ChatColor.translateAlternateColorCodes('&', str);
}

 

    as default, you need to make a function named 'animate' in order for the ScoreboardScreen to access the Javascript file. The first parameter is always the original string that should be animated, and second, third, or more are optional parameters. 

 

    as Value section has exampleAnimation.js &7 &a, the first parameter 'str' will be "YourServer" as that's the value of this Contents, and 'primary' and 'accent' will have &7 and &a as passed as parameter.

 

    And finally, you have to return the 'Array of String' that will be shown in the scoreboard consecutively. That's all!

 

Commands:

 

    /ss reload -- reload configs


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files