#help-development
1 messages · Page 1491 of 1
otherwise make a custom event
how
do i just start polling
"is air gone is air gone"
Ah idk don’t make a custom event, you need to edit the players attributes.
yes thats one way to do it
he wants to listen to when it changes
this isnt essential at all to my plugin
not always change it
but im surprised it doesnt exist :p
cus it would be nice
oop
foundthe event
:p
Ah I didn’t know that was in the newest version but anyways setair is called which updates the entities metadata
spigot awesome
pog
in actuality you were correct
this was a HumanEntity that has the .setremainingair method
i can just do instanceof tho
wait we wouldve had to inject bytecode into the method
I just assumed it was set air, and ik water breathing shit has to do with entity meta data packet/ the data watcher
to call our event if it didnt exist yet
how do you inject bytecode
fabric does it with mixins
I mean you too can use Mixins
like they inject a method call to your method in your selected method
wait does spigot also have them?
that would make creating efficient events easy
without having to poll them constantly
Yes I think so
nice
iwill be setting player invulnerable in hub anyways
Add it yourself here are somethings you can look at:
https://github.com/SpongePowered/Mixin (Mixin source)
https://github.com/LXGaming/BukkitBootstrap (Outdated bootstrap for spigot mixins)
but it will be nice to have no air bar changing :)
tysm guys
Yw make sure you test it
I’m kinda interested if that works
just did and realized i forgot to cancel event
it wasnt working lets see...
Lmk
muh server crashing wtf i do lol
Is it the cast
possibly
this happens on join tf
Is there a way to get the players data watcher?
Might be in craft player I mean if so. Find that setair method
And see what they do with the data watcher and see if you can replicate it
Just by adding to the data watcher in the exact way
lol
server hates me rn
WTF that listener was crashing server
Debug it see where it makes it to
does this cast look sussus amogus
i check if instanceof before casting :p
It’s fine
LOL the second i jumped in water the server crashed
thats why my rejoins screwed server
i was in water
Are you sure that 10 is valid - try 1
No - I don’t think that is weird
Why not cancel the event?
^^^
because it will fire itself
i would assume
What?
ohhhhh shit ur causing a stack overflow
oh boy
but i am not cancelling it rn
That’s probs why it crashes
oh shit
Just cancel
Cancel it instead of setting
i just realized
maybe change the air with nbt
LOL
so it doesnt fire the event
No need to set the air
nah i dont think so
think so i was spamming /reload and it kept going down
Hello, does anyone know why do I get this error?
Show code
u have nullptrexception somewhere in ur event handler
i asusme
Not really
It's not a nullpointer
ok it is different
.
Ouh sorry didn't see that
A min
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hmm that's curious
my onhunger thing
does not cause stack overflow
OHH
i'm using e.setfoodlevel
(event method)
which likely changes the value
instead of essentially calling itself
.setamount
maybe that's it?
saw earlier, ignored it because was ambigous
ahh ok
it's 1:40AM
will continue this in the dawn
goodnight
Looking at the TAB code atm. Looks like the property is null
wait how can it be null?
The property isn't set yet
Well I recommend you head over to the TAB discord
They can probably help you better
I haven't been following Spigot stuff lately, what's the (planned) minimum version of Java for 1.17? I saw something about Bungeecord and Java 16 on the website.
How do I avoid "Command dispatched Async" error
Yeah and you're doing it async
Oh does it? 😮 the last news I was following was that a certain Spigot fork was pushing for Java 11
Yeah that a while ago
prior to the java 16 announcement afaik
^
What do I do then
Call it sync
Oh that's really pleasant surprise 😄
How would I do that?
Can't I just use java runnable?
I already identified so many places in my codebase where it can be expressed as a record
If you make it run on the main thread yes
You don't
i do
Well you can't avoid that error then
lmao no
You're messing with compatability
and possibly breaking things
so yeah ofc it will warn you
.
i found this hardcore plugin that puts you into spectator mode when you die the 3rd time, but you cant fly through walls or go through any blocks, ive looked at the sourcecode and the only thing it seems to do is p.setGameMode(GameMode.SPECTATOR)
does anyone know how i can replicate this?
How can I add this?
add what?
Send the plugin
I would say it is utf-8 character of green circle in scoreboard team prefix?
yeah, not sure if this specific character, but I would expect it is done this way...
line 62 in PluginEventHandler is where i think it happens
i dont even know if its intentional but its something cool that i would like to be able to do too
np :)
Yeah I don't see anything special
might be because theres no delay between respawning and getting put into gmsp and bukkit is glitching around
From what I can find online you have 2 options:
Listen to the PlayerMoveEvent and cancel if they go in to a block
or
use packets to make the client think it's in sepectator mode while the player actually is in creative mode
noclip may be maintained separately from gm3 in player abilities
it isn't 😭
how can I delay this? I've google a lot about using bukkitScheduler (and tried it) no error on IDE but in CLI and I get bunch of error.
Can anyone help me?
I want to delay some methods inside PlayerJoin()
this code is just registering your listeners. You don't want to delay the initial registration
I want to delay some methodes inside PlayerJoin*
yes but then this code snippet is useless
you dont delay the registration you delay inside the eventhandler annotated method within playerjoin class
Where do I start, I tried to follow some guide in google but I failed. Thanks for helping btw 😊
What did you want to do?
delay some method inside PlayerJoinEvent
Have you ever worked with the BukkitScheduler?
I has, but I didn't get it right
Hmm I can pull out an example
@EventHandler public void onSomeEvent(SomeEvent event) {
Bukkit.getScheduler().runTaskLater(JavaPlugin.getProvidingPlugin(this.getClass()), () -> {
yourDelayedMethods();
},20L*seconds);
}
I’m on mobile so might have spelled something erroneously

I really don't know how I can't get it right.
thanks to you 🙂
Hey, someone know if spigot 1.17 will have API breaks ?
Spigot is working towards keeping version compatibility with that said there’s a big likelihood stuff won’t break but on the flip side no guarantee some stuff will work as usual.
ok thx
it makes it synchronized
and that means?
that it's run synchronously
It locks the method such that it can’t be executed concurrently
confusion++;
google it
you'll find a guide
if you have questions about the guide you find, ask them here
but we don't want to re-write or copy the guide for you
so basically it makes it so that there can only be one of itself be running at the same time?
to prevent race conditions
not exactly, but close-ish
the method itself can still be run as many times at the same time as you want
but all of those method invocations must be on the same thread
I see
that is, the method can still recurse, in other words, call itself
but if another thread tries to call the method, that other thread will halt
and wait until the currently executing thread returns from the method
this prevents two threads from fucking with not-thread-safe state and shit at the same time
How can i teleport player to default spawn location?
Will this work? p.teleport(p.getWorld().getSpawnLocation());
Yes I don't see why not
Depends on when its called
Wdym
I made a spawn listener so if the spawn isn't set it'd teleport to default world location
Just wanted to know how to teleport a player to default spawn location
Yes that should work. There are certain times you can;t teleport a player, in specific events is all.
?jd
package index
?paste
declaration: package: org.bukkit.event.player, class: PlayerRespawnEvent
if (!p.hasPlayedBefore()) {
teleportToSpawn(p);
}```
You may want to cache that config
can anybody help me? i cant understand whats that error it is.
what error?
java: constructor Metrics in class org.bstats.bukkit.Metrics cannot be applied to given types;
required: org.bukkit.plugin.java.JavaPlugin,int
found: org.inventivetalent.advancedslabs.AdvancedSlabs
reason: actual and formal argument lists differ in length
i can`t what is error mean is...
can you send the code snippet that shows this error?
okay, wait a while
i think that synchronized means that the actions are mirrored across all cpu cores to prevent multithreading problems
What
try {
new Metrics(this);
IDE keep saying this is part of the error cause... but i imported craftbukkit, so the import isn`t problem.
it expects second argument which should be int...
you also need a plugin id from bstats
does anyone know a good java javascript engine
so i can run js from java
wait wrong channel
whatever
nvm
not wrong channel
so, put int that part? or int plugin id bstats?
I don't know metrics plugin, but new Metrics(this, 0); should at least compile
provided that this extends JavaPlugin...
oh, thank you. i success compile
Hey, what's the the recommended method to create commands (with modern tab completion in colors, etc)?
MyCmd cm = new MyCmd();
PluginCommand command = getCommand("myCommand");
if (command != null) {
command.setTabCompleter(cm);
command.setExecutor(cm);
}
where MyCmd is class implementing TabCompleter and CommandExecutor
net.minecraft.server.worldserver is no more use on 1.16.5?
I don’t think the tab completer line is necessary
I don't know, but I know it works this way for me :D
You only need setExecutor
Also TabExecutor (:
wut? :D
oh, didn't know about TabExecutor, thanks!
Do you really need a different class for executor and tab executor
yeah, may do it, but I will wait for 1.17... and do it after the release...
although there probably won't be any conflicts anyway... but why risk it :D
No you can do it in the same class, just implement TabExecutor and CommandExecutor both
Spigot provides apis for mc right?
Yes, that is why I was asking
Yeah essentially an abstraction of the Minecraft server implementation sepikill
TabExecutor extends CommandExecutor, TabCompleter
hi, so whenever i have a playerbedenterevent, it gets called whenever the player right clicks on the bed and not whenever they actually enter the bed, how do i fix this?
uhm
[15:31:08] [Server thread/ERROR]: Error occurred while enabling MagmaBuildNetwork v1.0 (Is it up to date?)
java.lang.NullPointerException: null
at io.github.FourteenBrush.MagmaBuildNetwork.DataManager.saveDefaultConfig(DataManager.java:53) ~[?:?]
at io.github.FourteenBrush.MagmaBuildNetwork.DataManager.<init>(DataManager.java:19) ~[?:?]
at io.github.FourteenBrush.MagmaBuildNetwork.Main.onEnable(Main.java:31) ~[?:?]
Line 51-58:
public void saveDefaultConfig() {
if (this.configFile == null) {
this.configFile = new File(Main.getInstance().getDataFolder(), "config.yml");
}
if (!this.configFile.exists()) {
Main.getInstance().saveResource("config.yml", false);
}
}```
Is main.getInstance null
Are you calling this code before you assign that
I want you to answer
shit
and now i'll retry
now its fixed but i have this
Error occurred while enabling MagmaBuildNetwork v1.0 (Is it up to date?)
java.lang.NoClassDefFoundError: io/github/FourteenBrush/MagmaBuildNetwork/Listeners/TradeListener
at this line
private DataManager data;
inside onEnable():
this.data = new DataManager();
Are you sure that you are providing the class in the jar?
And what is the previous error? NoClassDefFoundError is always preceded by another error
wdym? a tradelistener.class?
io/github/FourteenBrush/MagmaBuildNetwork/Listeners/TradeListener.class in this case
yes it is there
would be too easy
the previous error is one from another plugin that doesnt find a class definition either
i think i found it
only viaversion is doing strange things
Does someone know how to check if world already exists in server's folder? (or if I use WorldCreator.name(name), will it first check if world is already created?)
i dont think its viaversion which is doing weirdos
Get the directory, check if there’s a folder named a string your looking for and go from there
?paste
Read the javadoc. WorldCreator will load a world if it exists, else create it
I read all docs about WorldCreator but I didn't find it
But thanks
Highly doubt you red all docs this fast
I read it yesterday
can i load worlds on requirement
like see
i have world 1
players joined world 1 and now its full
i want a new instance of world 1 to fit the new members
how can i do it
i looked up the docs but didnt get something i want
is it possible to split commands into their own files?
like have each command be its own class file in a package somewhere
yes
make a onCommand
then do whatever you run for that command
then in your onEnable, set that class as your commands executor
thx
Is there a maximum amount of .replace you can have on a string?
depends on how sane you are
im using this
and it only replaces some of the placeholders, and it changes the order i place them
Use StringSubstitutor from Apache Commons Text. https://commons.apache.org/proper/commons-text/
it works the best so you're not having to do .replace for everything
you can also use string.format too
thanks
isn't it using regexes which are not the best thing in the world?
Though I guess Apache commons is going to do the same thing
Yes, they are very good at killing performance if used unwisely
Though this is paranoid optimisation I guess
like this?
Dont worry, its just a discord webhook that will announce probably only 5 times a day
But i have it in my pom
you shaded it right?
How would i set it to shade?
But i am
you arent using it correctly
hold on
and also whats with the finalName 🤔
remove that
@fickle helm try with <scope>compile<scope>
its always
by default set to compile
so that wont change anything
probably wrong ping also too
Yes sorry bbuffalo lmao
wrong p word. lol
my bad dud
I was already looking at this channel anyways
is it true that spigot 1.17 is going to require java 16? if so, does anyone know what a JPMS module is?
I've been staying in java 14 because some of my plugins use Nashorn (javascript) and if i need to update to java 16, then i think im going to need to figure out how to use openjdk's Nashorn, or possibly an alternative. Any info will be much appreciated.
Yes
Spigot 1.17 requires Java 16
oh
also, thats wrong syntax anyways you forgot a slash
so that wouldnt work
make sure you are using the correct jar too
if there's a natural cave and there's an empty block then it is cave_air
Not sure why spigot includes it then?
What do you mean
Because it’s never gonna be used
what else is there to explain? I think it is rather self explanatory
I just found it strange sorry
can be used to determine if a coordinate is inside a cave
Ah alright
some time around the nether update mojang made 2 extra types of air to make it easier for them to generate caves and such
may have been before that actually, hmm, i don't remember when it was
So this supports brigadier ? 😮
no idea, never used brigadier, I use pure spigot/paper
Brigadier can be implemented with the command executor as the dispatcher so yeah it sort of supports it
player.getLocation().add(x, y, z) @iron condor
Though afaik not with traditional spigot api
thanks
Alright thanks
Does anyone know why I get a NPE when I register my placeholder at PlaceholderExpansion line 132?
Send the stacktrace
CandySkyCoins line 98
@ivory sleet new CandySkyCoinsPlaceholder(this).register();
And if u send that register method
If I was going to have a guess
Your plugin loads before PlaceholderAPI or smtng with plugman might mess with it
Send the papi expansion class
@ivory sleet add me it’s comp
@ivory sleet https://mystb.in/BreaksExpectationsAppointed.http
I am curious to see the register method also
sysdm, can this be removed getRequiredPlugin() { return "CandySkyCoins"; }
Yes
try it without that method
It didn't work when I tried it before
What does getPlaceholderAPI return
public final PlaceholderAPIPlugin getPlaceholderAPI() {
return PlaceholderAPIPlugin.getInstance();
}```
Really feels like that plugin instance is null
Yup
Go for it gl 
Thanks man
why did you add me
It’s bomp
Oh
Discord hates me that’s why lol
how do i have a command take args?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Oh sry for the long url lol
so im having a hard time understanding how instances of classes work, im used to think that a function runs when called, recently i was told this is not how it works, that "new" calls a function and creates an instance of a class, does this mean that the entire class runs or just what i call (line by line, thats why the return, so this doesnt create a new HashMap)
but i think thats wrong?
When you create a new instance of the class, whatever is in the constructor is executed
if it does run the entire class, how do returns work? or it goes line by line creating this methods
Your HashMap is not static so a new Map is created in every new Class
and this is why the hashmap is empty
you have to initialize it using a constructor
SpawnParticle spawnparticle = new SpawnParticle();
spawnparticle.put(player.getUniqueId, particle)
I think
like
public class MyClass {
public MyClass() { // this is my constructor
}
}
No, it just calls the constructor
no, he didnt initialize his map
this wont work
oh thats whats everywhere? constructors? the
public void setPlayer(Player player){
this.player = player
}
for example
so it doesnt run
unless you call it
that is a setter method
i've found a plugin on spigot that shutdowns the server instead of just disabling itself
so if i make it static
why does everyone hate static
Have you looked at a Java tutorial?
lamo
Before getting into spigot
omg
what
a great idea
thats what i was missing
the tutorial!
So, you know what a constructor is? Right?
Wow? You could've done that months ago and people like you wouldn't make us annoyed
I would very like to pin this message
A Java constructor is a special method that is called when you create an instance (object) of a Java class. The purpose of a Java constructor is to initialize the Java object before the object is used. This Java constructor tutorial explains how you declare constructors in Java, how constructors can call other constructors etc.
almost
Ye give them a look
how do i give somone red stained glass? whats the metadata fo it?
yeah
1.8.8
legacy :3
nvm i use the short number after the :
Static has its purposes but you don’t just do it without good reasoning lol.
ah but i see it a lot in a lot of codes
like random plugins
that use static
That doesent make it proper
You don’t just use static if you need something in another class. It depends what it is/ what purpose it’s serving
do you have a library to recommend to send messages in rich format (with clickable links for example)?
Hey Does anyone know how to create mobs and items with your own textures in Spigot?
if there are no members/used purely for simple util then static
if variables or members change then nonstatic
its also more scalable, as my dad says lol
let's go for adventure
I mean realistically everythint should be immutable anyways there are cases tho for everything
why
wait
does static or nonstatic mean that
They wouldn't have put 'static' in the language if they didn't want you to use it. 🤓
Why was WrapperPlayServerUpdateSign removed in ProtocolLib (PacketWrapper)?
Thats more something you would do in a mod instead of a plugin
why when i try to upload an icon to my plugin crashes the browser?
Ey guys, is there anywhere on the internet that lists all items that have renamed namespace IDs and which versions they're on?
What would be the best way to make 3 entities into one? Say I wanted to have 3 armor stands in a line, not mounted, just 3 armor stands. Is there an easy way to link them together into one entity? Would I have to just listen for ones death and kill the others?
nvm, solved
Can someone tell me when the blockexplosionevent is registered?
I exploded a few blocks and it never registered lol
I think it is closer to like a bed exploding
TNT does not explode as a block but simply converts to a TNTPrimed entity, which then explodes
You should be using EntityExplodeEvent, as lynx said
there is a point where the tnt spawns the TNTPrimed
which then is an entity
Yeah it can
or it implements cancellable so you could just cancel it if you want it to do nothing at all
i need to check if it contains armorstand
but i cant check if it contains material.armorstand
armourstand is an entity afaik
damagetype or whatever
My armorstand is invulnerable
and i want it to only be destroyed
when exploded
thats the thing
Im looking for events
Ok, so listen for damage event
have not invunlernable
well, implement invulnerability yourself
and cancel if it is not an explosion
ye
yeah what he said
Oh yeah
havent thought bout that lol
Ill try it, but one quesiton
if i want to check
if a list contains specific block
whats like the enum for that?
Theres no BlockType
or Block.
you have to loop
loop through blocklist
blocks are instances, not enum constants like Material
then check material
you'll have to check their individual location/metadata
yeah whatever you wanna identify them by
yep,
I mean as i thought its refering that material is incompatible for block
but theres no errors
i mean its a warning
for (Block b : e.blockList()) {
if (b instanceof ArmorStand) {
System.out.println("its armorstand");
}
that doesnt sysout nothing when i explode armorstand
can a block even be an ArmorStand?
Well you can place down an armorstand
like other blocks
so e.blockList does not containt armorstand
What exact class are you importing?
even if tnt explodes one?
for (Entity entity : entityIterable) {
if (entity instanceof ArmorStand) {
//
}
}
Either way it is likely wrong, you would likely need to check BlockMeta (or BlockData)
let me see
EntityExplosionEvent
?jd
package index
Package org.bukkit.entity
Interface ArmorStand
You are surely using the wrong interface
Nah i was just talking crap what isnt true
I just understood smthing wrong
i meant that
i thought the list will contain armorstand
but it doesnt
yea it cannot since incompatible return types
Im trying to check this
for (Block b : e.blockList()) {
if (b instanceof Skull) {
System.out.println("skull");
}
}
but that returns nothing aswell
but skull is a block
oh yeah
cuz
It sysouts player_head
not skull
yeah now it works i used b.gettype and changed skull to material . player head
thanks.
omg geol you're alive (i guess lol).
why is this actually breaking blocks so weird?
private final BlockFace[] blockFaces = new BlockFace[]{BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.EAST, BlockFace.DOWN};
private void cutDownTreePart(Player player, Block startBlock) {
if (isLog(startBlock)) {
for (BlockFace face : blockFaces) {
Block newBlock = startBlock.getRelative(face);
if (isLog(newBlock)) {
newBlock.breakNaturally();
cutDownTreePart(player, newBlock);
}
}
}
}```
for example with normal trees (oak/birch) it only breaks like 2 blocks.
for dark-oak-trees, it breaks like 5-6 blocks.
perhaps because of the initial if statement
After the new block is broken it will be air, thus failing that test
yeah, that is def. the reason for it
shouldn't the for-loop let it go into every direction (like for example y+1 everytime)? and they're definitely not air
private void cutDownTreePart(Player player, Block startBlock) {
if (isLog(startBlock)) {
for (BlockFace face : blockFaces) {
Block newBlock = startBlock.getRelative(face);
if (isLog(newBlock)) {
// Block is still a log
newBlock.breakNaturally();
// block broken, now air
// calling cutDownTreePart calls if (isLog(newBlock)), which will now return false, thus not recursing further
cutDownTreePart(player, newBlock);
}
}
}
}
Im spawning a skullinto the world and im setting the persistentdatacontainer. When i sysout the keyset, it works perfectly and the sysout shows all the keys. However, in entityexplosionevent, when my skull gets exploded and i sysout the keyset, it returns nothing.
Thats a problem because i cant keep my player head in the world depending of its persistentdata
even if tnt explodes it
wow, it actually works. yaaaaay
here's the code i used:
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
if (e.getPlayer().isSneaking()) {
if (isLog(e.getBlock())) {
cutDownTreePart(e.getPlayer(), e.getBlock());
}
}
}
private final BlockFace[] blockFaces = new BlockFace[]{BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN};
private void cutDownTreePart(Player player, Block startBlock) {
if (isLog(startBlock)) {
startBlock.breakNaturally();
for (BlockFace face : blockFaces) {
Block newBlock = startBlock.getRelative(face);
if (isLog(newBlock)) {
cutDownTreePart(player, newBlock);
}
}
}
}
oh wow thats insane
hahaa
thats mc looks better than real life
lol
mine is a 8pixel texture pack
if i could i would use seus instead
that looks like sht
but nah, amd doesnt like that
it hates seus so much, it instantly crashes my game
BeyondBelieve looks cool as well tho
how do u make ur message like that?
i need to know
which message dym
you mean this?
lol
then, what matt said
@EventHandler
public void onJoin(PlayerJoinEvent event){
Player player =.getPlayer();
if(!( player.hasPlayedBefore())) //send to hub or whatever
}
private void getPlayer() {
}
}```
what is wrong
with the code
i want to make it so when new people join they spawn at the spawn that i set it to
then the code doesn't look that wrong. i just dont know what the getPlayer() should do lol
me neither
i won't have this conversation again
why do you have it then lmao
what
well consider using smt like this:
@EventHandler
public void onWhatever(PlayerJoinEvent event){
if(!event.getPlayer().hasPlayedBefore()) event.getPlayer().teleport(new Location(Bukkit.getWorld("worldname", x, y, z, yaw, pitch)));
}
where yaw and pitch are optional
nevermind, you have to use if(!hasPlayedBefore()){, i forgot the ! on begin
oh ok
edited it*
it has many errors
shouldn't. imported everything?
wdym
you have to import the classes, that you use
import the org.bukkit.Listener thing;
public class joinEvent() implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent event){
Player player =.getPlayer();
if(!( player.hasPlayedBefore())) //send to hub or whatever
}
}
in main:
public Main extends JavaPlugin {
//getServer.getPluginManager.registerEvents(new joinEvent(), this);
}
i dont understand im like new to scripting i started 20mins ago
etc etc
no offense, but it looks like you probably should learn a bit of the really basic java
before starting with spigot
but i just want to make plugins for my server
i have to otherwise i cant run my server
but you need to learn java, which is what you make plugins with
yeah, but that requires java knowledge
wth is java
oh god
i have heard about it
a type of coding ig
srry for my stupidnes
java is a coding language in this case tho.
java is the coding language in which minecraft & spigot are built on
like c++, c#, python, etc
ye but i dont speek coding language lol
you will if you want to make plugins
then you shouldn't make plugins lol
that will probably take ages for me to learn
i have to much school to learn this
then dont make plugins, have someone else make them for you, or take the time to learn
this is extra knowledge
it takes 30 minutes tops to learn basic java, and spigot/bukkit api
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
im not rich
I already sent you tutorial links ._.
ik
also, if you are a complete beginner, i prefer https://www.w3schools.com/java/
Why are you here asking then?
then maybe stick to youtube tutorials. but watch out, dont look for Learning Java in x Hours that's trash stuff
i asked for whats the problem with the plugin and then we came into this
oh ok lol
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yeah, because people in here don't like to spoonfeed with code
(what i did btw)
lol
lmao
spigot has a java crash course? wow
It’s really bad
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thats actually quite cool
i probably learn better by listening not by reading
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i use intelj
you can plug the text into google translate and have it read to you
them do this
maybe use eclipse for beginning? imo, intellij is pretty much for people who know what they do
ok lol
but it depends on you pretty much
whats the difference
intellij looks a bit complicated in the first place maybe
like exporting stuff etc
but then, intellij has for example way more customizable-options via plugins and stuff
and eclipse is more like you instantly understand where to do what and how
oh ok
except writing code. thats another thing, not IDE-Related
oh srry
most people don't like that
srry
i think ill keep myself watching yt mc videos instead of coding
its way to complicated for me
and i dont have the time to learn
to much school*\
i mean, if i would be able to speak fluent english and be able to be a good teacher, i could eventually teach you a small bit, but nah sadly none of them fits to me lol
im also not english
so thats also a reason why i cant script, i dont understand alot of words
what is your main language tho?
dutch
dutch ohh
you?
german
basically dutch. in normal xd
ye lol
much stuff sounds almost the same
ye that was the first thing i thought about
no lol
and german has like the weirdest grammar i ever heard of
lebenslangerschicksalsschatz
ye its hard to learn
holy shit
i have deutsch at school
umfahren ist das gegenteil von umfahren
i can write and read pretty good
but i can't really talk, because of accent and stuff
i do understand
idc about that i have talked with many german people in german
in eglish
well, but i do. i am not that confident, that i could talk in english
i did that 1 time in vc here
oh
hahahahaa
and there were 3 people like Omg, i can hear that german accent, and i was just yeah, of course you can
german accent is just like speaking english in german
wanna here my accent lol
but idc about german accent cuz i have dutch accent
maybe almost the same
well, my accent is just like Hey, Ai Wod laik to took to ju
hahaha
like that full german
really
and i'm sitting there, shaking, and thinking what can i say now
no way ahhhhhhh i'm out
ye i have that to
no hear me
not u talk
but when i get comfortable with people then i dont have that
ye it is
who is on ur pf picture
i'm not a girl tho if you think so xd
maybe i have
who knows
maybe the cat is a girl cat
:oooooo
well, pretty much yeah
vc
xd
cmon, lemme come in xd. and hope that 10 seconds later, there's not like 10 people inside it just because of me
wait is it bannable to ask someone to join ur discord
look up dutch one
oh ok
lmao
ok thats awkaward ye
yeah
lol
i knew it
now we both in vc but both muted😂
at least, there are no 10 people inside, who are talking about my accent, one thing that's positive
aaand there's the first one
now someone joined
i dont think that they are in that channel because of your accent
I dont know why, but this:
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
produces this:
This is the scoreboard yml file that i had
or a pic of it
der dir das und something
GodCypher, please join vc, i am so alone under dutch people xd
hi guys, someone know some plugin that give u the variable of the idiom?
i try get {locale} but dont work in Papi
Hello, does anyone know any plugin that gives you the variable of the language that the user has to be able to connect it? I want that having the variable according to the language the npc of the text in your language (translated by me before) but I don't know which one to use, I tried to use Advanced Multi Language but idk how to used it
Wrong channel stay in #help-server and have patience
oh srry i thig that i talk about string is developed too
Player#locale
declaration: package: org.bukkit.entity, interface: Player
what would be the best way to make an antispam
like
detect if the message is similar
is there a String.isSimilar() method?
lemme checkm
if I have a command that takes a player as one of its arguments, is Bukkit.getPlayer the right method to get the actual Player object?
Yes
thanks
just make sure to null-check the return value
👍
as names that do not have a corresponding player online will return null
You need a definition for similar
i have a problem with a plugin iam making anyone interested to help me find the issuse?
THX i can fix it ❤️
i.e. if the longest common subsequence is at least 85% the length of the shorter message. Also make sure to ignore case when comparing the two messages
might want to look into something like the levenshtein distance
which is a pretty common way to calculate how "similar" one string is to another
levenshtein distance and similarity are poor ways of implementing a spam filter
as you can get past the filter by appending random nonsense at the end
^^ agreed, they are very easy to bypass
Im spawning in a skull with persistent data. When i try sysouting the persistent data in interacting event, the data is there as it should. But the data seems to be not there in entityexplode event, like it suddenly is just not there like it never existed.
Im not letting explode certain items with persistent data, but it seems to not work as the item what should have persistent data doesnt.
Anyone has any idea?
you spawn in the flying wither skull with the respective pdc data and when it explodes it is gone ?
basically i have a mystery box plugin
it should be tnt proof
only my mystery box head tho
so it has a persistent data, always had
but in entity explode event its suddenly not there anymore
so when iterating over the blocks in the EntityExplodeEvent the skulls "tile state" does not contain the pdc anymore ?
My current code:
@EventHandler
public void onBoxExplosion(EntityExplodeEvent e) {
System.out.println(e.blockList());
List<Block> toRemove = new ArrayList<>();
for (Block b : e.blockList()) {
if (b.getType() == (Material.PLAYER_HEAD)) {
Skull skull = (Skull) b.getState();
toRemove.add(b);
}
}
e.blockList().removeAll(toRemove);
}
If i were to do skull.getpersistentdata.getkeys
it would print out nothing
An entity Skull is not a block
The entity that is exploding?
the entity that is exploding is usually creeper / tnt
oh you are blowing up a skull with another explosion
Where are you testing the PDC?
I'll try to recreate it
You mean controlling if the skull has certain pdc and if yes then remove it?
Id do it in the for loop
adding the b into toRemove only if it has certain pdc
ive tried that tho
does anyone know method getWorldProvider() is changed to what method?
that doesnt work, since printing out skulls pdc keys returns nothing
okay cannot re-create your issue
Yeah, I was going to say its unlikely as Blocks are single instance. The only ever represent one in world object.
tho I am running paper-755