MCC code system

Im just curious for the games how they'd code something for example like when you kill someone in sky battle and it gives you points for the kill and out living people. A few of us have been stumped on it
22 Replies
Admincraft Meta
Admincraft Meta16mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by ghostjl#0
Lunaiskey
Lunaiskey16mo ago
which part were you stumped on? if you are using PlayerDeathEvent, then use Player#getKiller() so Player killer = event.getEntity().getKiller(); and if you get points on someone elses death, you would make something to keep track of if the player was alive or not, then loop through the alive players and give those points
Deleted User
Deleted UserOP16mo ago
Kinda like im general how youd set it so points would actually show up so lets say I killed someone. im stumped for coding to give that player/team points
Lunaiskey
Lunaiskey16mo ago
well you would get the player's team and then run whatever method for giving points to the team when you say show, in what way? actionbar, title, chat message? or just the actual giving the team points
Deleted User
Deleted UserOP16mo ago
scoreboard on the right side for the team points
Lunaiskey
Lunaiskey16mo ago
you could use placeholderapi
Deleted User
Deleted UserOP16mo ago
example you are on a team you kill someone the team gets points for kill and outliving players Okay do you know a kind of one?
Lunaiskey
Lunaiskey16mo ago
what? i dont get the question
Lunaiskey
Lunaiskey16mo ago
GitHub
GitHub - PlaceholderAPI/PlaceholderAPI: The best and simplest way t...
The best and simplest way to add placeholders to your server! - 1M+ Downloads - 2.5k+ Placeholders - GitHub - PlaceholderAPI/PlaceholderAPI: The best and simplest way to add placeholders to your se...
Deleted User
Deleted UserOP16mo ago
sorry i worded that so bad lol yee a plugin link lol
Lunaiskey
Lunaiskey16mo ago
GitHub
PlaceholderExpansion
The best and simplest way to add placeholders to your server! - 1M+ Downloads - 2.5k+ Placeholders - PlaceholderAPI/PlaceholderAPI
Lunaiskey
Lunaiskey16mo ago
is there a set amount of teams? like is there always the same amount of teams?
Deleted User
Deleted UserOP16mo ago
10 teams usually always the same yes so like 40 players total
Lunaiskey
Lunaiskey16mo ago
you could just use placeholder api and have something like %yourplugin_team_1% through 10, then just do something for each team like you would have to manually sort each team so they showed up in the right order of highest points to lowest points or just have them in a list and not sort them
Deleted User
Deleted UserOP16mo ago
Okay, To build on with that when a whole team is eliminated how would I prevent them from getting points? Okay I see
Lunaiskey
Lunaiskey16mo ago
you keep track of each team, and their members and when they all die just have a boolean variable isEliminated and flick the boolean and then in your loop, check the variable and if its true you just skip over it
Deleted User
Deleted UserOP16mo ago
and most should be automated or would it all be manual?
Lunaiskey
Lunaiskey16mo ago
well yeah, if you listen to the right events it should do it automatically
Deleted User
Deleted UserOP16mo ago
got it thank you so much mate :D
Lunaiskey
Lunaiskey16mo ago
if you get stuck you could post in #development
Deleted User
Deleted UserOP16mo ago
will do :D !answered
Admincraft Meta
Admincraft Meta16mo ago
post closed!
The post/thread has been closed!
Requested by ghostjl#0

Did you find this page helpful?