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
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
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
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
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
scoreboard on the right side for the team points
you could use placeholderapi
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?
what?
i dont get the question
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...
sorry i worded that so bad lol
yee a plugin link lol
https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/PlaceholderExpansion#with-a-plugin-internal-class and then use this
GitHub
PlaceholderExpansion
The best and simplest way to add placeholders to your server! - 1M+ Downloads - 2.5k+ Placeholders - PlaceholderAPI/PlaceholderAPI
is there a set amount of teams?
like is there always the same amount of teams?
10 teams
usually always the same yes
so like 40 players total
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
Okay, To build on with that when a whole team is eliminated how would I prevent them from getting points?
Okay I see
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
and most should be automated or would it all be manual?
well yeah, if you listen to the right events it should do it automatically
got it thank you so much mate :D
if you get stuck you could post in #development
will do :D
!answered
post closed!
The post/thread has been closed!
Requested by ghostjl#0