#Beginner needs help
1 messages · Page 1 of 1 (latest)
?paste
oh
Basically you’re converting the Sender Object to a Player object regardless of if you know that it’s supposed to be one
that is what i am trying to say
idk if they can see this thread actually
@shadow heron
you should use
if (sender instanceof Player)
because there are commands that should be console only and player only
i did that and as you can see i checked before if sender is not instanceof player doing (!(sender instanceof Player))
So you want it to be a console command only ?
no just simply i want if the command get executed by console this gave the message of "sorry console you can't do"
That statement is only going to affect the code contained within those {}. Since you’re casting it before, it happens regardless.
@shadow heron could you please provide a code snippet so I can see what you're trying to do ?
orientate on this https://paste.md-5.net/ozugugeduj.java first
this is your class but with a better look and the fix with the cast
Sorry as i told to @rose vine i am totally boomer
Can you teach me how to do that?
The others and me will help
Do you have any past experiences with java @shadow heron
Never
any experience with programming?
How long have you been using the Spigot-API for ?
Also guys... before everything sincerely THANK YOU SO MUCH! Plugin community here just destroy new people trying to approach plugins and java
Just something like 4/5 days i want to create my own plugins
alright so a newbie
exactly
Not trying to be rude or anything, but I'd first suggest to learn java before diving into the Spigot API.
I learned java with spigot
Same, but I had some experience beforehand.
Yeah I know and I am with the opinion No Spigot Without Java
same
But sincerely for what i looked if you try and re-try and try againg you can do this!
I know learning java could be soooo much better
Java tutorial for beginners - Learn Java, the language behind millions of apps and websites.
🔥 Want to master Java? Get my complete Java mastery bundle: http://bit.ly/2tKoy8C
👍 Subscribe for more Java tutorials like this: https://goo.gl/6PYaGF
📕 Get my FREE #Java cheat sheet: http://bit.ly/2JNlQnw
⭐️ Want to learn more from me? Check out thes...
Idk if I'm allowed to post videos here, if not I'm sorry.
question: Do you wanna learn now, or do we fix your problem? (not rude)
But I watched this video when I first started, and it cleared some things up.
I’d first go through a beginner Java tutorial to learn the core fundamentals of programming
Learning declaring variables, casting, assigning, if/else statements, for loops, functions, classes and OOP, etc. will be very useful in the long run
When I started I used a resource called freeCodeCamp, they make decent introductory tutorials on YouTube though they can drag out for quite long
For the moment i can use the datatype... booleans method... so variables ext
i can't do a loop but i know for that i need an hash map
nah not really
Okay yeah you went too far without knowing the basics, and that's kind of a bad thing.
but i know there is a lot of other stuff also
do what @alpine trail said and then maybe we can help you better c:
ok I'll promise you guys I'm going to learn it
The most common loop is for, you also have forEach, while, etc..
I don't want the help for change
you dont have to do it now but yeah wourld be great. And maybe you can fix your problem by yourself
Just say me where to do it
Please name your threads more useful names in the future, thanks
it was a thread on a message so i dont think you can change it but we'll do
Yes you can
alright
Right now i have problem to take variable of player and intellij says me there are errors in the p
I just made it quickly so the main chat wont get filled up and other people can ask for help, sorry.
what error?
I think I had used something like this https://youtu.be/GoXwIVyNvX0
As I said it might be kinda long and some of the stuff in the latter half may not be too important yet
Could you provite us the error ?
Beginner needs help
and also i tried doing a NoHitDelay remake doing setNoDamageTicks(using 1.14.4) then but it wasn't working so i tried changing API in 1.8.8 and now setNoDamageTicks doesn't appears in the IDE
hey gUyS 📈📉📈📉
My error is in the compiler
IDE can't understand "p" variable i got with Player p = (Player) sender;
Maybe you're trying to use it before you assign it ?
can you send a screenshot?
Because variables can only be used after they're assigned.
^
But is 1.14 API i didn't have problems and also god command was working amazing way
So what I'd do is put the Player p = (Player) sender; at the top
Can i just screenshare you or something like that?
but after the instanceof check
if for you is good i will appreciate that
im fine