#help-archived
1 messages ยท Page 92 of 1
@tardy lance openedInventories.put(UUID,Inventory)
Map<K, V> map = new HashMap<>();
i usually define them so theyr locked on what types i want..
Yeah
@naive goblet yeah, i changed it ๐
Is that for inventories?
Okay HashMap is probably good then ๐
Okay, how do i get a value from a Hashmap? So if i give him the uuid that he gives me the inventory
So the K
Which is the Player in this case or the UUID
Works as keys
So if you have a UUID or the K value you can always get the value
Map#get(UUID)
okay thanks ๐
Would give the Inventory or eventually null
Ohh this is very practical with Hashmaps ๐
Maps in general
Well you should definitely learn about data structures as they come handy frequently
i am c# "main". But now i want to make some minecraft plugins ๐
c# for unity games ๐
Ahh unity good ol days
I mean doesnโt Minecraft has Bedrock in C#?
Oh idk that
Yeah but its extremly limited as there is no spigot api or anything close
You are hooking directly to the server..
Yeah
So, how do i call those methods from My InventoryManager.java class on my Command.java class? And do i need to list my Inventorymanager in my Main class?
Yeah make an efficient getter in main
ehmm ๐
class Main extends JavaPlugin {
private InventoryManager invMan;
@Override public void onEnable() {
invMan = new InventoryManager();
}
public InventoryManager getInvMan() {
return invMan;
}
}
class Command implements CommandExecutor {
private final Main main;
public Command(Main instance) {
this.main = instance;
}
void method() {
main.getInvMan();
}```
Hi Mr.T
i have a skyisland plugin on my server (iridum skyblock), and when you gather items (that are pretty easy to get diamonds, emeralds ect), and /home or /warp home the player takes everything off the island, and can smuggle stuff in. Does anyone know any type of fix i could use to avoid this?
Yo, anyone know why my fly speed with essentials isnt changing. Other speeds are working
Ehm @naive goblet ?
Big oof error?
Fatal error trying to convert VerilyzedsCoolesDing v1.0.0:de/verilyzed/economy/commands/BuyHorseCommand.class
org.bukkit.plugin.AuthorNagException: No legacy enum constant for HORSE_SPAWN_EGG
seems like the version you're using doesn't have that enum anymore
well if it was wrong it wouldn't compile
Did you forget to define api-version: 1.13 in your plugin.yml?
oh
(or 1.14, whatever)
i didnt define everything
that might be it
My plugin.yml:
name: VerilyzedsCoolesDing
version: 1.0.0
main: de.verilyzed.main.Main
description: My plugin for all things!
author: Verilyzed
commands:
kilian:
usage: /<command>
description: Benutzen
npc:
usage: /<command>
description: Spawn npcs
money:
usage: /<command>
description: Check money
admin:
usage: /<command>
description: admincommands
buyhorse:
usage: /<command>
description: buy horses
You're missing api-version
api-version: 1.13 (or 1.14 if you're using features added then)
so how can i implement this?
Literally put that string of text in your plugin.yml dude lol
I don't know how much clearer I can say it
ah okay ๐
Should fix that error and you can use modern Material constants
yea know it fixed it ๐
Hello! When I do on a bungeecord plugin:
ProxiedPlayer player = plugin.getProxy().getPlayer(event.getReceiver().toString());
how wa can do that since it's bungeecord, so there is no receiver/player, right ?
Btw my event is PluginMessageEvent event
So spigot send to bungee a message, bungee get it, but there is no player ?
hi! how can i change my username on spigotmc?
?changename
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
How much money do I need to donate?
it works @naive goblet @vernal spruce ๐ Thanks for your help
Hi someone know a method for create client sided npc?
Client side NPC?
Do you mean an NPC only one player can see
if so, you just have to send the packet to only the player you want to be able to see it
create an npc as normal, then just send the packet to the player you want to be able to see it
Using protocollib?
not necessarily
Using NMS code but some method are restricted
Ok thans i asked It beacuse i developing an anticheat
I donated $ 10, how i will know status did I get?
Anyone know why line 31 isnโt working correctly, the color isn't being added to the string: https://repo.voidcitymc.com/ramdon-person/ChatMentioning/src/branch/master/src/com/voidcitymc/plugins/Chat/Chat.java
I'd use lambda
Much cleaner and easier to look at in my opinion.
Also make the tabs and spaces indentations consistent, doesn't render nice.
fierceeo idk if getLastColors is reliable. Maybe stripColors?
I have iron golem farm on latest spigot and villagers just randomly go out of their cages, any ideas why?
I tired editing entity activating range and even that does not work
It was fine on older versions
@naive goblet but doesn't strip colors remove the colors?
what?
I donated $ 10, how i will know status did I get?
๐
if i have a house, on a multi player server, could i use world edit to copy that house, and paste it into another multiplayer world? how?
If you're an administrator, sure. You could save the schematic and grab it from the file system
Otherwise, no. You'd have to use some 3rd party mod. Schematica or World Downloader
Whats a good free easy to use custom mobs plugin for spigot 1.8.8 that isnt mythicmobs
Is there any way to use an Entity Damage Event to detect a player's death?
I need to get the cause of the death but It does not seem to be triggered when a player dies from damage
Where can I advertise?
nowhere
@grand aurora PlayerDeathEvent, Player#getLastDamageCause()
Thank you so much!
Returns an EntityDamageEvent, can cast and fetch whatever from there
It likely won't. Bungee isn't Bukkit and they, for the most part, do not adhere to the same guidelines
Bungee can still reasonably maintain 1.8 support. It's a proxy after all
It's not like it knows anything about the server or the client (content-wise). Just that it needs to bridge the two
When I sell spawners on chestcommands with command 'es give {player} creeper 1 1' it says "You do not have permissions to do that". How can I fix that
Whenever I try and run my new bungee network, it says "if you wish to use IP forwarding, please enable it in your bungeecord config as well" but I already did that. I also disabled online mode in both of my spigot servers and enabled bungeecord.
97.73% 169.38% 146.01 s 84.69 ms 1.0 1.7k Full Server Tick
Learn More
80.36% 139.31% 120.05 s 69.65 ms 20 35.0k Scheduler - Sync Tasks
80.36% 139.24% 120.05 s 69.62 ms 20 35.0k Tasks
How do i fix these timings
the timings built into spigot aren't great. i'd recommend getting a timings report from a certain fork :p
Iโve wanted to create spigot plugins for a while now. I know some java, not too much. And have started creating some simple plugins by following some tutorials (join+leave messages) do you guys recommend I go back and fully learn java? Or continue with the spigot plugins?
I learned Java by making Spigot plugins.
To me, it's easier to learn a programming language when you have a goal in mind and how the language you're learning applies to that goal.
Just know to differentiate between the API and Java. Do your research as you go. If you don't understand something, Google it and learn
That makes sense
If you're following Spigot tutorials, and the Java gets confusing, you can always go back and research something.
You should have a firm understanding of what is and is not standard Java
^
Alright, so I should continue with the spigot plugins and go back if I donโt understand things?
If you have questions, I'm sure someone here (myself included) can guide you to the appropriate place
Yes
Awesome. I appreciate it guys
I find that learning through plugins is great so long as you're willing to do your own research. Seeing what you write be applied in real time and to give you immediate feedback is rewarding and motivating.
Yeah ๐ it felt great to see some of my plugins start working
but yea, quick questions, I'm sure most here are willing to either help or link articles
Try to avoid creating a thread on the forums for more basic questions. A Google search will often yield answers and if not, if it's a small issue, the Discord is the more appropriate avenue for assistance
Big issue that requires discussion about the API? Forums!
Sounds good!
And here comes the big question
Eclipse or IntelliJ o_O
Or notepad ๐
It's a matter of preference. Try both
I prefer Eclipse, another prefers IntelliJ, md and others prefer NetBeans
Hell, I remember seeing someone say the use Code::Blocks
Anyone know how to shade MongoDB into my jar with Maven? I'm struggling rn with this https://mongodb.github.io/mongo-java-driver/3.8/driver/getting-started/installation/ . I use the sync drivers, and when I use it in my pom it just shows up as red.
Think that might have been for C++ though ;P
Iโve looked over my options, and Iโve chosen notepad
no point to start arguments between IDEs as it's a matter of preference and people are just salty.
I feel it's a fair competition between both IDEs with their ups and downs ofc.
anyone who argues after that comment needs to relearn sarcasm
Lol, eh I only do it after people repeat the boring sarcasm multiple times
much like when i'm programming, everything i say (or write) is 100% unoriginal!
?paste
@sturdy oar Supporting 1.8 is not hard as supporting 1.7 so it will probably be kept
1.7 was dropped for a good reason
I think 1.7 doesn't even have netty, apart from some entity rewrite and lack of uuid system
UUIDs were added in 1.7.6 iirc, so the latest (1.7.10) had them at least
does anyone know if this event fires for naturally spawned wandering traders
or know a way to force a natural spawn
https://github.com/jmanpenilla/WanderingTrades this works for egg or /summon traders but I found a naturally spawned one that didnt have my modified trades
and I cant get another natural spawn to try and troubleshoot
im currently afking in a test server to try and get some traders to naturally spawn lol
it works for natrually spawned villagers now im rly confused
Hello i have a problem with PluginManager.
I have my ghost system work in 1.8 (i edit PluginManager with my PluginManager) but in 1.12.2 it doesn't work i have this error : java.lang.IllegalArgumentException: Can not set org.bukkit.plugin.SimplePluginManager field org.bukkit.craftbukkit.v1_12_R1.CraftServer.pluginManager to fr.florgiox.xxx.api.ghostplayers.v12.GhostPluginManager
How can i fix this in 1.12.2 ?
oh dear
what the hell are you doing
lol
This sounds almost as bad as the resource that forcibly injects its own entity tracker into the server through CraftBukkit and breaks my plugins
Wut ?
You're trying to replace Bukkit's plugin manager with your own. Don't do that
Why ?
It's inevitably going to break every single plugin on the server if you fuck something up
It work good on 1.8
Yea, welcome to 1.15.2. 5 years later
You have to realize that every single plugin is loaded through Bukkit's plugin manager
They rely heavily on knowing that it's implemented by Bukkit
Yes but how can i do that
What possibly could you be doing with a plugin manager implementation? Why do you want to replace the one supplied by Bukkit?
For change specific event
you can modify most things that you need anyways?
really, what's that event?
shouldFire
full name?
You can literally manipulate most default Minecraft events by registering listeners that do certain cancellations. >.<
anyone know how to create an entity in spigot?
I would like to edit plugin manager for my ghost system
how do I do this
ChatColor.translateAlternativeColorCodes('&', config.getString(path));
but with a list
Probably just easier to do a for loop
anyone know how to force a natural spawn of a wandering trader
through spigot api or commands or anything
Pretty sure thereโs a spawnEntity method under World
thanks I will check that out
@ashen stirrup when i put it in my for loop it wants me to change it to a string rather than a string list
So for explain, I would like to cancel only all fireEvent in my pluginManager for replace with by mine
For each string in the string list, colorise it and add it to an array list or something or concatenate it.
ChatColor.translateAlternateColorCodes('&', plugin.loadString("HelpMessage"));
what alternative to this do you propose
you want to color all list huh?
I want to color different strings in the list
different strings?
Like
help:
- &bhi
- &cwiw
Use concatenation
first of all plugin.loadString("HelpMessage") wont return list
ill try that out
just cancel event before all others
@fair abyss Yes but how ?
@hallow surge example
player.sendMessage(ChatColor.translateAlternateColorCodes('&', msg))
}
@long hollow there is event priority
LOWEST Event call is of very low importance and should be ran first, to allow other plugins to further customise the outcome
if you annotate with this
your listener will run first
public void on..```
@fair abyss its really weird that just deletes the string with the & on it
public void entityMetadata(byte m) {
try {
Field field = Entity.class.getDeclaredField("W");
field.setAccessible(true);
DataWatcherObject<Byte> datawatcherObject = (DataWatcherObject<Byte>) field.get(null);
DataWatcher dataWatcher = new DataWatcher(null);
dataWatcher.register(datawatcherObject, m);
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entityID, dataWatcher, true);
sendPacket(packet);
}catch (Exception ex){
ex.printStackTrace();
}
}
This code worked for me in 1.13 to make my NPC crouch, anyone knows why it just doesn't do anything now on 1.14? (no errors either)
(please ping me if you answer)
@fair abyss It's possible to go mp ?
mp?
private message ^^'
probably yes
@hallow surge didn't understand?
@fluid marlin theres librarys for changing entity's metadata
and theres library for them too
LivingEntity#setMetadata wont work.
just not by spigot
how can I make an armor stand a living entity?
casting it?
I'm looking to use NMS to make my npc crouch on 1.14
oh okay
I have code that worked on 1.13 but I'm sure what's wrong with it now
thanks
Been trying to solve it for the past hour and got nowhere
how can I set a living entities yaw?
choco, are you there
do you know about, spigot-site api's problem with spigot's cloudfalre
Could someone help me with my crash?
https://paste.md-5.net/xizenibene.cs : Crash
I want to call a method from my PlayerJoinEvent
https://paste.md-5.net/ewojuzepiy.cs : Code PlayerJoinEvent
It is this line of code:
fm.createUserFile();
you need to create the file before getting the file
have no idea what your datamanager code looks like
but, generally can't get something if it doesn't exist ๐
https://paste.md-5.net/ubudasuxot.cpp : Code FileManager
creating file for each player when join
meh
store all data in a map
and save them on shutdown
do you know about, spigot-site api's problem with spigot's cloudfalre
@fair abyss https://www.spigotmc.org/threads/connecting-to-https-spigotmc-org-always-triggers-cloudflare-ddos-check.440128/
My only guess
File userdata = new File(Main.getInstance().getDataFolder() + "/userdata/" + uuid)
what kind of file are you trying to create here? yml file?
thanks choco
no only file
arent you creating this for all player?
@keen compass it worked without that method fine. but i wanted to clean it up
yes i am
dont do this
if the player wasnt on the server before it creates a file
save everything in map
and then create your file on shutdown
you can load every data to map on enable
idk something about maps
learn it
lol
instead of using teleport to set an entities yaw, is there any way I can directly modify it?
it needs to be changed to this then
File userdata = new File(Main.getInstance().getDataFolder() + "/userdata/", uuid);
if you don't change it to that, what it actually creates is a file named /userdata/(usersUUID)
@pastel condor dont think so
๐ฆ
probably not with spigot api
I'm trying to make a vehicle plugin
maybe sending with special packets
oh
and im not into this
kk
it needs to be changed to this then
File userdata = new File(Main.getInstance().getDataFolder() + "/userdata/", uuid);if you don't change it to that, what it actually creates is a file named
/userdata/(usersUUID)
@keen compass this doesn't work.
if i make a comma over there, it gives me an error
instead of using teleport to set an entities yaw, is there any way I can directly modify it?
That is the way to directly modify it
When you change it on the server, a packet has to be send to the client telling it that it's been teleported
so what kind of map should i use? @fair abyss
When you change an entity's position, it has been teleported. Period.
but I only want to change the yaw, not the location
pitch & yaw are location
oooops
pitch & yaw are location
just change the yaw and pitch
Consider these values much like x, y and z. They are a position and rotation in the world. They are one in the same when considering teleportation
oh okay
You can change the pitch and yaw on the server directly all you want but if a teleportation packet is not sent to the client, it will not update
A teleportation has to be made
I simply want to rotate the players head
You can use packets to do it without updating location
@keen compass The constructer File is undefined
oh okay
That packet updates the entities rotation which is the pitch and yaw
There we go
oh thanks
Forgot about that for a bit
thats what I need ๐
@fair abyss do you mean a hashmap?
you should learn java first @tardy lance
Maybe 1.14 if I'm being generous. I know it was recent lol
okay lol
because i worked once with hashmaps @fair abyss
Another example of not using outdated versions ๐
another example of not using otdated versions: Some events can be trigger while it or it's part is null
anyone know how I can get (not set) a players yaw or pitch?
getLocation()
its part of the location
I see thanks
getLocation().getYaw() and getPitch() if I remember right
do note that the yaw can be negative. It is dependent on the way they turned
so, negative means spinning to the left and positive means spinning to the right. So you can have -180 and 180 which are the same lol
Yaw and pitch is fucked in Minecraft. Heh
Really, the entire coordinate system is
North is -z for instance
lol was about to say
isn't it forked from other's code
Which makes sense in the context of a game engine, but not at all in world coordinates
Yaw shouldn't contain negative values
not entirely sure why they implemented it that way
but because they implemented it that way you can also have -0 and 0
so if you are not aware of that you can have getYaw() == 0 return false all because it is -0
LMAO. That I did not know
and I hate it
Wait how does Math.abs() handle -0? Does it make it 0?
absolute removes the sign
I still don't want to have to abs my yaw ๐ฆ
That is why generally circles do not incorporate negative values. Since I mean, not like you should be able to get anything else other then what is defined XD
your circles shouldn't be turning into polygons
my english wont enough to understand one upper ^^
I may be speaking out of my ass here but I think -0 == 0 will always be true because the compiler will optimize -0 to 0
im thinking that too
I'm going to double check that
Just not sure if that holds true for a returned value
-0 is a literal
That's still a literal. Would have to be some operation
return the value and then compare the value

is this a good way to make a player faster? passenger.setVelocity(passenger.getVelocity().multiply(/*speed*/2));
also, is the -0 == 0 also true for floating points and doubles?
int lel = lel(); System.out.println(Integer.compare(lel, 0));java 7
says 0 whic is same as equal
because I am fairly certain yaw is a double if I remember right
or a float one of the two
float
interesting, I can't seem to find any information on it for java. Only other languages where you have to do that check yourself XD
used double
still true
maybe about "jvm"
that converst all code to fucking ununderstandable thing
bytecode isn't completely not understandable lol
yeah I know some of you can understand, but nobody can easly read it as normal
can be ambiguous if generics are used though
mentioned that,
some can understand basic things
I can understand too
but not very much
then
here you go
false
@keen compass @subtle blade
try {
double lel = lel();
System.out.println(lel == 0.1);
} catch (Exception e) {
e.printStackTrace();
}
}
private double lel() {
return -0.1;
}```
wait
cus
its really false
damn
ah my brain
dont see try i was writing another code, removed due to trying with java 1.3
Well, yea. -0.1 isn't 0.1. We'd have issues if that were the case ;p
๐
public void addBoost(BoostType type, int time) {
Boost boost = activeBoosts.getOrDefault(type, new Boost(this.uuid, type));
if (!boost.isActive()) {
boost.activate(time * 20);
} else {
boost.extend(time * 20);
}
activeBoosts.put(type, boost);
}
is there a nicer way to do this
is there some sort of getOrPut that will return the put value or the retrieved value, lol
ok, so I learned more on the -0 and 0 problem
@fair abyss no
if it doesn't contain, i need to add it
just the put isn't necessary if it already contains
Java implements that they are equal, however if you do arithmetic on 0 and its negative, well you end up with negative numbers and vice versas. So if you don't want negative you should check if the the 0 is negative first lol
Im getting frustrated...
so, that means when messing with Yaw, you can end up checking if its 0 only for it to be -0 and do the wrong kind of math on it
So that means you might still have to abs(0) XD
nah i think @fair abyss has a point there
So while although Java knows that -0 and 0 are equal to each other, what it doesn't know is which infinity you want and therefore will not turn -0 into 0 for you
so most of the time not an issue, but can be in MC though
@tardy lance ?
is it due to "fukcing minecraft's code"
@fair abyss
For example you want an entity to turn right if it is 0, but since it is -0 and you do your math operations the entity will instead turn left
we was started this from minecraf's fucking code
and we are here
it's not minecraft's problem
in a way it is
i dont mean that
because they implement negative values for yaw
which it should just be positive values instead XD
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
and that would remove any discrepancy in which way you want an entity to turn
but it'sn minecraf's fault
It doesn't make sense !
I know math is hard sometimes ๐ฆ
maybe using 0 and 360 caused a problem
so they used 180 and -180
the yaw is implemented based on 360, however though depending which way you turn though those values are negative instead as opposed to positive
so
It subtracts 180, basically lol
@subtle blade just add spigot api to return is at abs
Nah. Breaks compat
i mean if -0
would have to do the same for -360 and -180 lol
Yea, floating point precision isn't always fun to work with
you only need 4hours to sleep anyways ๐
at least to stay functional for the most part
xD
you must be on the otherside of the world from me
๐
you are 10 hours ahead, so I will say you are somewhere like in Germany or UK area
me germany ๐
I was close XD
i still dont know whers germany
and wow what an english performance ive done there
I was left from geography in school
I learned that germany isn't just near the turkey when Im 18
How can i read THICC errors?
thicc?
You really only need the "caused by" part
you are probably a 1k miles from Germany roughly estimating
whats "thicc"?
new errors, new fustrations
Caused by: java.lang.NullPointerException
at de.verilyzed.events.JoinEvent.onJoin(JoinEvent.java:23) ~[?:?]```
That's the important bit
Thicc is thick
do you know, i dont know whats miles ๐
Ah right
NPE on line 23 of JoinEvent in the onJoin() method
I have to convert to kilometers and meters
1609KM from germany @fair abyss
on line 23:
fm.createUserSave(uuid);
I knew that this is the error, but i dont know WHY
hm cant understand 1600km whic far
that is roughly estimating
it is because i called a function outside of the PlayerJoinEvent but WHY TF IT DOESNT WORK
i am using maps know ๐
@tardy lance send code
it was null 5head
Well you have it fixed now so that is what matters ๐
i like this type of late night chat/talk โ
stay here long enough and you will learn stuff you didn't think you would learn about ๐
(I asked this question earlier but though I would ask again) is this a good way to make a player faster? passenger.setVelocity(passenger.getVelocity().multiply(/*speed*/2));
probably yes
but it's not a method?
maybe its living entity
it is
LivingEntity implements Attributable
you can change player's speed with setWalkSpeed
but probably you should change minecart's speed
oh I see
then I have to make the entity mountable
never mind I'll just use armorstandEntity.addPassenger(player);
Anyone know how to let ops be on /baltop?
pretty sure you can just remove essentials.balancetop.exclude from those ranks
How long generally does it take for a new premium resource to be approved?
depends on how many resource staff are on but generally it shouldn't take too long in most cases. Give it like 2-3 days maybe a bit longer @frigid ember
Anyone know how to get dynmap on ssl/https
I've tried to remove it, but it doesn't work.
I saw it in the config file somewhere, just can't remember where.
Would most likely need to use a proxy from nginx or apache to get https
would be easier to just serve the content directly though and more optimal instead of having dynmap host a mini webserver
Is it possible to have dynmap push it's output?
How else would one handle that situation, when they're not using a dedicated server? Via a Database?
not entirely sure
you get limited options if you go with a VPS provider that limits what you can do on said vps
okay its still not working,
error: https://paste.md-5.net/bohutiriqi.css
Main: https://paste.md-5.net/egofozuciz.java
command: https://paste.md-5.net/opeliwezit.java
wtf is wrong
Oh yeah plugin.yml
version: 2.7.0
name: SpectrumEnchants
author: TheDdosDevil
commands:
book:
description: to lazy to do one```
This is becoming really stupid xD
Hey, is it possible to give attribute ex: 154:84 84 to block(or item) with id 154 in 1.13 or latest versions ? As i know item ids removed in 1.13...
Anyone knows how can I get IChatBaseComponent from string?
lemme copy paste what I wrote at paper
if you just care about a raw string with no formatting, you can do new net.minecraft.server.ChatComponentText("Hi")
else, if you use the legacy chat format, you want to use CraftChatMessage.fromString(ChatColor.RED + "Hi")
if you use spigots component lib, you use
String json = net.md_5.bungee.chat.ComponentSerializer.toString(yourSpigotComponent);
IChatBaseComponent component = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(json);
Hey , my server is every day once close . my log file end is : https://hastebin.com/xitiriyavo.md can you help me ?
[06:58:34] [Spigot Watchdog Thread/ERROR]: me.badbones69.crazycrates.cratetypes.QuadCrate.onLeave(QuadCrate.java:149)
Yo @fleet crane u know y this wonโt work??
wtf is wrong
Oh yeah plugin.yml
version: 2.7.0 name: SpectrumEnchants author: TheDdosDevil commands: book: description: to lazy to do one``` This is becoming really stupid xD
@oak stump
what doesnt exactly work
Every time I try execute the command /book, it says it doesnโt exist, but there is nothing wrong soo
errors?
just check if it doesnt exist there should be
or, send the command class and main
But itโs registered and the code is perfectly fine
Where is the usage: /book field in plugin.yml?
Not needed lol
That may be your error
there doesnt need to be a usage
if it doesnt work then its not fine @oak stump
just send the classes
make sure you return true not false
Ye, and I havenโt registered the GUI so that might be why
@fleet crane bruh that doesnt matter even if you do return false/true
the command should work
It reads the code down so it does sometimes
im just saying that it shouldnt say its an unknown command, but what can i do when you didnt provide enough info
show me the command class and main class
THEY R THERE
Every time I try execute the command /book, it says it doesnโt exist, but there is nothing wrong soo
Sorry
https://paste.md-5.net/inusuceguy.coffeescript
With this the npc should be AAAA?
plugin.getCommand("book").setExecutor(this);
oh boy "Main"?
Ofc, I've said a thousand times that you should never call any methods from a constructor
try as he said
i've even explained it to you iirc
registering the command in onenable
why is there a reason to call methods in the constructor
for the 1001th time, the constructor is used for constructing objects and not doing any work
Lol I have registered in on enable before and doesnโt work
"doesnt work"
then most likely
ur plugin.yml
has a wrong format
even 1 " " can change something
if it throws a NPE in that line if u try it in onEnable() then your plugin.yml is fucked
Yep still does
also, do you not know how to use anything other than static?
i see only static methods
everywhere
delete the plugin yml and create it from scratch
this is confusing because we usually dont have problems with commands
Exactly
also not the best name for ur main class..
somehow the server gets code from multiple classes with same name
but they have different package names so it wont matter.
u never get errors
only if the package name is same in every plugin
and the class name too
i noticed some times that its getting method from another plugin somehow
huh
Then u have used it for ur build path or something
not rly was independent
i usually dont create stuff with 3rd party..
excluding hologramsapi
Calling it Main is fine
cause meh..
You should. Saves time
IT WORKS
I have iron golem farm on latest spigot and villagers just randomly teleport out of their places, any ideas why?
Whatever. Can you now remove the method calls from every constructor?
I deleted and remade plugin.yml
Whatever. Can you now remove the method calls from every constructor?
@brisk mango not my code, the kid doesnโt like it like that, I told him it was better in onEnable
Yes i have coreprotect
you said you are 12 and you are fully able to develop in java and keep them in a constructor
thats really good
and thats a really good attitude to do things the way you like just because you like it in java
Again with your "Caling it Main is fine" @brisk mango
Why don't you call your other classes Class1 and Class2 then? It's exactly the same.
Lol
no point
Dayum
And dynmap
No arguments -> insult. Nice
more like that you have no point
I do have a point.
It's that a class name should describe its responsibilities.
what is gonna change if im gonna call my main class name after my plugin name?
I've told you this before.
its not neccessary if its your plugin
thats not a proper reason
stop arguing
youre actually quite annoying
It's just as proper a reason to call your command handler class HelpCommand instead of Command1
Main class is an exception
Main improves my readability enough
It's just one random part.
It's not the main access to the JVM though
well what are you saying right now doesnt make any sense
can you just leave
youre not helping anyone in this channel
Just because you don't understand it, doesn't mean it doesn't make sense.
you can ask better developers than you are; everyone
they could tell you that there is nothing wrong calling it Main
and its just really matter of preference
There's plenty of better developers on this discord. You're right.
I need to fix that iron farm, and i simply cannot go vanilla.
is there someway i can get a color from a config file?
what config file
is there a way to let a entity for example horse despawn?
set its health to 0?
cant you use the EntitySpawnEvent check the "Entity" and if its a horse cant you just set the event to cancelledd?
i want a horse do disappear when i log out. the horse entity i saved in a map. now i want to get this maps horse and "kill" or despawn it
If you want the items, damage the entity (LivingEntity), if you want it gone, just do .remove()
[10:56:02 ERROR]: [VehiclePlugin] Unhandled exception occured in onPacketReceiving(PacketEvent) for VehiclePlugin
java.lang.NullPointerException: null
at de.leitung.classes.AbstractConfiguration.getString(AbstractConfiguration.java:104) ~[?:?]
at de.leitung.classes.VehicleListener.onPacketReceiving(VehicleListener.java:123) ~[?:?] [10:56:02 ERROR]: Parameters:
net.minecraft.server.v1_12_R1.PacketPlayInSteerVehicle@7a1a5dac[
a=0.0
b=0.98
c=false
d=false
]
104-> @Override
public String getString(String key) {
return root.get(key).getAsString();
}
123-> JsonConfiguration config = new JsonMaker(player.getVehicle().getCustomName());
config.init();
config.load();
UUID uuid = UUID.fromString(config.getString("Car")); <- Error is in the UUID
``` Can someone help me why I get an error message in the console
config could be null
for (String s : HubCore.getInstance().getConfig().getConfigurationSection("ranks").getKeys(false)) {
String path = "ranks." + s;
if (player.hasPermission(HubCore.getInstance().getConfig().getString(path + ".aperm"))) {
return HubCore.getInstance().getConfig().getColor(path + ".color");
}
}
return null;
}``` how come this always come back null even if the player has the perm?
@frigid ember could be because you return null
it was because how i had color in the config
Hello, when I do:
TextComponent component = new TextComponent(proxiedPlayer.getDisplayName());
component.setColor(ChatColor.DARK_GRAY);
component.setBold(true);
TextComponent component1 = new TextComponent(" > ");
component1.setColor(ChatColor.GOLD);
TextComponent component2 = new TextComponent(target.getDisplayName());
component2.setColor(ChatColor.DARK_GRAY);
TextComponent component3 = new TextComponent(" : ");
component3.setColor(ChatColor.GOLD);
component3.setBold(true);
TextComponent component4 = new TextComponent(message.toString());
component4.setColor(ChatColor.GRAY);
component4.setBold(false);
component3.addExtra(component4);
component2.addExtra(component3);
component1.addExtra(component2);
component.addExtra(component1);
target.sendMessage(component);```
component just contain nothing
wasn't it concat
no
just use the component builder?
?
or just target.sendMessage(component, component1, component2, component3, component4)
how would i hide everyone online to a player
Player#hidePlayer
with a forloop?
yeah
what would i do if someone joins?
you hide him at playerjoin
but how would i know who to hide him to? should i put people in a hash?
probabily
Regarding hidePlayers, how do you remove from it?
showPlayer
does someone has an idea how i can modify a horse ?
So skin, velocity and jumpheight
thanks
Is there something to spawn a preset horse?
I stored all information in a variable called horse (Horse horse;)
I can remove it my doing horse.remove();
but how can i spawn it? horse.spawn() does not exist
Last three questions have been answered just by links to Javadocs. Please browse first
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html#spawn-org.bukkit.Location-java.lang.Class-org.bukkit.util.Consumer-
@wraith thicket i only can spawn the class of a Horse and not the modified horse :/
p.getWorld().spawn(p.getLocation(), horse);
p.getWorld().spawn(p.getLocation(), horse.getClass());
This works but not as i wanted it to be, because it creates a whole new horse and not with my presets
Try spawnEntity
@tardy lance That's obvious. You cannot "respawn" an entity. You need to create a new one.
Since you wanted to set its parameters, I linked to the method that also has the consumer argument that you can use the change its "presets".
It won't "magically" know what "presets" you want
But you can easily just set them.
oh okay
What is the best way to get a time input from a user (ie 4d3h2m1s) and then format it down into ms?
i dont know .class file editting . How can i remove some enchantments
You don't need a plugin to cut down trees. Just use an axe.
What are you actually looking for? Something that cuts the whole tree at once?
I know some people use my VeinMiner plugin for that, though it's not tailored to trees
None of that made any sense
How would I go about checking for a vault balance update?
Orebfuscator does this. It hides ores to the client
so can i make a special chest
that is a stone block you click
to get items
so i could make a factions server
wherre x-ray is punished by a police force
Orebutscator, now that's a name I haven't heard in years
instead of a banner
Is that even still a thing?
i think sorb used it once
the player#gettargetblock always returns something?
it's still maintained
but then removed it because of lag
I thought ppl stopped using that after the more native solutions poped up
and it's been updated to 1.15
Cause you can't beat the performance or stonars impl in the fork that shall not be named
nvm found i
and also it makes redstone ore realy glitchy if you build up with it to use your super fortune
Shouldn't it only touch invisible ores?
yeah
but it did more than that
it could hide caves
and much more
tho that wouldn't be as necessary if you're looking for a simple resource system
@subtle blade i think orebfuscator has some issues tho
You're going to struggle to find anything that doesn't have issues
youre right
Papers impl is pretty flawless
But doesn't offer stuff like chest hider or cave hider
It's simple and effective
is there ever going to be 1.8 support again
the community is still big in 1.8
no
1.15 takes up a lot of ram
= code your own server jar
and then you have good 1.8 version
you can fix bugs yourself
hmm
@subtle blade how do I update my name, Isn't it suppose to auto update periodically? It has been 3 days, is that normal?
If I recall correctly, it updates on a regular period. i.e. every Saturday or something. Honestly I can just update it manually though. But really, it's an aesthetic change
What's your account?
on SpigotMC? https://www.spigotmc.org/members/poramatv.37859/
That's the one
persistent container
Thanks Choco, I thought it suppose to update every day or something, sorry for bothering you ๐
npnp
int newTime = boost.isPermanent() ? -1 : boost.calculateNewTime();
database.executeStatement("insert into boosts (uuid, type, time) values (?, ?, ?)",
player.getUniqueId().toString(),
boost.getType().getId(), // is an integer
newTime);
[15:00:22 WARN]: java.sql.SQLException: Invalid utf8 character string: 'ACED00'
I don't know what an ACED00 is and I don't know what to D0
what's executeStatement ๐ค
it just calls the statement
async
the prepared statement is gotten like:
private PreparedStatement getPreparedStatement(Connection connection, String query, Object... parameters) throws SQLException {
PreparedStatement statement = connection.prepareStatement(query);
for(int i = 0; i < parameters.length; ++i) {
statement.setObject(i + 1, parameters[i]);
}
return statement;
}
works fine for everything else, has worked fine for insertions and table creation before
never ran into this
i suppose i might have to look at the full contents of the query?
HikariProxyPreparedStatement@166967155 wrapping com.mysql.jdbc.JDBC4PreparedStatement@106fe58e: delete from boosts where uuid = ** STREAM DATA **
๐
blame executeStatement
idk if setobject is guaranteed to work for any object type
has worked fine elsewhere so i assumed it was
such as here:
database.executeStatement("insert into shards (uuid, name, balance) values (?, ?, ?) on duplicate key update name = ?, balance = ?;",
player.getUniqueId().toString(),
player.getName(),
balance,
player.getName(),
balance);
that is strings and ints also, so i'm unsure why it would suddenly break
where's the call to delete from
you've posted two insert intos
did you miss out a toString or smth?
moral of the story is to use preparedstatement directly ๐๐
yes but java will tell you when you setString a UUID
rather than having mysql do its thing
meh, would just be better if i could read the stack trace properly
and stop assuming the culprit
i think it's a worth tradeoff as opposed to having a massive prepared statement definition every time you access sql
@silk bane have you tried making an AI anticheat?
nope, cba
i mean that is actually quite hard
especially if you have no data to start with
And then if there is data, that data set is going to be quite large to be effective XD
i mean to begin with, it could be enough saving every hit distance to a set and then making a diameter
bruh that thing would take a ton of brains lol
but i think there is an AC that is based on machine learning
whats a string
Staff whatโs a string?
hello do you know why all time in the night the monsters come like in 10
?
like
lots of monsters
A string is an array of characters smh
me @sturdy oar ?
does it look like that's the answer to your question
@sturdy oar haha no its not
a string is a string
ยฏ_(ใ)_/ยฏ
maybe because of your server difficulty @frigid ember
anyway you should read the messages before replying to them
@brisk mango difficulty is hard on my server
but never had that much monsters in one minecraft night
i NEVER HAD THAT MUCH monsters even when my difficulty been hard
well thats just minecraft
People ask a question because they don't know the answer to said question.
If you don't want to answer, then don't. But there's really no reason to start insulting people.
wdym "no it's not"
oh no this guy again
wait really? how i am insulting people with saying that they asked a stupid question
You're implying they're stupid. I'm fairly certain you know that.
๐คฆโโ๏ธ
saying that someone has a stupid question doesnt mean calling them stupid
bruh imma just block you you are really annoying
Read what you said and then think again.
you really dont have common sense
Perhaps. But at least I have manners.
tell me how is it saying to someone that they have a dumb question saying theyre stupid? its not
no, you dont have anything lol
it is?
I think it is
all my server (15) says that its not
Zombie tracking distance is in the range of 40 or so blocks and on hard mode they can spawn reinforcements when damaged
zombie swarms were a new feature i think
It is normal
If you would like, you can reduce the spawn limit from the default 70 for hostile creatures to something lower, but this is normal behaviour
its normal on hard difficulty
i can make XP farm of it Xd
Besides - there is a sweep attack that can damage multiple monsters. It was added specifically because of the amount of zombies that can spawn on a player
and that's why you don't bring back 1.8 pvp mechanics
ok
As if they're difficult to deal with anyways. Jump and crit hit. 2 hits with a diamond sword and they're dead

Move backwards slightly while you're jumping and you remain unharmed
choco pve pro
Well that's the thing. It's literally not difficult whatsoever to adapt to the new combat system
People are just babies and won't adapt
1.7.10 - 1.8 pvp servers ๐คฎ
shush
why does my config delete all edits made after a server reload this is my code
public void onDisable() {
getServer().getConsoleSender().sendMessage(ChatColor.RED + "Notice Y2K_'s Printer Plugin has been disabled");
saveConfig();
}
public void loadConfig() {
getConfig().options().copyDefaults(true);
saveDefaultConfig();
}```
don't reload the server

