#help-development
1 messages · Page 1661 of 1
p a b l o
1s
if(pablo){
vibe();
}
they do
there is so much here
you dont need me to spoonfeed you links
1s
try this
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>4.10</version>
<scope>runtime</scope>
</dependency>
Do you have an example?
packets, its not a build in method. Never seen something like this.
You can always look at the src and how they did it https://github.com/NiceCraftz/TransparentHeads
I don’t see why spigot / mojang would patch it, it’s not really a big issue, and could be great for servers e.g. for transparent head cosmetics
Oh rip
hi. im new here. my server has not been working right. it loads up right but whenever anybody tries to log in it says "you have been idle for to long" any ideas?
how do I look at the source code
mc
basically im trying to make it so that dolphins are tameable and rideable
but I kinda need to look at the dolphin class
oh
I see
how do you guys make plugins without looking at the source?
or do you just do it this way
Hey so i am trying to change the skin of an entityplayer in 1.16 and for some reason i can't get it to update. Unless i am missing something i should be able to set the properties field of the GameProfile with the new skin right? here's how i tried to do that https://paste.md-5.net/usiguyasev.cpp. there are no errors but it is not changing the skin. Can somone help?
And just so you know ik that the SkinData is not the issue because that works when spawning in the entity just not for updating it and i have this method for changing the name and it works fine https://paste.md-5.net/yeqawunepa.cpp
what version do you need the source for?
full classpath?
how do I find that out
import of what
dolphin
its just an interface for some reason
wait nvm
yeah that's not nms
its an interface of WaterMob
what do you need the source for?
yeah
you shouldn't need nms for that
How do I send messages in sequences after an interaction?
Example:
Click, show message one
Click, show message two
Click, show message three
yes
dont need a command just use an event
what are they clicking on to show the message?
Example:
interact mob click 1 : send "Hello 1"
interact mob click 2: send "Hello 2"
interact mob click 3: send "Hello 4"
in sequence
yes
and return for one.
check if they click the mob and display next thing on the list
The message in sequence is canilized after the click.
lol
this
what is the issue?
sequence messages
I want to send messages like this example.
and I don't know how to do this.
ok
iterate through a list when they click the mob or whatever event your using
event > get next index on list > send message in list
I think an indexed list would be easier to use for a beginner
@quaint mantle if you still cant understand this please learn some basic java before attempting to code plugins. this is a very easy problem that only needs a basic understanding of java to do
Ok but still. im not saying take a expert java course just watch a couple of tutorials and learn the basics
Trust me it will make things so much easier
I had the same mindset at first and i kept running into simple issues like this. Once i took the time to actually learn and understand what i was coding it made everything 10x easier
i mean i learned off YouTube and google and there's nothing wrong with that if you actually do it
nice
js or java apps?
or just general java
cool
Did 1.17.1 remove packets or something
no?
theres a new class to import and there is no getHandle.playerConnection
yes its renamed
i think its b if i remember correctly
ok
thanks
yeah b returns A PlayerConnection
wont let me compile bc of it not finding the field
Can anyone help me with this?
??
ae???
public class HealCommand implements CommandExecutor{
public boolean isInt(String str) {
try {
Integer.parseInt(str);
return true;
} catch( NumberFormatException e) {
return false;
}
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if (player.hasPermission("niksplugin.heal")) {
if(isInt(args[0])) {
player.setHealth(args[0]);
player.sendMessage(ChatColor.RED + player.getName() + " was succsesfully healed!");
}
}
return false;
}
}
how come player.setHealth(args[0]);
is underlined in eclipse?!
because there is no setHealth(String)
You need to parse it
afaik setHealth(int) was dep too
How do i get the BlockPositon of a player? im trying to teleport an entityplayer and it says this The method teleportTo(WorldServer, BlockPosition) in the type Entity is not applicable for the arguments (WorldServer, Location)
BlockPosition is Craft not API
i couldn't find a getLocation or getPostion method for entityPlayer
so probably some getHandler method or something
ahh
i guess either way
im pretty sure its deprecated
RegionCoordinates regionCoords = RegionCoordinates.fromLocation(blockLocation);
at least thats what Google says it used to be
this seems to work but i can't pass in pitch and yaw
new BlockPosition(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ())
the teleportTo is asking for a BlockPostion
Yes, BlockPosition takes 3 values.
Is there a reason you are not using teh API teleport?
because it is an npc
ah
and not a real player
how does setHeadRotation work? there is only 1 float
i think i need to tp and set yaw/pitch seperatly
No clue I avoid non API
nvm i can just get the players HeadRotation
Yes as teh TP only takes a BlockPosition
now its saying i cant cast craftplayer to entityplayer
entityPlayer is NMS
getBukkitEntity (googlesays)
used to be EntityPlayer entityPlayer = (EntityPlayer) ((CraftPlayer) player).getHandle();
please help my firework not exploding, here is code: https://paste.md-5.net/epoyiboxow.pl, i am on 1.17.1
are you sure you want that level of power?
your max flight time is 1 to 129
max allowed is 128
however thats 2 minutes
power is flighttime?
yes, each point = half a second
Question: how can I reset the HoverEvent/ClickEvent when building formatted messages?
0 - 128
but java random's upper bound is exclusive
your current random picks a number between 1 to 129
yes
you add +1
so you are picking 1 to 129
0 to 128 +1
still not working
can i set power to float (e.g 0.5)?
with power 1 it works but only little particle instead of explosion what i am doing wrong?
you are creating it with a random type so its going to be different each time
its same like this
try putting the type earlier in the build cycle? Only a guess as I've not used fireworks
nothing changed
no clue then
If you are getting the same type every time, put yoru new Random outside your method
i fixed it i forgot to call method .addEffect
I'll ask again: hoverevent and click event don't go away if they're set to null in the next .append. how can I make them change?
because right now, I'm having an issue where the entire line of text has the same hover/click event as the first button, except for the second button.
the second button works properly but it goes straight back to its bullshit at the next component
did you create them all in one or did you use the ComponentBuilder to string them together?
the latter
BaseComponent[] topDivider = new ComponentBuilder().append(partialDivider)
.append(prevButton)
.append(partialDivider).event((HoverEvent) null).event((ClickEvent) null)
.append(openingBracket).color(secondaryColor)
.append(String.format("%s / %s", pageNumber + 1, collection.size() / itemsPerPage)).color(primaryColor)
.append(closingBracket).color(secondaryColor)
.append(partialDivider)
.append(nextButton).event((HoverEvent) null).event((ClickEvent) null)
.append(partialDivider).create();
BaseComponent[] titleDivider = textDivider((topDivider.length - title.length()) / 2);
BaseComponent[] titleComponent = new ComponentBuilder().append(titleDivider)
.append(title).color(primaryColor)
.append(titleDivider).create();
BaseComponent[] bottomDivider = textDivider(topDivider.length);```
you can ignore the variable names
casting null? You can;t cast null
compiler freaks out if you don't
null is literally nothing, it can not be cast. That should not even compile
how would i make a command where for example i do /discord and a message says "click here to join our discord" how would i make that message clickable so it can forward the link to them?
method overloading
there are two .event methods
that absolutely compiles lmao
I'm very suprised
the compiler doesn't understand which .event() method to point to if you don't explicitly indicate the type of the parameter
that is how compilers work.
google says you can cast null it seems, but it will be a null reference
correct
the null reference is fine - I'm just struggling to reset things
maybe i'll try an empty hover/click event
Since that's a builder why are you setting the hover and click event if you don't want them. I'd expect default to be null
because they're set in the methods designed to construct the individual components
the buttons in particular
public static BaseComponent[] textButton(String buttonText, String hoverText, String commandString, ChatColor textColor) {
return new ComponentBuilder(openingBracket).color(secondaryColor)
.append(buttonText).color(textColor)
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(hoverText)))
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, commandString))
.append(closingBracket).color(secondaryColor)
.create();
}```
anyway setting up click/hover events that do absolutely nothing worked
this only shows up over the arrow now, as it should
private static final ClickEvent CLICK_NONE = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "");
private static final HoverEvent HOVER_NONE = new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(""));```
replaced null with these, for reference
how to send BlockAction packet via ProtocolLib? (i googled but didnt found)
figured it out
use a builder to chain (ComponentBuilder)
hi, i have a question
BukkitRunnable task = new BukkitRunnable() {~~};
task.runTaskLater(plugin, 60);
if i go
task.cancel();
in 3 seconds, a task cancel properly?
TaskLater cancels itself
but yeah, if you cancel a task, the task will get cancelled
thx
easy way to listen to every event?
Yeah sort of
You can inject an EventExecutor into every HandlerList or something iirc
Quite the hacky thing
"easy", more like hacky.
you could go the easiest and listen to every event yourself
HandlerList::getHandlerLists() gives you all possible events you can listen for. Then just create your own RegisteredListener instance (which can be just one, for all events).
https://www.spigotmc.org/threads/listen-to-all-events.222306/
yeah break minecraft
can anyone help? spigot is seeing my plugin but its not executing anything at all in it
well did it enable
not even Bukkit.broadcastMessage("ender boots active!"); in the onEnable()
oh there is an error
its this:
public static void init(){
createEnderBoots();
}
that shouldnt be causing any errors
it breaks without static
static abuse incoming
Non-static method 'createEnderBoots()' cannot be referenced from a static context
?paste can you paste ur main class
and ItemManager
yeah i was gonna say
oh right my cat jumped on my desk LOL
yeah
it says shaped recipe must be rectangular but it is
java.lang.IllegalArgumentException: Crafting recipes must be rectangular
pregenerated
what does teleport(); accept?
im trying to give it x y and z but its not agreeing with me
like teleport(locX, locY, locZ);
nvm
reading the docs takes you far kid
I'm going to continue my crusade against init methods that can be converted to clinit/init. In this case it can be changed to
static {
createEnderBoots();
}
how would i randomly teleport a player like an enderman teleports?
within like 30 blocks
enderman teleports are pretty non-random actually
pick a random direction, random distance, then getHighestYAt
anyone know any good open source projects for multiplayer servers using bungeecord and spigot i can take a look at to study
ty
Well, the thing is that endermans cannot teleport to inaccesible terrain and such stuff. I believe mojang just sets the movement speed to very high numbers for a small amount of time
Hey I need to save an inventory after a player made changes to it, tired on clicked event but it fires before the changes
and waiting one tick after a click can break things
why do you think waiting a tick would break it?
Then you are doing something wrong
can anyone point me towards some good tutorials for making multiplayer servers like hypixel and mineplex with bungeecord and spigot
i think ive learnt spigot and am currently learning bungeecord rn, but i cant understand how to really put the two together to make a functional server
@lethal hawk honestly u are in wrong movie then
Bungee is an aging standard, many move to velocity nowadays
making ender nons in spigot, nice
LOL
nah its a different kind of ender boot @grim ice
http://prntscr.com/1qjk3pc enderite boots! :D
[ERROR] Failed to execute goal on project AGMEnchants: Could not resolve dependencies for project me.ashenguard:AGMEnchants:jar:5.0: Could not find artifact org.spigotmc:spigot:jar:1.17.1-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/) -> [Help 1]
I keep getting this when I try to build on https://jitpack.io/#xyz.agmdev/AGMEnchants
You can see the code at https://git.agmdev.xyz/AGMEnchants
Any suggestion why this keep happening?
You are depending on spigot not spigot-api so you must run BuildTools
not sure you can do that with jitpack
Best is to isolate your API so you can still bind to it without depending on spigot
Hey, I'm trying to build my plugin using maven for the first time. My console says I've built the plugin for java 16 but I've selected 1.8 in Project Structure and I've changed version in pom.xml. Anyone knows how to fix?
[12:16:24 ERROR]: Could not load 'plugins/AresLobbyPlugin-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: nl/naimverboom/areslobbyplugin/AresLobby has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0
you are trying to run it on java 8 but built on 16
I know, thats the issue
then run your server on 16
what MC version?
1.12.2
then set a source/target in your pom
I have
clearly not correctly
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r05</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>```
Seems fine to me?
looks ok
Restarting my server multiple times seems to have fixed it, weird
did you try to update your jar with the server still running?
no, i restarted it
restarted? did you stop it before putting a new jar on
yeah
Piling onto my issue from yesterday, with the bots thing, So I did a AsyncPlayerPreLoginEvent like LMBishop told me to, but now it just kicks any player that tries to join the server
package me.Teric7.Nameban;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
public class Nameban extends JavaPlugin implements Listener {
public void onEnable() {
saveDefaultConfig();
Bukkit.getPluginManager().registerEvents(this, (Plugin)this);
}
@EventHandler
public void onLogin(AsyncPlayerPreLoginEvent event) {
boolean containsBanned = false;
for (String s : getConfig().getStringList("banned-words")) {
if (event.getName().toLowerCase().contains(s.toLowerCase()))
containsBanned = true;
}
if (containsBanned)
System.out.println("§aThis player should've been banned!");
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "§4§lGet outta mah server bot!");
System.out.println("§4According to the code, bots have been banned");
}
}
I have another plugin which has same dependencies and the build is successful
Show your banned words config
banned-words:
- McDown
- McDown_
- McDown_pw
- McDown_pw_
true
Have you run buildtools for 1.17.1?
Yes I did
Oh and you should specify locale in the toLowerCase
ok so I set it to only be 1, and it still kicks normal players
If both players take the item in the same tick they can dupe it
Are we talking about an item on the ground or withing an inventory.
within
Usually thats not possible. What are the circumstances?
More infos pls. There is always a workaround or a better approach.
Is it normal that IntelliJ uses 2GB of RAM, even if I am not running any test server?
If you got ram to spare then IJ will take it. For me its almost 2.5 but im also using some plugins.
How do you mean spare?
tvhee r u using gradle or maven?
Maven
Alright that might take some additional ram occasionally
my intellij uses 700mb even tho im sort of in ab ig project rn
Ok never knew that
big*
Yes I had that also before, but it now uses 2GB
And I only have 8GB, and also want to run minecraft
Reinstall might be a good idea
invalidate your cache
for me i close intellij and open mc again
Already did
or just hire beta testers liek i did B)
2Gb IJ 2GGb client 2Gb Server 2Gb System. Sounds enough.
i use server.pro
2 minecraft instances
:D
Yes I know that
so i dont use my laptop resources :D
The only server you can upload custom plugins
Ok good idea, let's use that
You can turn view distance down and run your clients with 512Mb each
yeah in most cases its better than local servers
wtf
is that even possible
Yes, ran it with 1GB, and view distance is 7
i want to punish myself if my plugin would crash the whole server
so it crashes my computer

if it crashes it your plugin sucks
its also a good way to know if ur plugin is fine or not
as ur limited by 1gb raam server
1gb will instantly crash the server
if it doesnt run in it then ur plugin has some bad shit in it
no
if ur plugin doesnt run on a 1gb ram server
u have smth wrong
No the server doesn't boot up in 1gb
thats my opinion ig
I get OutOfMemoryException if Paper is trying to load the world in 1gb
i have like 5 servers running on 1gb ram
well thats smth with ur pc idk
for me
even with local servers
1gb ram is enough
^
I don't know what the issue causes
I think (maybe) with the right config you could get it to run on one Gb.
View distance to 5 and lower mob count. But 1 is a stretch
uh no
i run servers easily on 1gb
dunno bout yall
get gud
server.pro is good enough
Anybody knows a library that can be used to put graphs that change dynamically on maps?
yep
Yes. Ive build dockers for 1.12, 1.13 and 1.16.
Allocating 256Mb for the os and at least 1700Mb for minecraft.
1 Gb is a stretch unless you have a custom server jar.
if u cant run ur plugin in server.pro u probably shouldnt release that plugin
Yes, ok
unless its RWG :3
Not from my memory but that sounds like an interesting API idea.
Because atm I would have to paint each pixel -.-
you suck
yes
nah fam
what if my plugin is intended to crash the server
ur thing is leaking memory or just running so poorly
I mean you can abstract away from that then you can display any data set.
then u get banned from spigot!
At server.pro my plugin (and the server) loads in 12 seconds
wdym?
just bot your server with 400 alts
stresstesting isnt forbidden afaik
Let me look into that.
yeah, ram speed matters and then GPU memory
I always just throw 8 gigs onto my fabric vanilla pack with OptiFine lol
yeah thats bad
for no reason whatsoever 😂
ur wasting memory
except 64 chunks viewing distance
btw this isnt healthy for ur pc iirc @silver shuttle
why wouldn't it?
idk ur using too much resources for no reason at all
that will probably shorten your pc shit life
Na it won't, it just claims that amount of ram on the process start, it doesnt write 8 gigs all the time
also RAM doesn't have that short of a r/w cycles as SSD's have
what really is killing my pc is this MySQL server I am running -.-
This is a bit more complicated and interesting but might take a min.
hey, i was getting some help with my plugin yesterday but it seems to be duplicating the items still. I can't work out if I'm doing something wrong or what. I have code setting the item on cursor to null but it still duplicates the items :/
can you show us your code?
I'm trying to destroy the item dropped onto the other itemstack but the stack of which was dropped onto stays
Ideally it would have a width (x) in data amounts and height (y) in data values, and can be used to link multiple maps, but that's a bit far stretched
Currently if I drop the item onto the other it duplicates the target item
How do I migrate an ArrayList of Strings to an ArrayList of Integers?
first of all you dont need to check if the meta is null manually. bukkit provides a ItemStack#hasItemMeta method
you could listen to the InventoryDragEvent
Working on it
cool cool

Thats an addition to my API so its fine.
is it public
Hey guys, is there a way to get the client version of the player?
Hey <playerrname>, what version you using?
I don't think you got it ;p
It was a joke sayin' to ask. Anyhow you could use packets or something?
ow wow im dumb, i get it now haha
make a survey
Does InventoryDragEvent even work on a players inventory? It's not firing at all for me
yeah it should
I've moved multiple items in my inventory and no messages? and no errors
try setting the cursor item through the event instead
i'll try that, I didn't think this'd be so complex 🥲
duplicates the target item
are you sure it is actually duplicated and not your client bugging out
how could i test that?
try and do something with one of the "duplicates"
does anyone have a good tutorial on teams?
microsoft teams?
Google your question before asking it:
https://www.google.com/
well the javadoc has all of that
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/scoreboard/Team.html#getScoreboard() this doesn't really explain how to use it
set collision, friendly fire, etc.
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/scoreboard/Team.html#getOption(org.bukkit.scoreboard.Team.Option)
ok but how do i make teams, how do i set the team's options
that is how you set the teams options
line of code for that?
you need a scoreboard to make teams against
wdym against
if you can't interpret the javadoc then maybe you should learn the language first
anddd blocked
got tired of people telling me to learn 24/7, this is how i learn
?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.
and this is why you're struggling
nobody will help you here
i imagine you'll just get clowned out of paper as well
I doubt he'd make it in the door to paper
What code was used here by the way?
This I'm guessing
wtf?
I'll try this again, see how this works
lol
Yes it does. Ive just tested it with 1.17 and even sent a gif of it. lul
99.99% sure its not a problem with spigot/paper
yeah I know but I'm using the exact same code to the dot and nothing
Do you drag an ItemStack onto an Emerald?
?paste your class
https://i.imgur.com/0e4gF3n.png this was a trident 🥲
Then you have another listener that screws up the first one.
Set the priority of this listener to HIGH.
black hole 
Not possible. You are doing something wrong.
I can't work out what though
There's legit nothing else using this event
I don't know where I'm going wrong at this point, I've checked the code multiple times also
Do you have any other plugins installed?
I do i could remove them?
Always test your plugin in a clean environment.
I'm in a clean environment and it does the same thing I don't know what's going on at this point
alright, it's not duplicating but it's not destroying it hm
edit: it duplicated 🙂
cant i use lambda for Bukkit.getScheduler().scheduleSyncRepeatingTask
totally have no clue whats wrong but what if its your code structure
what if you need to cancel it BEFORE
that doesnt makes sense but the most errors doesnt make sense
I could give you the exact code for the listener?
you could provide your exact code and a video of what is happening
so we dont have to imagine what happens ourself
I want to remove the world of the server and regenerate a complete new one, is it safe to do this in onEnable ?
How can I log certain in-game events on discord using webhooks?
that depends on what world
onLoad is safer
then no
Ok thank you
?paste
what is the best way? the first or the second?
https://paste.md-5.net/lurawuyeqo.js
The second as the first will always start with var = 0
yea true
Bukkit.getPluginManager().disablePlugin(); does not work in onLoad()
onEnable?
I mean, I do things with the world (recreate it), but if the world name is null I want to disable the plugin
And I do this stuff in onLoad
of course not, your plugin is not enabled in onLoad
Then just adding it as fist in onEnable?
if you want to prevent it loading on some condition in onLoad, you set a bool error, then check that bool in onEnable
Ok good idea, thanks
Ok, but does that stop the plugin?
yes
Because I don't want to spam the console with an exception, I'd better use 1 line
I'd not guarantee how unload calledc in onEnable for itself would behave
Ok, then we'll test it
probably quite unreliably
[ERROR] .... Error occurred while enabling Plugin v1.0.0 (Is it up to date?) java.lang.IllegalStateException: zip file closed
It indeed does not work, how can we do it else?
throw an exception
Ok
your plugin will show up red in the list then
Yes exactly, because it did not load
I will throw RuntimeException then
Ok, but still much console spam
if you want to eliminate all spam, schedule a task to run 1 tick after onEnable to unload your plugin
I need some help with a custom placeholder.
My code looks like this: https://paste.md-5.net/ihegoyilun.java
The Problem is that the placeholder don't work e.g. /papi parse me %amethyst_golem_active% prints %amethyst_golem_active%.
In the console i can see that the extension was registered [PlaceholderAPI] Successfully registered expansion: amethyst_golem.
Also the method onRequest will not be called...
Any ideas ?
would it be a good way to spawn particles (like trails) async?
I want to make Multiverse-Core load before my plugin, how can I specify that in the plugin.yml? Because if I add it to loadbefore it will FIRST load my plugin and then Multiverse
soft depend
client sided or server sided?
server side
Ok, but if Multiverse is not present, will my plugin still load?
yes
Ok thx
thats the difference between soft depend and depend
Ok never knew that, good to know
if it would be client sided it wouldn't matter so much, if its server sided idk
Bukkit.getWorld() returns null (AFTER it is loaded with Multiverse (Preparing start region for dimension minecraft:lobby), if I put in "lobby" it returns null
try restart the server i had that before
Ok
not sure if that ll work
Hello, I have a problem with my inventory
It has to do with the fact that if I have root privileges, I have the saved items after my death
getWorld doesn't return the world's name btw
I know
and afaik, you need to load the world manually
I see the problem, I split the location "" and not " ", so solved
ah
Still thanks for trying to help
i remember having to use new WorldCreator("lobby").createWorld(); to load a world in, is that still a thing?
hey, what reasons can it have that i dont see the scoreboard?
your plugin needs to show it to player's individually
what does your sb look like (code)
Then you did not add any score
And did you set DisplaySlot.SIDEBAR?
To your main objective
How can I detect a block, but not from the location? I need to know this, because if I check for example if a block in a certain chunk or a certain location breaks, the OnBreakEvent don't get triggered, because the chunk was unloaded.
Please ask questions to this question, if you have some.
oh, thats it, ty
World#getBlock?
After chunk reload, the event don't get triggered.
Or did you mean something else?
for some reason these folders are there, cant i replace them?
No. else the plugin won't work.
Or is this plugin from you?
Then just drag and drop them like you want
Just make sure you clear the package before package it again.
If you don't need them, then delete them
i cant drag it
no
Perhaps Conclure know
i guess i dont see what exactly you want to do
I want that, if a player breaks a block at a certain location the event should get cancelled.
Try refactoring your packages to lowercase
But yeah that looks cursed
event.setCancelled(true);
}```
I did. But after the chunk reloads, that doesn't work anymore.
no idea
Is this a bug?
dont know
Ah wait @sullen dome
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.
Sorry.
This is the code. i debugged a bit
[15:54:45 INFO]: [CCRP] Triggered event
[15:54:45 INFO]: [CCRP] Material is Gold or Beacon
[15:54:45 INFO]: [CCRP] Guilds they exist
[15:54:45 INFO]: [CCRP] Guild owns chunks
[15:54:45 INFO]: [CCRP] Current Owner: def07ab3-b6db-4355-b4d2-6c101be04c78
[15:54:45 INFO]: [CCRP] Guild owns chunks
[15:54:46 INFO]: [CCRP] Current Owner: e7cda1a7-5884-48b5-bd31-521f50bc8ad3
thats alot of else ifs
No. Switch and case
no, else and if's
Äh. Sorry
well uhh
I edited it.
what's your issue now?
german 🙂
german
No. German
guten tag
hallo
🥰
gang gang
Guten Tag.
heiße*
but both are working
Richtige Grammatik, wenn ich bitten dürfte.
ein*
idk my german sucks
Was wird das denn hier? Invasion?
ja genau
that killed me, ngl
I tried now to compare the x and z of the chunks and not the chunks themselve, because I'm not sure, if a chunk is always the same.
Yeah. that solved it
Ok im close. Ive written an algorithm that can scale any data set to an arbitrarily small horizonal and vertical quantization interval.
The last image is 128x128
Hey @lost matrix sorry for ping I might have found the issue after all this time 🥲
What was it
Yes there is an CreativeInventoryEvent because item handling in creative is client authoriatative.
Hello. Anyone know, where I can find the symbols you can use in spigot TextComponents?
is returning in an event the same as event.setCancelled(true) ?
You mean all supported unicode symbols by minecrafts font?
Ähm. Perhaps.
Lemme just...Scream.
Nope.
owh i got it
Can you send @lost matrix?
but yeah thank you so much for helping all that time
You would have to go through the unicode table and test each one out.
Here are some that i know will work:
☮ ✿ ✈ ♋ ☠ ☯ ♥ ✌ ✖ ☢ ☣ ☤ ❤ ❥ ❦ ❧ ♡ ✗ ✘ ♒ Ω ♦ ♠ ♥ ♣ ♢ ♤ ♡ ♧ ✦ ♔ ♕ ♚ ♛ ★ ☆ ✮ ✯ ☾ ☽ ☼ ☀ ☁ ☂ ☃ ☺ ♪ ♫ ♬ ✄ ✂ ✆ ✉ ∞ ♂ ♀ ☿ ▲ ▼ ₪ ✓ ✔ ✕ ☥ ☦ ☧ ☨ ☩ ☪ ☫
☬ ☭ ™ © ® ℗ ¿¡ № ∃ ⊥ ∀ ☹ ∞ ⌘ 文 ⑂ ஜ ๏ ت ツ ッ シ Ü ⅟ ½ ⅓ ¾ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉ ➊ ➋ ➌ ➍ ➎ ➏ ➐ ➑ ➒ ➓ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ ☚ ☛ ☜ ☝ ☞ ☟ ✙ ✚ ✛ ✜ ✝ ✞ ✠ ❂ ⋆ ✢ ✣ ✤ ✥ ✦ ✩ ✪ ✫ ✬ ✭ ✮ ✯ ✰ ★ ✱ ✲ ✳ ✴ ✵ ✶ ✷ ✸ ✹ ✺ ✻ ✼ ❄ ❅ ❆ ❇ ❈ ❉ ❊ ❋ ╰☆╮ ✡ ❂ -‘๑’- ✽ ✾ ✿ ❀ ❁ ❃ ❋ ♪ ♫ ♩ ♬ ♭ ♮ ♯ ° ø ⊙ ☉ ❣ ✉ ✍ ✎ ✏ ✐ ☑ ☐ ☒ ␟ ␘ ❢ ➟ ➡ ➢ ➣ ➤ ➥ ➦ ➧ ➨ ➚ ➘ ➙ ➛ ➜ ➝ ➞ ➸ ♐ ➲ ➳ ➳ ➴ ➵ ➶ ➷ ➸ ➹ ➺ ➻ ➼ ➽ ← ↑ → ↓ ↔ ↕ ↖ ↗ ↘ ↙
Thanks a lot!!!!
Sorry.
Ah. Ive found someone that keeps track of many:
https://forum.maestrea.com/threads/minecraft-symbols-emoticons-and-characters.11264/
Wow. I believe in german developers. xD
?paste
how does this looks? maybe i forgot something idk
https://paste.md-5.net/qeteqaxuli.cs
Spigot has a method to vanish a player from someones sight and also a method to check one player can see the other.
This wont cover bow shots.
Wait it does
the last part
Yeah. Its a bit convoluted
but do you mean player.hideplayer for that vanish thing?
Yes
yea my vanish method does that and more things
So the best thing that could be with it is to have an amount of data on x and y given to it and an amount of x and y maps on the board, that then connect and act as one board
how could i broadcast a random message from a json file every 5 minutes? i haven't really found anything online
runTaskTimerAsynchronously
and use TextComponents
hey, this throws an IllegalArgumentException:
player.spawnParticle(Particle.REDSTONE, x, y, z, 1);
how to prevent this?
Then we need to know the message
Probably you need to wrap this in a Bukkit.getScheduler.run or Bukkit.getScheduler.runTask
Or run it 1 tick later
Caused by: java.lang.IllegalArgumentException: Particle REDSTONE requires data, null provided
Ok
what data to provide ?
thx
Why asynchronously?
because it is just better?
Nope
1.2.0 best
Why not have it run on a seperate thread? If the server is run on very bad storage then it could result in a slow access time if he only reads the file then
Load the message from the file -> start task
theres no lag in doing this on the main thread
he is right
IO operations should always be done async
are you not loading the file from onenable? lmao
to read from the file you are opening and closing it again
and get the contents of it
what is called an IO operation
and if you are changing the values in it you will have to load it again and cant cache the values to never have to open the file again
then change the string async
how could i broadcast a random message from a json file every 5 minutes? i haven't really found anything online
this conversation seems useless
ok
and if you are changing the values in it you will have to load it again and cant cache the values to never have to open the file again
Hum guys, does anyone know why if I shift with zero fill >>> on a byte var, java fill with 1? (The byte var value is 0xF0)
Their original question is confusing
Async does not always mean its faster
are they trying to cache the file every 5 minutes just in case if the user adds something, and take random of that?
or do they mean they load it all at startup
and every 5 minutes they choose a random message from that structure
the latter makes more sense
GodCipher was referring to IO Operations
Ah ah
And also, this is personal opinion but I rather use CompletableFuture
because I feel like its useless to use the schedualer unless you need to do something with ticks (for async operations)
After all, you can specify which Executors to use which gives you far more control
I see, Java doesn't allow you to shift a byte. https://stackoverflow.com/questions/3312853/how-does-bitshifting-work-in-java
Why that?
Not sure. All I know is that during bitshifts the byte is promoted to an int
and you must cast it back
You don't achieve any space saving by using byte or short in simple variables instead of int, because most Java implementations align stack variables and object members on word boundaries. (arrays are an exception in that regard as they are handled differently)
Shifting types smaller than 32 bit would mean that the JVM would have to introduce some synthetic extra logic.
that would make sense
um guys
is using sender to send messages after checking if sender is instance of player fine
or do i have to make a player object
You dont need to cast as its basically the same object.
if (sender instanceof Player) PLayer p = (Player) sender;
I registered a custom pluginchannel called bb:placeholders and i get the following debug info in the client log:
[17:06:09] [Render thread/WARN]: Unknown custom packed identifier: bb:placeholders
Is that a normal warning or can i prevent that warning somehow ?
It is a normal warning considering the circumstances yes
if you want to send data to the bungee but not to the client then you used the wrong channel to what I am aware
Hey im working on a spigot plugin i want to make a event that let me clamp a player. I made an item named hancluffs and if someone clicks right with handcluffs to someone else that player will be clamped and he cant move. How can i do that.
i can make the cant move part
but i dont know how to rightClick etc.
PlayerInteractAtEntityEvent will be what you are searching for
sorry, I do not speak 200 lines per sentence
i used PlayerInteractEvent, are they same?
no
Well, you could have the same functionallity via raytracing, but please don't do that
You should probably use the PDC or the scoreboard tags of the player.
On PlayerInteractAtEntityEvent -> add a tag to the player
On PlayerMoveEvent -> x,y,z dont match -> cancel
To prevent movement you could just set movement speed to 0. Of course the client could hack it, but ¯_(ツ)_/¯
please explain it like you are explaining it to a beginner
i'm looking for the particle enum
that being said, PlayerInteractAtEntityEvent has a limited range
could you specify further?
[INFO] Using property: package = com.thechemicalworkshop
Confirm properties configuration:
groupId: com.thechemicalworkshop
artifactId: demo
version: 1.0-SNAPSHOT
package: com.thechemicalworkshop
what's the convention? what should i pick for what
org.bukkit.Particle
and also tells me maven project created
add to workspace, open or do nothing?
also where do i change from bukkit/spigot to bungee...
package: https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
artifact naming: https://maven.apache.org/guides/mini/guide-naming-conventions.html
version: usually semver, but you could also use dronever/whatever
how to equal entity to a target object
boolean isEqualAndNotNull = ent != null && ent.equals(otherEntity)
wow thats confusing
but the null check will be redundant for PlayerInteractAtEntityEvent, so disregard that
Do you just want to check if the clicked entity is a Player?
yes
basically, for everything but primitives, singletons (like enums) or other rare cases, you are going to use #equals()
exactly
also running the example i get [ERROR] /c:/Users/Matti/Desktop/java plugin mc/demo/src/main/java/com/thechemicalworkshop/App.java:[3,30] package org.bukkit.plugin.java does not exist
maven or gradle?
Then you just need to check with the instanceof keyword.
maven
i use the tutorial on spigot page..
Then show your pom.yml
sorry
ent instanceof Player
too big, can't fit it here
usecase:
if (entity instanceof Player) {
// variable "entity" is an instance of Player
}
?paste
trojan error, got another bin?
what the hell
cant resolve symbol
what do i need to import
@EventHandler
public void onInteract(final PlayerInteractAtEntityEvent event) {
final Entity clickedEntity = event.getRightClicked();
if (clickedEntity instanceof Player) { // This is an instanceof check
Player clickedPlayer = (Player) clickedEntity; // This is a cast
// Go on from here
}
}
But you should probably learn the java basics before going into spigot.
Spigot can be quite confusing for a beginner.,
https://paste.gg/ is another popular one
Your IDE imports the stuff for you.
if (args.length >= 2) {
if (!args[0].equalsIgnoreCase("chat")) return true;
StringBuilder sb = new StringBuilder();
for(int i = 0; i < args.length; i++) {
if (i > 0) sb.append(" ");
sb.append(args[i]);
}
String result = sb.toString().replaceFirst("@", "");
player.chat("@" + result);
return true;
}```
What would this do? I wrote it but i wanna know if i did something obviously wrong
<maven.compiler.source>1.7</maven.compiler.source> -> lol
You are using the worst tutorial in history
@lost matrix While you are working on the plotter for the graph map you are doing, does it take y values as absolute or relative?
Because I am trying to have a mini overview of the graphs in a GUI and need to somehow get a relatively stable looking graph with just 5 items as height, but can't figure out how to do it so that it looks relatively good
well it's the official one
no im not gonna switch IDE
YOURE USING A TEXT EDITOR TO MAKE PLUGINS??
already had this conv
I consider anything but https://bukkit.fandom.com/wiki/Plugin_Tutorial_(Eclipse) not an official tutorial
nopt gonna use eclipse
im beginner yes
can i get help for vscode?
hey don't leave IntelliJ out
aebwfaewuffaewuofewaueawubaefwbaegwbuoegbgewbogeabwgweabgbgewbowaegbgewawegab
NO
why?
no one will help you if u use that <3
The IDE doesn't matter
thats why xD
its a text editor
You can scale the height dynamically.
i know until Generic class
idc, i have been using it for too many years
okay cool, any spontaneous idea on my problem?
the only reason im getting into java, is because it got too expensive to ask someone every time 😂
Whats problem exactly? (Btw the code is rdy. Let me just write an example)
It is kinda hard to explain, I'd rather show in stream than try to explain here
and i created an item named handcluffs this method is going to run if player get right clicked by handcluffs not other things (hand, block, arrow)
Sure, it helps to use eclipse, but the basics (i. e. adding the spigot dependency to the pom) still apply without eclipse
Ill write the example and then we can go into verified or so if want.
couldn't i create the project in whatever crappy IDE you recommend, and continue editing on vscode?
kk
the only wrong thing is your pom
does at least compiling work there, also, can i change the compile directorie...
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version><!--change this value depending on the version or use LATEST-->
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
lemme add this
- the repository declaration
how can i provide this
okay it compiled? i think
why do i have test and main dir? can i del the test dir?
Is there a packet size limit in mc?
now i gotta map a virtual drive somehow...
pretty sure
must be
And iirc client -> server has a much smaller limit. The other way around is quite liberal.
Mh, ok ty. Do you know the exact numbers?
@lost matrix We have to postpone it, just remembered i have a meeting now
feel free to pm me tho
if (player.getItemInHand().getType() == Material.ARROW) can i make the second argument as custom item?
I assume both
No. == is only true if the memory address of both objects match. So they must be exactly the same object.
You can identify custom items by a number of factors. Beginners usually check the name or the lore of the ItemStack
to see if it is a custom item. The proper way is using the PersistentDataContainer of the ItemMeta to check for custom items.
"Beginners usually check the name or the lore of the ItemStack"
not really
Most versions do not have pdc
and there are many professionals that code in 1.8
Only the old version that are unsupported and nobody should use
flawed statement
What, No
so i cant equal getItemInHand() to a custom item
many people like 1.8.9
ItemStack.isSimilar(ItemStack)
you can't just say no body should use them and people will stop
Not directly.
there are many clients and mods for older versions, while modern versions are mostly used for the Survival / Adventure part of the game
older versions are for pvp
You can use them but then dont expect the community to help you. I dont support broken old versions so i dont mention them in the first place.
Old versions are usually used for optimization/lack of bloat features
eh
that's also wrong
we're not the whole community
**most **people will help regardless of what version you're using
but you have a point, older versions are broken and shouldn't be used
You can do that if you actually know what you are doing. If you know how to fork spigot and know how to fix the many bugs that occur in older versions
and have the manpower to maintain and update your custom version then you can argue for using older versions.
Everyone else should use the newest version or suffer with the consequences.
lol
You are the latter.
the biggest servers use older versions, only survival based servers are using newer ones
If you keep programming in 1.8 and get more advanced you will see how lackluster this old piece of software is and how it limits your creativity.
they cause unnecessary fps drops with a disgusting pvp style
i code in all versions
it depends on what the request is
i need T extends ParticleParam
The biggest server also have properly payed software engineers that maintain a highly customized version of spigot that has literally nothing to with the versions you can download anywhere.
true
T is a generic type that changes for each particle.
how do i use a variable from one event in another event
?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.
bad
thats the most annoying answer you can get here
| Ask other questions here
you can ask java questions here as well
thats why i hate nms 🥺
Just answer him if you know the answer, if you don't then simply don't reply
And smile answered
other wise "?learnjava" is pointless, he must've already saw that answer before
Ah i see. There you need to provide the NMS particle.
But why would you ever want to send a Particle via packets? That is literally what spigot is doing. There is no reason to ever do that with packets.
what is this
That’s not sure
if he did and is still here, then he knows what he's doing
it is, this gets said everyday
Don’t make such assumptions
And do you actually think he will go and learn java in the middle of his project?
Thing is you should really only use this channel as a last resort and there is by guarantee a lot of material covering how to pass data around.
Help him, then tell him to learn java when he finishes what hes doing
No? It never said you should
[19:21:38 ERROR]: Could not load 'plugins\demo-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `com.thechemicalworkshop'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:73) ~[patched_1.17.1.jar:git-Paper-85]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.17.1.jar:git-Paper-85]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.17.1.jar:git-Paper-85]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.17.1.jar:git-Paper-85]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.17.1.jar:git-Paper-85]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:276) ~[patched_1.17.1.jar:git-Paper-85]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1126) ~[patched_1.17.1.jar:git-Paper-85]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-85]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ClassNotFoundException: com.thechemicalworkshop
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:146) ~[patched_1.17.1.jar:git-Paper-85]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[patched_1.17.1.jar:git-Paper-85]
at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:466) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:71) ~[patched_1.17.1.jar:git-Paper-85]
... 8 more
well, it compiled without errors...
should is a powerful word
i've used some of those links
Yea it’s a powerful word that’s why I used it
Fix your plugin.yml
Make sure the path inside your plugin.yml points to your main class. This looks like you only provided the package but not the actual class that extends JavaPlugin here.
your informations are incorrect then ;)
what do i need to do
Being able to teach yourself is among the most important things when it comes to programming just like other things
It is not
you can use this channel whenever you like
main: com.thechemicalworkshop
name: BlankPlugin
version: 0.1
what's wrong?

