#I'm trying to make a flag system for an anticheat.

1 messages · Page 1 of 1 (latest)

steady shore
#

What I am trying to do is, If a player gets flagged, they will be flagged for a certain reason (like Reach) and it will add a flag to that player.
But I dont own the player class and can't make a value. I don't even know where to start.
The flag will have a name, a player, and a value.

dense rockBOT
#

Hey, @steady shore!
Please remember to /close this post once your question has been answered!

raw seal
#

ask better questions

#

bye

#

o/

steady shore
#

bruh

#

wtf

#

help me!!!!

raw seal
#

what you posted isn't even a question

#

it's more or less valid, english, words slapped together

#

you failed to get the point across as to what is your problem, and context of the problem

#

If i have an item, and it flies but sometimes it also walks, where is the center of gravity for pipe inside a cave of unknown density in absolute quantity

#

this is basically how your question looks to everyone else

steady shore
#

well

#

ok

steady shore
#

When a player joins, it will make a flag count

#

which would be 0

#

and once a player gets flagged

#

it will add 1

raw seal
#

sounds like a very simple problem

#

make a class Player, add a boolean with any name (the flag)

#

stamp out as many Player objects in an Array/ArrayList/whatever collection suits you

#

then, you can make a method that takes in a collection (array/arraylist/whatever) of Player objects, and filters to only get the players with the flag on

#

this filtering is a simple for loop, or, even easier, use filter with Stream

steady shore
#

its a game

#

which i making a mod for

raw seal
#

oh, Minecraft mod?

#

most work with dependency injection

#

so first, figure out which DI framework your particular solution works

#

2nd, cry because DI is terrible

#

DI fixes unexisting problem and makes code unreadable

steady shore
raw seal
#

yes

#

so learn Java

steady shore
#

im just gonna probably nest hashmaps

raw seal
#

then learn the tool your plugin project usess

steady shore
#

i cant think of any other way

#

its bukkit

steady shore
#

this is the one thing i havent been able to do

raw seal
#

the way you ask questions guarantees you're a noob

#

experts make good questions

steady shore
#

i never said im an expert

#

and im not even in highschool yet

#

so my english isn't pitch perfect for asking questions to clear intellectuals like you

alpine yarrow
#

The things u ask are covered in any minecradt guide video

raw seal
#

I'm not intellectual

alpine yarrow
#

Youre not asking a question for ur problem

#

Ure asking for a solution

steady shore
#

idfk

alpine yarrow
#

Also if u wanna work with minecraft plugins theres Servers for these especially i think

steady shore
#

but i feel like its more general java

#

its not really

#

like

#

bukkit based

#

other than the fact that its a bukkit plugin

alpine yarrow
#

And the fact ure working with classes from them

steady shore
#

but my problem would be the same if i just replaced the Player with another key

vague tree
#

<UUID, Reason>

#

Reason can be a string or a enum

#

Or if you want it to stay with the player even the server restarts

#

You can use mysql

#

Key uuid | String and in that case the easiest way to just enum.toString and put it in mysql

steady shore
vague tree
#

Ok say it all in one time what do you need

steady shore
#

i fixed it