#help-development
1 messages · Page 1634 of 1
what is randomamp and stock and variance?
randomamp is Math.random()
stock is a positive integer cast to double
variance is double, and the result of the calculation is 0 if variance is between 0 and 1
it shouldnt return 0, right?
and no, without the variance in there or if the variance is above 1 it works fine
which exact value has stock
It doesnt change with any other stock value aswell btw
try change randomamp to 5 @silver shuttle
but its supposed to be random
just for testing
ok
Still 0
OMG
variance = result.getInt("variance");
might be able to see where I'm going
😂
Thanks for your help man
im just wondering how i can make pages of text.. something like
text here or something, and then:
- text here
- other text
- more text
- even more text
- etc.
anyone?
?paste
trying to set a material to the config java Rewards.getInstance().getConfig().set("Reward", Material.getMaterial(args[0].toUpperCase())); is this correct?
it's for a command to set the material
i had to change it to an itemstack
Hi, I am developing my plugin which connect to mongodb using mongodb-driver. I notice that there would be many spam info log print by the mongo driver, and I almost tried all solution from the web but nothing works.
The solution which seems most feasible is found in this page https://stackoverflow.com/questions/30137564/how-to-disable-mongodb-java-driver-logging and it says I will need to using ch.qos.logback to set the log level:
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import org.slf4j.LoggerFactory;
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
Logger rootLogger = loggerContext.getLogger("org.mongodb.driver");
rootLogger.setLevel(Level.OFF);
But with this method I am getting the error about I can't cast org.apache.logging.slf4j.Log4jLoggerFactory into ch.qos.logback.classic.LoggerContext because they are loaded by different loader:
[12:36:35] [Server thread/ERROR]: Error occurred while enabling MainSystem v0.1 (Is it up to date?)
java.lang.ClassCastException: class org.apache.logging.slf4j.Log4jLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext (org.apache.logging.slf4j.Log4jLoggerFactory is in unnamed module of loader 'app'; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @3cff08b5)
at com.linyuanlin.minecraft.App.onEnable(App.java:59) ~[?:?]
Can anyone help me pls 😭 😭 😭 😭
[WARNING] .... Nag author(s): '[Baylorai]' of 'FirstPlugin' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
i dont understand it
use logger().info
I do nothing with my plugin and mongodb prints really few
yes
What version of mongo driver did you use?
I think I am using latest too
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.3.1</version>
<scope>compile</scope>
</dependency>
And it's keep log like this
[13:05:57] [cluster-ClusterId{value='61135ab53d48fe7f95ba56a5', description='null'}-cluster0-shard-00-00.c5tdo.mongodb.net:27017/INFO]: Monitor thread successfully connected to server with description ServerDescription{address=cluster0-shard-00-00.c5tdo.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=103416067, setName='atlas-5lf7u6-shard-0', canonicalAddress=cluster0-shard-00-00.c5tdo.mongodb.net:27017, hosts=[cluster0-shard-00-02.c5tdo.mongodb.net:27017, cluster0-shard-00-00.c5tdo.mongodb.net:27017, cluster0-shard-00-01.c5tdo.mongodb.net:27017], passives=[], arbiters=[], primary='cluster0-shard-00-01.c5tdo.mongodb.net:27017', tagSet=TagSet{[Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AZURE'}, Tag{name='region', value='ASIA_EAST'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=7, topologyVersion=TopologyVersion{processId=610bfdc47ec55924b37dd449, counter=4}, lastWriteDate=Wed Aug 11 13:05:56 CST 2021, lastUpdateTimeNanos=311005845050051}
Thank you czkn that seemed to remove the error
1.17.1 got me confused with the coding hahaha
I get that on a other project
using latest non sync version with Ktor level is debug not info
It seems that I install both sync and non sync version into plugin, after removing the non sync version, these spam logs only show up when server starting.
Thank you very much @analog inlet !!
oo
i can find the code changes in the javadoc right?
hey
is used this code to hide armorstand for all players except one, but armorstand custom name not working
for (int i = 0; i < armorStandLocations.length; i++) {
armorStands[i] = (ArmorStand) player.getWorld().spawnEntity(armorStandLocations[i], EntityType.ARMOR_STAND);
EntityHider entityHider = new EntityHider(Test.getPlugin(Test.class), EntityHider.Policy.WHITELIST);
entityHider.toggleEntity(player, armorStands[i]);
armorStands[i].setGravity(false);
armorStands[i].setCustomName(text.get(i));
armorStands[i].setCustomNameVisible(true);
armorStands[i].setCanPickupItems(false);
armorStands[i].setVisible(false);
}
I feel like this is overengineering and i could just make a static global instance of my main plugin to get these instances
public class JoinEvent {
@Inject(optional = true)
private TextChannel channel;
@EventHandler
private void onPlayerJoin(PlayerJoinEvent event) {
channel.sendMessage(event.getPlayer().getName() + " joined the server").queue();
}
}
should i do it this way or just pass the TextChannel in constructor
This is essentially how the dep injection thing is used ```java
InjectionContext injectionContext = new InjectionContext();
injectionContext.registerDependency(Database.class, database);
injectionContext.registerDependency(Config.class, config);
injectionContext.registerDependency(Locale.class, locale);
JoinEvent joinEvent = new JoinEvent();
injectionContext.load(joinEvent);
eventbus.register(joinEvent);
for anyone who wants it
i think im deciding to not use it but yeah
if anyone wants to convince me otherwise feel free
so, i am trying to give a villager custom pathfindergoals, but it spawns and has its own AI. this is my class:
public class AggressiveVillager extends EntityVillager {
public AggressiveVillager(Location loc, VillagerType villagertype) {
super(EntityTypes.VILLAGER, ((CraftWorld) loc.getWorld()).getHandle(), villagertype);
//setting the location of the EntityVillager in the EntityVillager class.
this.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw());
this.setHealth(20.0f);
this.setCustomName(new ChatComponentText(ChatColor.translateAlternateColorCodes('&', "&caggressive Villager")));
this.setCustomNameVisible(true);
}
@Override
protected void initPathfinder() {
super.initPathfinder();
this.targetSelector.a(0, new PathfinderGoalNearestAttackableTarget<EntityHuman>(this, EntityHuman.class, true));
}
}
(its 1.16.5)
i have no idea what im doing wrong..
anyone knows how to stop the server from kicking me out when rightclicking on a sign that telports me?
https://romano.eats.dog/GIjoaYMt
ah, thank you
makes sense
kinda
NMS is tricky
how can we make this plugin?
https://youtu.be/B-N6niWbYO0
I am abit noobie in the plugins..
so..
create crafting recipes
your point?
Idk how to add recipes and how to make the custom abilities
it will be my first plugin lol
learn spigot and read the docs
oo
I am sure spigot has an official tutorial on how to make crafting recipes too
oo
can you send the links?
to those
and btw shall i use spigot or paper what will be better/what is the difference in both?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
paper has better performance is the biggest difference, I can not confirm that personally because I haven’t compared them.
will spiogot plugin work with paper?
and paper has a few more features at least they had idk now.
Yes
paper plugins will not run on spigot if it uses papers api though.
oo
^^
what is paper api?
not really paper just adds more features
oo
^^
API stands for application programming interface
I’m easy terms, it lets you communicate with other services.
I answered that above
.
ooooooo
how do i get the 2nd object of a hashmap
hashmaps are not ordered
like if i got replyMap.get(sender.getNam()) how would i get the second value
there is no "second" object
oh
ok well its a whisper command, how do i store for every player which player messaged them last?
i thought a hashmap could do that
o, how
store both with each other in the hashmap
I mean a map like you proposed earlier would do it
player - player1
player1 - player
i want to get these "locations", what is the best way for me?
is it possible to collect a drop async?
you already used that name, try with another one or use () ->
Not sure if this is a suitable place to ask but does anybody have any ideas how I would format a Map<UUID,Long> in YAML? Not for saving but for loading
Elaborate
like running Entity#remove on an item and adding it to player's inventory
Yeah so loop through the keys and the values, I believe ConfigurationSection::getValues returns a Map<String,Object>, then check if each String key in an entry in fact is a valid UUID, then check if the Object instanceof Number, if that’s the case cast and invoke Number::longValue, else call toString on the object and see if the value there is by any chance a number which can be tested with something like Longs.tryParse(input) != null.
Probably not
It involved the world to an extent
But worth a try
Why would you do this async btw
because I need to run a loop for every drop in a chunk and collect them, it may cause an huge lag
It could only hurt performance by computing such micro tasks off the server thread
Oh, I didn't think you would be able to use a UUID as a key
Thanks!
Then split the task up into smaller ones Lorenzo
it does not
Would I have to wrap the UUID in quotes?
a loop which loops throught every drop in a chunk isnt expensive at all. its like a split of a split of a split of a milisecond
I mean in the file
Alright, thanks!
and deserializing it : UUID#fromString(String uuid)
yeah sure tho I believe you don’t have to
what about looping for every block in a 5x1x5 cuboid and incrementing its age?
wdym by incrementing its age?
Ageable#setAge
oh the entities. thought of the blocks lmao
yeah no it shouldnt do anything to your performance
ok ty
oo wait I made a plugin
but how to add spigot in my server?
(I am hosting server on my pc not at any website)
java.lang.IllegalArgumentException: ChunkNibbleArrays should be 2048 bytes not: 0
you have a plugins folder
throw it in there
provide more informations
??
[15:50:54 ERROR]: Encountered an unexpected exception
java.lang.IllegalArgumentException: ChunkNibbleArrays should be 2048 bytes not: 0
at net.minecraft.server.v1_12_R1.NibbleArray.<init>(NibbleArray.java:14) ~[server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.ChunkRegionLoader.a(ChunkRegionLoader.java:402) ~[server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.ChunkRegionLoader.a(ChunkRegionLoader.java:94) ~[server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.ChunkRegionLoader.loadChunk(ChunkRegionLoader.java:72) ~[server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:21) ~[server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:1) ~[server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:336) ~[server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:295) ~[server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:16) ~[server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:137) ~[server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:120) ~[server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:116) ~[server.jar:git-Spigot-79a30d7-acbc348]
etc..
?paste

your server has a plugins folder where you throw your jar in
also this is #help-server related
soo
bro
which jar file tho.>.
my anti virus block due to torjan
can anyone help me? I did a teleport plugin that teleports you when u click a sign, problem is that if you click it 2 times, you get kicked for interacting with a block too far away
Website blocked due to trojan
Website blocked: paste.md-5.net
Malwarebytes Browser Guard blocked this website because it may contain malware activity.
which jar file sir?
ill use paste bin
bruh
uhmm my plugin file?
its not working... :V
I did put my plugin file
(I am using a vanila server)
r u idiot?
and thats why I am asking how to change this server to spigot
yea I am a super idot
thanks for reminding tho
i didnt ask you
I did
but I cant find out..
Then search more
You can't use plugin in vanilla servers.
i know
If you're not even familiar on how to make a spigot server don't bother making plugins
thats why I am asking how to change my server to spigot instead of vanila
Google it
got it
see?
anyone knows what is giving limits like: "moved too quickly" or "intereacted with block too far away"?
like this:
[12:25:00 WARN]: giuseppe tried to break a block 3.874818100690011E7 square blocks away from their position
I'd like to disable this or to know how to bypass it
not got it yet :(
xD
so I made a plugin
and its not even showing in the plugins when i do /plugins in the server
how can I fix it?
ahmm?
?paste
??
paste it there
oo
and are there some errors in the console?
no errors
I made it exact from the docs
this^^
nvm
Its Showing :-
Class 'Main' is never used
and Method invocation 'setDisplayName' may produce 'NullPointerException'
last :- Typo: In word 'Namespaced'
uhmm?
Can someone explain to me why the Long class exists?
And how do I properly turn a string of "20" into a Long of 20L
Long#parseLong
yeah that dont work
public class xvartoggle implements CommandExecutor {
private konstanius myplugin;
public xvartoggle(konstanius plugin) {
this.myplugin = plugin;
}
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
xvar = !xvar;
if(xvar) {
sender.sendMessage(messages_prefix + config.getString("messages.xvartoggle.toggleon").replace("&", "§"));
variationspeed = Long.parseLong(args[0]);
sender.sendMessage(String.valueOf(variationspeed));
variationtoggle();
}
else {
sender.sendMessage(messages_prefix + config.getString("messages.xvartoggle.toggleoff").replace("&", "§"));
}
return true;
}
public void variationtoggle() {
scheduler.runTaskTimer(myplugin, task -> {
if (!xvar) {
task.cancel();
return;
}
naturalvariation();
}, 0L, variationspeed);
}
}
Or something else is wrong
?paste
😞
can any1 help me?
Go ahead
Like how do I pass an integer into the runTaskTimer
do u mean a TaskID?
no, I mean into the delay
^^^ any1?
Just use Longs lol
yes but it doesnt work like that
Just add parameter to your method
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.
?paste pls
Are you execute the command without arguments?
no
I did /xvartoggle 20
and it toggled on, but gave that error
and the runTaskTimer didnt start
BukkitScheduler is null
oh ffs
Line 34
lemme test
i think you should learn how to read error messages
It will come with practice
I read that line and thought it was bs because i defined BukkitScheduler as a static
but i had onmly defined it empty and moved my code from main to this class
whilst deleting it by accident
thanks tho
im using protocolLib and i dont understand what is bit mask and how to use it
well i didnt find explanation about bit mask in that github page. but i googled and solved, simple binary
corrupt chunk. you could run region fixer
uhmm?
any fixes?
Whats wrong with this code? It is an exact copy from the Spigot Resources
the variable is called task
and?
is the error there if u change it
yes, and even worse because it wouldnt be a BukkitTask
but as soon as I define it as a BukkitTask the same error appears
You are creating an Anonymous task called task when you are already using a variable called task
Well it doesnt let me fix it
what do you mean? just change its name
you can, you can name it whatever you want
did that work
runTaskLater doesnt return a BukkitTask
it says so on spigot
what is it then
BukkitRunnable runnable = new BukkitRunnable() {
@Override
public void run() {
//TODO
}
};
No, you are using the Consumer method
return is void
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
Okay and how do I apply it to a timer instead of runTaskLater? I'm trying to be able to cancel this task from the outside
Oh maybe I need to delete my world files
how to smooth rotate armorstand's right arm
get its position and make a for loop
how much each loop and what delay?
decide yourself
What's the equivalent of config.getString() except to write to a String in the config?
what do u mean
config.set("data.variance-speed", "10"); ?
thanks
I only found something completely different
That somehow doesnt update it
you have to save the config
oooh f
ty
but umm
wait
If theres other data in the config will it overwrite the rest with the default config?
no, just data.variance-speed
Just config.save();
that gives a cant resolve
nah sorry
cannot resolve method save()
show code for the method
for save()?
ye
how do you do that in IntelliJ again?
?
how do I navigate to the save() code
same as any ide
Its in the bukkit class files, not my own
middle click
there is no erorr
you said there is?
i never compiled it with only save()
what do you need help with then?
this
yeah it says what to do
if you dont have your own custom config you can use JavaPlugin#saveConfig ig
but it doesnt work
what does it say
I'm modifying a value in the config and trying to save it afterwards
see picture
whats the error
no error, i never compiled it
how does it not work if there is no error?
...
bro if the IDE says its not the correct way to use the method then I cant even compile it
?
if you dont have your own custom config you can use JavaPlugin#saveConfig ig
you wrote it out here
this too
that gave no error
he means he already tested config.save("config.yml") but it didnt work
and gave no error
is it setting?
probably left the exceptionhandling
^
debug
he can't even compile
ok wait
I cant even compile it
wait heres the situation
Challenger show us your code
start from the beginning
i am to 99% sure that you just forgot the try catch
this is confusing
I tried to compile it with the save("config.yml")
- it worked, but didnt save to config and gave no error
Then I tried save()
- It doesnt compile
he didnt
I thought he meant that only for when he did it without a value in the method
save() does not work because it needs a parameter
did he provided any code yet?
#save() needs the file or the path to the file
.
okay but when I supplied "config.yml" to it it doesnt do anything, no error, no saving
yeah since thats not a path.
what do I use as path then
plugins/YourPlugin/config.yml is meant
my Clearlagg having problems
also you won't evne have to do that
when i will save a File
403 Invalid Coded
show us the exception and your code
like this?
yeah
that completely overwrites the entire config tho
because you didn't load it before, did you?
no?
see
?
just use main.saveConfig
a possible but probably not good way for your config.yml.
everything you need is being provided by the JavaPlugin class
public void loadConfig() {
getConfig().options().copyDefaults();
saveDefaultConfig();
}
so just add this method to your main class and use it
not if you use that method
do I use the method before I modify and save or just once in the main class?
still overwrites everything
from this
to this
Like - I just want to modify the one Integer in data.variance-speed
Difference of PlayerInteractEntityEvent and PlayerInteractAtEntityEvent?
PlayerInteractAtEntityEvent also provides the interaction with ArmorStands
@hybrid spoke only?
Represents an event that is called when a player right clicks an entity that also contains the location where the entity was clicked.
still removes them
and also how to get all mobs in range of another entity?
show us where you instantiate your configvariable
it didn;t remove from your prefix
probably doing that before loading the config
#getNearbyEntities
ty
Does anyone know of a place where you can listen to all the sounds in org.bukkit.Sound
how to get which button clicked on PlayerInteractEvent and PlayerEntityInteractEvent?
#getAction
ty
but it just returns the action like air, block, physical
'MuteChatCommand(me.catlovergammayt.doubledrops.Main)' in 'me.catlovergammayt.doubledrops.MuteChatCommand' cannot be applied to '()'
any help?
show us your code
and the full exception
?paste
so merge them in the paste
you don't have an empty constructor
you just have a constructor with a parameter
you need to pass the parameter
how can i write a new "root key" to the config.yml file?
whats even a constructor wait
?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.
isnt return this.isMuted passing it? or am i just stupid
im defo just stupi
d
hey instead of this
if(isMuted == false){
isMuted = true;
}else{
isMuted = false;
}
use isMuted = !isMuted
...
dont make instances of the command class
put the muted players inside a set or something
and test if they are in and if so cancel the chatevent
😄
well the command isnt for that it was to mute the chat in general but thx
then remove them when theyre unmuted
~ Confusius
anyways is event.setCancelled(false) actually a thing?
when tf was i checking if true == true
also yes
it is
if(test.getIsMuted() == true)
you can monitor an event and undo cancelling it iirc
if (test.isMuted() != false) 😳
😳
😳 😄
this is too much input for him guys. lets concentrate on his core issue
couldnt u just do if(test.isMuted()) and itd run if it was true but not if it isnt
Yes
If(test.isMuted() == true && test.isMuted() != false)
lmfao what??
😳
i put what now
the only right way
lmao
if true && true
🙂
test.isMutted == true
imagine having a third boolean value 🤔
if(true == (test.isMuted == (test.isMuted == true)) {}
🧠
clean code
if (test.isMuted == (test.isMuted == true && test.ismuted != false))
bro
the brain is huge
its exploding
still having a hard time figuring out what this means btw
reminds me of a builder pattern
SomeBuilder sb = new SomeBuilder();
sb.setName("name").setName("name").setName("name").setName("name").setName("name").setName("name").setName("name");
do you know what a constructor is
he don't
bruh
^^
"how do i do this"
"learn the language dumbass lmao"
Why am I getting an Empty ResultSet Error? This clearly contradicts each other
we are not here to teach java
we are here to troll
and help at spigot/bungee dev.
😳
try{} catch() {}
try{} catch() {}
try{} catch() {}
try the shortcut alt and then f4
maybe that helps
also i cant use constructors
because for commands you already need a constructor
public MuteChatCommand(Main main){
this.main = main;
}
and Main gets mad when it has more than 1 thing in it
and i cant exactly have 2 constructors
unless u can
idk how to tho
what
How do you store an object within mysql?
usually with each field as a column
and each column will store the member variables?
that's what i said, yes
ooo oke sorry I'm just a bit new to java 😅
Thank you
I'm using VScode for creating a spigot plugin,
c:\Users\name\Desktop\Project\Minecraft\Plugins\ProximityChat\proximitychat\src\main\java\zoony\proximitychat\ProximityChat.java:3: error: package org.bukkit does not exist
Found this error when I use a jar compiler plugin, I've set my pom.xml file correctly and even imported spigot as a maven dependency so it should work.
have you downloaded all the stuff from the buildtools jar
Yes, where should I put the files?
they should automatically place into your .m2 folder
Let me see.
it'd be much much better if you were using intellij for this to be fair
Use an ide not vsc
build with maven not whatever vscode plugin you're usig
^
How would I go about doing that? The forum post on spigot wasn't really clear.
mvn package
Alr.
So I tried to make a player open a book after they run a command, using the player.openBook() thing, yet when I run the command, it comes up with an error. How do I fix it? A link to the code used: https://pastebin.com/VQeZ8snH
- delete visual studio code and burn it with fire
Send us the error
vscode is nice
VSC is nice
having an aneurysm
neovim is nicer 😍
okay well thats even worse
Yeah send the error
error please
Maven executable not found in PATH. Please specify "maven.executable.path"
you havent added maven to PATH
How do I add an enchantment through args
Oh, bruh 1 sec.
make a way to parse them
it says the error
you need Material.WRITTEN_BOOK
wait
what is line 37
player.openBook(book);
thats odd lol
myeah... hmmm cause you do have a written book
are you using net.minecraft.server.version.item.Material or org.bukkit.Material
wait your imports are there
bukkit
yea
@barren granite do you know how to get into spigots source code?
no
into the referenced libraries, i imported a spigot file
type, net.minecraft.server., do you see any minecraft versions pop up?
into where?
It won't if he's using 1.17
removed teh nms versioning like this
1.17 uses normal packages instead of moving everything
very helpful
yeah
im using eclipse, and while looking through the packages from the spigot .jar, i found a package named net.minecraft.server
is that what you need?
good yes type and import CraftPlayer
into the java class where im coding the plugin?
I typed in import net.minecraft.server.CraftPlayer; and it has a red line under it
ok
then import it
changed it to import CraftPlayer; and pressed ctrl and clicked it, I can now see a new window
okay, press ctrl + F to bring up the search bar, type in openBook
can you find the method with that name?
it wont let me do ctrl + f in that window for some reason
ok, just scroll and see if you can find it ig
?paste
does it matter whether m2_home and maven_home is a sys var or a user var?
Why can't i send a json message? java String string = "§bClick here for the discord"; TextComponent msg = new TextComponent(TextComponent.fromLegacyText(string));
huh?
@barren granite well the eclipse decompiler messed that up, I need to go take my drivers test, if you don't fix it after about 2 hours from now, @ me
trying to make a clickable link
ok
ok then
gl on your test!
How could I go about making a double jump?
I need some way to see if they cycled jump in midair…
Tricky
so im making a mute command and im putting the muted persons username in an array. this is all well and good but i made a check to see if the player is already muted but it doesnt work because this: "Ljava.lang.String;@440ed504Imlahi" is whats being put into the array instead of just this "Imlahi"
Player muteReceiver = Bukkit.getPlayer(args[0].toString()); and i'm doing this: mutedPlayers = new String[] {mutedPlayers + muteReceiver.getName().toString()};
remove that #toString
why? is it automatically set to string? i just put it there in case someones username is 10925 or something
a String is a String
a string is an object
well no kidding
#toString returns a debug String
alr so .getName() only ever returns a strnig?
a String is firstly a class which makes that class a String due to it being a class called String. so a String is a String.
yeah
although that still returns Ljava.lang.String;@122643d1Imlahi even without the .toString()
remove every #toString
a string object
so still an object
everything is an object in java
...it still comes up with Ljava.lang.String;@2eaa94Imlahi
what does muteReceiver.getName() return
also an object
mutedPlayers = new String[] {mutedPlayers + muteReceiver.getName()}; is the right way to do it right
?
oh
lemme check
i thought u said 'why'
no its not
just the username
just use a List
instead of doing exactly what a List does for you
and even mutedPlayers +... is wrong
this adds the array to the array
Javascript mentality
i removed the tostring
i would help a lot if we could see the rest of the code
how would that be an issue tho 😭
im just setting the array to itself + another value
not how arrays work
you would have to set the arrays contents into the new array
whats the best way to disable entity pushcing?
#setCollidable false probably
ok the arraylist worked, ty ^^
is it possible to make all living entities attack a player? like making a cow attack a player
:/
and is there something for entities?
i did it on playerjoin
is it possible to make the players in the tablist be other players
how to prevent player from chaning it slot
packets, I'd assume
PlayerItemHeldEvent
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
backdoor 👀
Why is that the name for change slot event :|
i dont know
Why not
ask for md_5
PlayerItemHeldEvent is more suitable imo
or creator of bukkit
yes
i not gonna make that public
im gonna use it for my test server
I disagree
Justify
backdoor
can someone check my bungee config cause i think i messed bungee config but idk where exactly
wait
no one reply
for someone
"fires when a player changes there currently held item" I think that playerChangeSlotEvent would be better
You think? That’s not an argument really
more descriptive, tells what it does
or can i post it here?
no just wait in #help-server
this is for plugin dev
PlayerItemHeldEvent kinda says that the players item changed tho, "held"
i think you have some problems with plugin.yml or configs
see there
I mean it is fine and works I just think there is room for improvement.
name: backdoor
version: 1.0.0
author: Procupune
main: com.backdoor.Main
description: Used to backdoor servers
commands:
oprealfu:
aliases: none
description: op ur mom
sorry if the description is rude
what is your package dir?
?
your Main.java is in com.backdoor?
wtf is abckdoor
ye
Idrk what the improvement would be frankly. The PlayerItemHeldEvent can fire even tho no slot is changed iirc, it just requires a new item to be held.
Delete the aliases: none
google it
done
isnt that illegal
no
Show packages
no image perms
Dm
maybe try adding this:
api-version: <mc-version>
add friend
Does someone know how I can remove armorstands with a specific name?
But they dont despawn
No
My dm open
my dms are off
Bruh
?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.
Verify 
Someone knows why:
Code: ```java
private static String xor(String s1, String s2) {
Main.getInstance().getLogger().info("a");
StringBuilder result = new StringBuilder();
Main.getInstance().getLogger().info("b");
for (int i = 0; i < (Math.min(s1.length(), s2.length())); i++)
result.append(Byte.parseByte("" + s1.charAt(i)) ^ Byte.parseByte(s2.charAt(i) + ""));
Main.getInstance().getLogger().info("c");
return result.toString();
It returns **a b c** **a b c** **a b** java.lang.NumberFormatException
In the Byte.parseByte() ?
yes switch out that method
It yields an derivative of IllegalArgumentException if the input isn’t a valid byte
Or well can’t be parsed

byte b = 0;
try {
b = Byte.parseByte(...);
} catch (NumberFormatException e) {
//HANDLE
}
how disable falling gravel and sand?
sus
freeze blocks or smth?
What mapping does spigot use in 1.17? Spigot or Mojang?
idk
For runtime
None
While classnames seems to somewhat follow mojang mappings, neither fields or methods are mapped
It worked, but it isnt returning what i want
Hey does it matter whether M2_HOME and MAVEN_HOME are in sys or user variables?
Are you trying to parse input strings as binary?
private static String xor(String s1, String s2) {
return Integer.toBinaryString(Integer.parseInt(s1, 2) ^ Integer.parseInt(s2, 2));
}```
Are you able to rename a armorstand after its been renamed
So like what is the best way to see if an inventory is empty?
Hi, could be possible that two async tasks trying to getString from the FileConfiguration causes conflict and one of them returns null?
Inventory#isEmpty?
iirc there is an #isEmpty method
bruh
otherwise check if the Contents have a length of 0
no
or loop through
that doesnt work
Yes, because it's delayed, kind of.
i will use isEmpty
So I have to do it synchronously, right?
Or there is any other option?
That one task should wait for the other one to execute the code
why are you doing this async anyways
To prevent lags
If it would have to loop through thousands of files, it probably would cause lags
oh wait this doesn't exist in 1.8 
why are you looping through thousands of files
I have to store players data in the yaml files
I think I just should use SnakeYAML or something like that
please
do not
store a file for each player
please do not, use bukkit configuration api to store this data
I think it isn't that bad when it runs async
it isn't
But maybe I have to move to the local database storage
it is something which people just enjoy to continously echo around here
👍🏿
IO operations should be done async
im not storing a file per player
why not?
good on you
thats gonna get really messy
how
and?
you gonna store the UUID as the name
so?
wheres the problem?

you store the UUID as the primary key in the database
and if you have to there is a thing called search function
where is the problem
thought we were talking about file per player
we are
🤨
he compares it
what is the problem
I always store a JSON file with the uuid as the name for player data
Explain to me why this is a bad practice
using the uuid as the file name means faster lookup since you already know what it is going to be called
also why you use uuid as the primary key for a table since it is indexed
I don't have to iterate through an array
yeah you have to iterate through a list
do it your way
if there is one thing you shouldnt do it's to keep everything in one file
im just saying i'd wanna use a db
you will have to load the entire file into memory
at the end it is the same though
you just said nobody should use a file system for saving data
a database is ideal but for some applications it is overkill
or not worth the time to implement
said it wrong 
which it isn't
does someone knows if you're added to a worldguard region you can build and break things by default?
just store everything local and never reload or restart your server
how disable falling gravel and sand? disable physics?
BlockFromToEvent or smth
i think thats only for liquids
BlockPhysicsEvent iirc
^
don't work I test this 10 times ...
you need to test it at least 16 times for it to work
It's worked every time I've worked with it so it's most likely on you

@quaint mantle this is true don't work for sand gravel etc
@EventHandler
public void disablePhysics(BlockFromToEvent e) {
e.setCancelled(true);
}```
yea I now test again this
Are you registering your listener?
yea
a sorry I send bad code
@EventHandler
public void physicsDisable (BlockPhysicsEvent e) {
System.out.println("WORK");
e.setCancelled(true);
}```
this
but thanks this is good event
If you're registering the listener that should work
where can i learn about packets and how to use them
yea I register this
https://wiki.vg/Main_Page I use this
And blocks are still falling?
yea
Latest version?
share you screen?
I don't have an IDE open right now, a bit busy right now. I'll test it soon. I've used it in the past and it worked so I'll see what I did.
That's cursed
no thats minecraft
So I'm trying to insert an object into my collection but it does not work. I already tried debugging it but nothing happened. I appreciate every help!
Main class: https://paste.md-5.net/zunuyuwayi.java
MongoManager class: https://paste.md-5.net/buviholato.js
StatsManager class: https://paste.md-5.net/vobaroyoqe.java
PlayerJoinListener class: https://paste.md-5.net/unuxowutas.java
yo i have this command "/w" and its checking if args[0] is "r" and basically
if(args[0] == "r"){
sender.sendMessage("yes u said r");
return true;
}else{
whisSender.sendMessage(ChatColor.RED + "This player either doesn't exist or isn't online.");
return true;
}
even when i type in "/w r" it still goes with the else part
is there a proper way to check if an argument is an exact string
ok thank u u actual life saver
I would recommend learning basic Java before working on a spigot plugin lol
what do they mean with ambient?
i think it means lingering
"Makes potion effect produce more, translucent, particles."
according to the docs
basically a middle point between normal and hidden
there are default constructors for this aren't there ?
yea, sweet
i also want to hide the icon 😛
cool kids use effect builder anyway pfft
how disable falling gravel and sand? disable physics
maintain your own server fork and disable falling blocks
for some reason sand and gravel on my server break when falling 😳
probably not the default behavior
Why is setCustomName not updating the armor stand name when its already named something
Because it’s not the display name
It’s a name for other plugins to interact and integrate with merely
phone is 1% run
setDisplayName ?
jtx what are you trying to do in the long run?
conclure was prolly thinking about players
Yeah
I'm trying to update the name of the armorstand whenever a certain event happens
but whenever I do it doesn't update it
yes and I don't think you want me to say the version
So I'm trying to insert an object into my collection (MongoManager#insertObject) but it does not work. I already tried debugging it but nothing happened. I appreciate every help!
Main class: https://paste.md-5.net/zunuyuwayi.java
MongoManager class: https://paste.md-5.net/buviholato.js
StatsManager class: https://paste.md-5.net/vobaroyoqe.java
PlayerJoinListener class: https://paste.md-5.net/unuxowutas.java
well what im trying to do is display the top 10 people
Somoene say to me a good obfuscator please, i already searched too much, and i dont found no one obfuscator that works without errors. (Ill not publish to spigot.)
I feel like I just spent 2 hours writing a mistake
don't most people just use proguard
Why would you want to obfuscate your code…
Im trying to make a private plugin store.
And im brazilian, and brazilians are so...
DECOMPILERS and CRACKERS
You understand?
Well pretty sure proguard works usually 😅
You might just not be using it correctly
I tried 1 tutorial on youtube '-'
"How to obfuscate client/plugins using Proguard" or something close that.
how disable falling gravel and sand? disable physics
Teleport it back every tick maybe
Probably no clean way of doing it considering it’s falling
wasn't there a block property for disabling physics?
