#help-archived
1 messages · Page 200 of 1
i'll just have to sleep on this, im so ded rn
another solution would be to remove the handle of the world when unloaded from the craftworld
at least the plugins would fail with a tangible error
i swear
saveResource("messages.yml", false);
I am making a custom config and want it to be loaded from the jar file but, I get a warning saying it already exists if it has already generated, how could I fix this and remove the warning in console.
@copper star Check if the File exists before you save the resource?
But if you set replace to false like you did then the error should not appear in my opinion
if(!file.exists()){
}```
yes
I would need to put a value for "file"
and File would be new File(plugin.getDataFolder(), "messages.yml");
Anyone know a flag or plugin that disables certain armor types, and items with enchants ?
gotta love IntelliJ
shit doesnt update libraries for artifacts
so you just waste time
trying to fix it
lol
how to enable armor stand in grief protetcion
for (String key : fileManager.getConfig("messages.yml").get().getConfigurationSection("ReviewsMessage").getKeys(false)) {
// code
}
``` This for generates an exception
What exception?
Maybe showin that exception would be usefull
NullPointerException
There is probably something null in there fileManager.getConfig("messages.yml").get().getConfigurationSection("ReviewsMessage").getKeys(false)
ReviewsMessage:
- '&6Server rating: &a%averagestars%'
- '&6Total Ratings: &a%totalratings%'
- '&65 Stars: &a%5starcount%'
- '&64 Stars: &a%4starcount%'
- '&63 Stars: &a%3starcount%'
- '&62 Stars: &a%2starcount%'
- '&61 Stars: &a%1starcount%'
This is config
ANYONE KNOW HOW
Thats why you dont do that. Everything that could be null should be checked before
Positive ratings are 5 star ratings on ressources right?
Also that fileManager get() is kinda sketchy
@limber forge Yes 5 = good 1 = bad
okay thx
Yo just thought even known this isn’t as much plugin help that someone could perhaps help me with this. From 1.13 numeric ids ofc don’t work but this plugin doesn’t support things like wheat:7 as it breaks the plugin but the source code is available and the dev doesn’t tend to respond. Does anyone know how to convert it so it actually works? Plugin:
https://www.spigotmc.org/resources/1-6-1-13-customdrops-pending-recode.36777/
if i have everything for premium, will i get premium on spigot instant or what should i do?
@hollow rune For what version do you need the drops?
What you mean premium? Posting a premium resource? If yes that resource will be checked to meet a certain standard
@copper star The "ReviewMessage" path does not define a section but a list of strings. Use #getStringList intead
I need 1.16 but everything else works and the part thag doesn’t work is a 1.13 issue as well. It’s all of the 1.13- items that I’d need to use with the codes such as wheat:7 so no updating will be needed only changing to allow for those type of ids to work @grim halo
ok
what?
Chunk loading / unloading is absolutely horrible in 1.16+, does anyone know anything that can be done to help fix this issue? Spigot wants everyone to run latest but how can servers be asked to run 1.16 if the server is just too badly optimised
Is it worse than in 1.15?
Not sure if this is the place to check, but does anyone know of a plugin that either prevents players from breaking the bottom piece of bamboo/kelp or something that allows a similar form of non-destructive harvesting on a cooldown?
I have an adventure-esque world that I'd like to allow players to harvest natural resources in, but not by depleting them.
https://github.com/redwallhp/SafeHarvest This old thing did it, but I've found nothing that has those functions in a modern one.
Anything to be done @frigid ember
Interesting idea. So only you onyl want the second bamboo/sugar block to be broken?
And whats with the harvest of protected crops?
Simply weird we support nothing other than 1.16 here
And yet it's almost completely unviable for big servers
I just want people to be able to harvest without destroying a node entirely.
I hear paper does some multi threaded stuff wit hchunks?
Only in worldguard protected regions? With a hand or only with a hoe?
Yes paper can load all chunks async...
Optional tool would be nice, but I was just going to make it global for a given world.
maybe exception regions
Ill write something like this. Sounds interesting.
o.o
If I send you 5 bucks will you comment all your code? I know SOME java, so this seems like something I could probably maintain myself if you drop it later.
I haven't written anything for MC since canary >.>
is it possible with a spigot plugin, to check if another Bungee-Server is online? Just want to show an Online/Offline-Status in an ItemMeta
Ill write it without dependencies so it should run for all upcomming mc versions... Not going to comment the code for now ^^
VNGC, this looks like they are discussing that:
https://www.spigotmc.org/threads/check-if-a-server-is-online.62095/
wow, paying for commenting code? i would be rich tbh
VNGC, this looks like they are discussing that:
https://www.spigotmc.org/threads/check-if-a-server-is-online.62095/
@trail hare thats the way for bungee-plugins sadly
Whenever someone is doing me a big favor on a whim (writing the entire plugin in this case), it seems like a good idea to bump it from "doing it just because" to "sweet, beermoney for an extra 5 minutes of effort"
and how to get the ip, if its all on a localhost? its probably the same ip for all servers
oh im dumb
nvm thanks xd
uhm
what?
the servers are all on a rented vServer...
HiddenStringUtils not working in 1.16?
so i have to do what? lol
ok nice
Not sure if this is the place to check, but does anyone know of a plugin that either prevents players from breaking the bottom piece of bamboo/kelp or something that allows a similar form of non-destructive harvesting on a cooldown?
@trail hare so you just want to prevent players from breaking the lowest bamboo blocks?
and kelp/sugarcane etc
Ideally it would would have the modern auto-replant function on normal crops, but that's outside the original scope. I was thinking something like
if block = kelp,bamboo,sugarcane & block underneath is a structure block, cancel break.
if block = crops, reset to first stage of grown and drop as if harvested.
i think i dont get it fully
In my world, players can't break stuff, it's an adventure type setup. So I want to allow them to harvest food without destroying the scenery in the process.
So if they have to leave the bottom block it'll regenerate naturally, and if crops replant themselves it's the same. I already have an automatic regrowing thing for mushrooms.
so they break the block, it doesnt breaks, but it dropps the item?
for crops it would reset to a stage that wouldn't have any drops (too young) for cane it would cut all but the last piece.
Floristics (sort of) handles this by automatically growing flora to regenerate areas, but it follows normal worldgen density instead of actual locationm
I'm an idiot. I just found out OreRegenerator can do basically this.
then just use this, if it works lol
You can set a block type to be replaced on a timer, and the filler block can be set to air.
but idk if it works like with the youngest stage
It would cause some weirdness with cane/cactus/etc though, since unless they cut the bottom the other pieces would regenerate at weird times.
All independent timers >.>
Why am I getting an NPE there?
Did you enabled Assertions to print out if the world is null?
use Objects.requireNotNull()
yeah whatever
Can someone help me with spigot forums, I am somehow unable to embed a video
@sturdy oar Someone?
I really don't see why my video URL can't be embedded
From where you inserted the video url? youtube?
wait so it must be from youtube?
oh i thought those were just examples, not the only ones allowed
how do i download?
download what
the mod loader thing
???
for servers
use spongeforge
is it 1.16
Spigot doesn't have forge mods
its a plugin thin
wat
yes, build the spigot 1.16 jar with buildtools and download the bungeecord
learn how to use your pc first
hello!
does anyone know a way to get all available block datas for a given Material?
block data? isn't that deprecated
like if I give Material.STONE_SLAB it returns "type", "waterlogged"
@frigid ember I want available values for this method
declaration: package: org.bukkit, enum: Material
I think it's this?
this is the deprecated one
use the thing that ILikeToCode linked
this does not answer my question
I don't really know what data you're looking for
I want to get all the strings that can be parsed through the method that ILikeToCode linked
to give you an example, see how WorldEdit do tab-completion when typing //set stone_slab[
nope
I want to create a block data
are you using slabs?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/Slab.html
There's this which is specific to them
declaration: package: org.bukkit.block.data.type, interface: Slab
it's just an example
OK wait I will send you some screenshots
for every block, I want a list of available block datas to parse, just like WorldEdit do
they probably have a huge ass switch checking BlockData instance or something
just check their implementation?
I'm trying, but their code is so hard to read with the abstraction for bukkit, sponge, forge and fabric
fine, it's via NMS
I am looking for an event which is fired when a player moves an itemstack from one inventory to another
any help?
would work with chest right?
Thank you so much! 🙂
@frigid ember This is currently only fired by hoppers.
This will not suit you @nova badge
oh is it
You need to listen for the InventoryClickEvent and determine yourself if the action would result in item movement
you probably have to use inventory View
Also dont forget the ItemDragEvent
That is still not sufficient.
If he clicks an item so it gets on his cursor and then simply clicks with the cursor in the other inventory the Action will not be MOVE_TO_OTHER_INVENTORY
There are many edge cases and you have to check them all.
double clicks to gather all items to curser, shift clicks, drags etc
yeah, thank you for the the tips though, both of you. I believe I can proceed further. 🙂
Probably because hopper items are moved by "physical" and not by humanentity
pretty much ^^, not to mention, all those actions are basically behind the inventory click stuff
Anyone see how I can optimise this, opening/closing one chest is taking around 1% of a tick. and so for multiple chests it can take 7-8% of a tick 🤔 https://paste.md-5.net/gekasuzugu.java
I'm guessing it might be to do with all the casts? 🤷♂️
line 6 could just use location
Oh yeah I know, that's just left over code I forgot to remove
It uses the viewers instead of the boolean now
so > 1 viewer is open etc
also your stop time should be captured before your bukkit call, just to be safe
if storage doesn't change over the forEach, why are you getInventory over and over?
getIventory is just this public Inventory getInventory() { return inventory; }
setTileEnt(world, position, new CustomTileEntityChest(), inventory.getViewers());
The game lets you do that? lol
getLocations can just be 1 and it'll cause 1% of a tick to be used. and then say 5 locations will use 3%
so it's some class you defined?
I mean I guess technically it's still an instanceof TileEntityChest
Yeah 😄 I can stop the chest from ticking completely so it doesn't interfere with my custom playBlockAction calls 😄
isn't the ticking what dictates the state of the chest's lid animation?
or am I misremembering here?
The tick basically just checks if there are viewers of the chests inventory, and then closes if there isn't. But I open a custom inventory when the chest is opened, so I just use the inventory viewers from that
should it even be overridden?
If he wants to stop that check from happening, yes
The only purpose of tick in a chest is to check its opened state
Yeah, since I don't need any of the tick behaviour since I'm just manually playing the animation and chest sounds. This is why I made the PR cause all this NMS is painful 😄
It's there
location != null in containerCloseAnimation is probably redundant and the Utils check would make better sense if you put with the location != null test in closeStorageInventory. No sense in calling the method if it's not loaded in the first place
The whole tick method is that, 😛
Yeah it modifies the viewingCount of the chest each tick based on the inventory viewers
viewCount is what determines to the client whether or not the chest is open
If it's > 1, it's open
this.a is the animation progress
You don't need Bukkit, kolia
You can delete that dependency
Yeah that's why when you join a server and someone is already looking in a chest, it appears closed for the new player
Reason it's red is because it's no longer deployed to the Nexus. spigot-api should cover your needs
also why are you delay on the scheduler to close 1 tick later?
How can i make an boolean for a player and not for everyone?
Yeah because that's what you're passing through in onOpen()
How can i make an boolean for a player and not for everyone?
@soft fable use a list probably. and instead of checking for the boolean, check if the player is in there
That block action is sent when the state changes, which is done in the tick method
If you send a block action telling it the chest is open, next tick it will send one telling the client it's not
but like I am making an Bank. I them want to create a bank for the player but first I have to check if the player has a bank
Actually, the onOpen() isn't sent in the tick. It's called when startOpen() or closeContainer() is called
But the tick is what keeps updating viewerCount
then probably use a config. save the players uuid in there, with "true" as value.
if he has a bank, its true
if he has not, its false
I tried that but it didn't work
specify "didnt work"
I didn't get the true or false thing. It didn't do anything and the command didn't reply or anything like that
wait
But you can't modify viewingCount because it causes other problems, that I can't remember of the top of my head rn 😄
if (config.getBoolean("Player's UUID")) {
//he has a bank
} else {
//he has not a bank
}
thats probably how it works
@soft fable
would suggest to create an extra config-file for that
I can try
config.set("Player`s UUID", true); // giving him a bank
config.set("Player's UUID", false); // removing its bank
in case, you didnt knew that
heyy...
hello
does any1 have experience using bukkit?
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.
T)
[19:32:55] [Server thread/ERROR]: Could not load 'plugins/testplug.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:289) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.<init>(CraftServer.java:251) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerList.<init>(PlayerList.java:69) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:179) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:504) [craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Bukkit-18fbb24]
at java.base/java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 9 more
I tried making a plugin
I added the file
what ide are you using?
oh
intellj
well, its a bit tricky i think
eclipse doesn't work on my mac
go into your artifacts, you probably have to add it manually
oh lemme try
did the same mistake at my first time using intellij
but intellij is a lot smoother for me, thats why i am using it lol
wait wat
wait...
Help
If you don't want to deal with the hassle of creating a plugin.yml for every project then there is a handy little tool just for you! It's called Plugin Annotations. It is a simple annotation processor that automatically generates a correct plugin.yml for you. No hassle!
does that mean, it exports automatically
They're done using annotation processing. It's generated at compile-time
oh wow... awesome
wait
i really suggest to use the marked plugin. its helping pretty much, while creating plugin-projects
can some1 walk me through how to manually add the plugin.yml file as a part of the artifacts?
pls

Does anyone have an idea why depend might not work? I have a plugin that has this in its plugin.yml: depend: ["name"] and there is a plugin called name, but it's still loaded after the other plugin which leads to errors.
Does anyone have an idea why
dependmight not work? I have a plugin that has this in its plugin.yml:depend: ["name"]and there is a plugin calledname, but it's still loaded after the other plugin which leads to errors.
@fading frost dont use "
Shouldn't matter
yeah that's irrelevant
Startup logs would help
use the name thats in the yml of the other plugin
I am
then idk
wait how do I know if the yml file exists or not in the plugin jar file?
can some1 walk me through how to manually add the plugin.yml file as a part of the artifacts?
@strong lantern artifacts/Output Layout/+/file/search for the plugin.yml (most time its in your workspace)/add it/apply/build your plugin
Those are the logs (just the first parts are important). The plugin I depend on is called Clojure
https://hastebin.com/notoxixuni.md
@subtle blade
The error stems from the code in that plugin not being executed before
i really suggest to use the marked plugin. its helping pretty much, while creating plugin-projects
@tough kraken really, just use that in future. its making exactly all that automatically
not always convenient and often times not obnoxious. Should be used for smaller projects
seems like thats his first plugin
oh you're making a custom class loader, johnny?
@tough kraken Can you help me set it? I created an yml file. Main.bank.set("Player`s UUID", true); is not working
i think for beginning with developing, eclipse is far better
much more clean
need to save it after that
I know but I don't know how to set it in a yml file
with exactly this code
If so, what is your test plugin written in? Is it done in Clojure?
oh you're making a custom class loader, johnny?
@subtle blade No, I'm trying something stupid with Clojure, but in order for the necessary dependencies to be recognised I need to set the server thread context class loader before I do any of it
wait
@strong lantern artifacts/Output Layout/+/file/search for the plugin.yml (most time its in your workspace)/add it/apply/build your plugin
@tough kraken
IT WORKED
tysm
?
could not load
youre welcome
load order != enable order
right...
load occurs before it even tries to resolve dependencies
oh
?paste
paste your class/code-part there, and i'll try to do my best
that'd explain it
@soft fable
How would you go about something like this?
avoid referencing those classes in a way that would need them on enable
This needs to happen before load time
it can't
create some bootstrap class in java
do the actual clojure stuff in onEnable somewhere
Well again, not possible. As soon as the class compiled from clojure is loaded this needs to be resolved
best you're gonna get is shoving the clojure stuff into the classpath manually
Seems like my only other option is to make an intermediate "implementation" of JavaPlugin that has the necessaty stuff in a static initialiser
And extend that from clojure
Well, yea, that's what I said ;P bootstrap in java, call into clojure once stuff is setup and ready
Well I was trying something like this already. Clojure (my plugin) is a java class that does this
But since I can't control when it's loaded, this doesn't get me anywhere
i put my bukket in the folder and it wont work when i start the server
@tough kraken is this how I can check it? if(Main.bank.getConfig().contains(p.getUniqueId().toString() + false)){
this would work as well...
in this case, it fits if you only save the players
but the other way is better
Tried this? https://github.com/Proximyst/Bukkit4Clojure
if(Main.bank.getConfig().getBoolean(p.getUniqueId())){
//he has a bank
}
written from hand lol
it was from him :c
i think its maybe the singleton or so
just a thought
i mean, we had a guy called his classes a, b, etc
i have seen everything
i mean, we had a guy called his classes a, b, etc
@tough kraken !!!
there are much harder things than using "static" wrong lol
didn't work
nothing is getting inside the config. Main.bank.getConfig().set(p.getUniqueId().toString(), false);
Main.bank.saveConfig();
wait a mom
maybe this is helping you, thats what i am using for my Config
hättest auch einfach auf den 1.14er gehen können...f
oops
hättest auch einfach auf den 1.14er gehen können...f
@tough kraken that was the wrong chat lol
It has no save
I can't save it...
you can
just use <Class>.Config
in onEnable
nvm
new RankConfig();
this, just your class name
yeah, i am a bit tired... didnt sleep the night
how do i make a block drop naturally
world.dropItemNaturally()
i think
or breakBlockNaturally()
btw i dont get it... just want to show the playercount on my gui
oh wow
cant send pics
ah nvm because of caps
would be nice if so many players would be on my server
putty 🤮
f
whats wrong with putty? o.O
Just because it looks old doesn't mean it doesn't work. Like saying irc doesn't work XD
Just because it looks old doesn't mean it doesn't work. Like saying irc doesn't work XD
@keen compass it misses features
such as?
Termius can store settings, servers, ssh keys on their database
so can putty
never needed that
but putty saves it locally
good
Imagine you break your pc. Boom you've lost all servers and ssh keys
With termius they're bound to the account
can always get your ssh key back from the server
and I don't lose my servers because I still have access to the panel for my servers
second I have domains set for them
Hey guys does anyone know how to check if the player right clicks while holding a compass?
Are you the dude that already asked it on forums
uhhh yeah
I already tried to answer you
@blazing burrow PlayerInteractEvent -> check player hand for compass
if (event.getItem().getType() != Material.COMPASS) return;
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
so far you haven't stated what features putty is missing o.O
thats what i use
okay
and it works
so far you haven't stated what features putty is missing o.O
@keen compass nice themes and remote data storage
remote data storage such as what? o.O
also what ide do u guys use for java?
I use netbeans
yeah is above that lul, still dont know why i dont check them in one line
ah ok
not sure why you would need remote data storage from a third party for SSH
also what ide do u guys use for java?
@blazing burrow netbeans \ IntelliJ
intellij as well
ah i see
but tbh my computer is trash
@SuppressWarnings("deprecation")
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent e){
Player p = e.getPlayer();
if(p.getItemInHand().getItemMeta().getDisplayName().contains("zoomy")){
PotionEffect speedI = new PotionEffect(PotionEffectType.SPEED, 100, 1, false);
p.addPotionEffect(speedI);
}
}
Anyways all your arguments so far point to putty being better, because despite all the features you listed which it has, it is had them for far longer. Exception being themes and not sure what remote data storage you mean.
Why does renaming an item to zoomy in anvil not give speed?
wait @tough kraken what does the return after the first condition do?
@celest current Dont use deprecated methods such as .getItemInHand()
it does nothing, if its not a compass
could as well check if its a compass and run the method, but i like my method more
sure
@celest current Also: Do you want to constantly have speed when the boots are equiped or only when he clicks them while holding,.
First of all you need more null checks.
@frigid ember Yes but he uses contains so this doesnt matter
So the issue is getItemInHand()?
...
at interactevent, use getItem(), should work
I am using mc 1.16.1 Can someone tell me or point me in the right direction on how to get a spigot server running with forge?
so uh @grim halo how do i register it?
No its not the root of the problem but you should not use deprecated methods.
Also look at what @tough kraken said.
Like you always register listener on spigot
@celest current https://www.spigotmc.org/wiki/using-the-event-api/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
can i unlink my account from spigot? lol
I am using mc 1.16.1 Can someone tell me or point me in the right direction on how to get a spigot server running with forge?
@frigid ember you cannot use forge mods with spigot
if that's the case
There are some special spigot forks. Most of them run on 1.7.10 or 1.12.2
but i think magma isnt there for 1.16
sponge is bukkit i think
so sponge can allow spigot and forge to work together?
There's a separate sponge plugins market
o ok, ty for the help
you can use bukkit or sponge plugins i assume
Mohist for example uses spigot and forge
I'll go over there tyvm
@tough kraken it still doesnt work xd
mohist... never heard
@blazing burrow You are the one with the compass problem?
Did you register your listener?
I'll go over there tyvm
@frigid ember you can join spigot and sponge servers together in the same network however using BungeeCord
@barren runeentHandler?
I had done that several times
man i am just tagging people, its so bad
Poor Ev
should i just send a pic of the code
paste it
?paste
@sturdy oar I'm fairly new to this so let me see if I understand what you're saying. So with BungeeCord, I can have a server running with both forge and spigot running at the same time?
package me.atin.manh;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.event.block.Action;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import me.atin.manh.commands.TargetCommand;
public class First extends JavaPlugin implements Listener{
public ItemStack compass;
public Location loc;
public Player vict;
@Override
public void onEnable() {
new TargetCommand(this);
compass = new ItemStack(Material.COMPASS); // Sets the compass ItemStack as the compass item.
}
public void setVictim(Player victim) {
vict = victim; // Vict is short for victim.
}
@barren runeentHandler
public void onInteract(PlayerInteractEvent event) {
Action action = event.getAction(); // Instance of action
Player player = event.getPlayer(); // Instance of player.
loc = vict.getLocation();
if (event.getItem().getType() != Material.COMPASS) return;
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { // If something is right clicked and theres a value for vict.
player.setCompassTarget(loc);
player.sendMessage("Compass is now pointing towards" + vict.getName() + "!"); // Says that the compass is pointing towards the victim.
}
else if (vict == null) { // If there is no player selected.
player.sendMessage("Player needs to be set!");
}
}
}
Bruh
poor little ev
?paste
please ev, change your name haha
oh
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Thats how you work with the event api
ok sure thanks
Also getServer() is obsolete if you are in a JavaPlugin instance anyways. Just use this.getPluginManager()
Locked Bungeecord requires offline mode Offline mode is not supported by Bukkit
still love this answers in bukkit forum
okay @grim halo
Can I just put all of my listeners into one class and register that class for all listeners to load?
Yes
Thats fucking dope
Just annotate every method that should be registered
When called in onEnable?
Yes in onEnable you can getPluginManager()
And register your listener instance there
on .registerEvent() the first parameter is the class name and then second is the name of the plugin?
so would the code getServer().getPluginManager().registerEvents(new listeners(), this); register all listeners in the listeners class?
if you are in your JavaPlugin instance you dont need getServer()
just Bukkit.getPluginManager
Anonymous listeners 👌
its literally the same
^
how do you remove an itemstack from an inventory without removing all stacks of that type?
you dont make an instance tho
pretty sure it returns the same one
Bukkit.getPluginManager probably calls getServer().getPluginManager
So it doens't matter what he types
getServer.getPluginManager is just fine.
Ah
Sure i had something else in my head
Can anyone tell me what his issue is tho?
whenever I tap into here I loose braincells
Entity vehicle = world.spawnEntity(loc, EntityType.BOAT);
((CraftEntity) vehicle).getHandle().setInvisible(true);```
is there another way to set an entity invisible
this one doesnt work ;|
cant give potioneffect(invis)/setInvisible(false) since its not a LivingEntity
still haven't figured it out ;/
you seem to need it
Hello, i got issues in my spigot server.
I have a problem with monsters spawning when they spawn with a spawner. They don't seem to have an AI. Same problem with the pigmens on my gold farm opn the nether's roof.
I changed the line "nerf-spawner-mobs" to false in spigot.yml, but it didn't help.
Any idea ?
@rich quest Use custom item icons. Unify style with oder guis etc
@inner olive What version? Thats probably happening because of low TPS or another plugin.
1.16.1
@rich quest Sure if its a private plugin you can do that
i'll get my plugins list wait a min
Deus are your tps fine?
how can i see this ?
/tps
Ok so thats good.
hi
where can i send a screenshot of my plugins ?
I also need a good playtime plugin with mysql support
hello, how i can check if player click on specific location on my world ?
I need to have time played on each section (accumulated from all other servers)
Deus you can upload it to imgur or verify your discord account
ok i'll do it
Anyone know how to get a dynmap map onto a ssl site
Reverse proxy it with a TLS cert
What can I proxy it with, Apache?
oh wow i got a warning for tagging 3 people that helped me and thanking them 😔
it was me
Here it is : CoreProtect, LuckPerms, Skript, PlaceholderAPI, CommandHook, LimitPillagers, Multiverse-NetherPortals, Vault, TokenManager, dynmap, Essentials, Scoreboard-revision, NoSpawn, HolographicsDisplays, UltimateShops, Holograms, Citizen, LockettePro, EssentialsChat, EssentialsSpawn, CitizensText, HolographicScoreboard, dtlTraders @grim halo
i was thanking cuz its working
Nothing in this list seems problematic besides Skript.
No idea what NoSpawn is tho.
Yeah its fine, all worked out in the end
hey @grim halo idk if u saw my deleted message but i was just saying thanks a lot cause its working now
And the problem is that only mobs from spawners wont walk (but still attack)
@blazing burrow no prob
It prevent a specific mob to spawn
Well they don't attack
When i hit a pigman he has the aggro sound but doesn't moove
No idea. Probably some plugin that gives you priviliges. Im going to eat cake...
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Player p = event.getPlayer();
if (!(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
return;
}
ItemStack item = event.getItem();
if (item == null || item.getType() != Material.COMPASS || !item.getItemMeta().getDisplayName().contains("zoomy")) {
PotionEffect speed = new PotionEffect(PotionEffectType.SPEED, 100, 2, false);
p.addPotionEffect(speed);
return;
}
if (item == null || item.getType() != Material.COMPASS || !item.getItemMeta().getDisplayName().contains("strok")) {
PotionEffect strong = new PotionEffect(PotionEffectType.HARM, 100, 2, false);
p.addPotionEffect(strong);
return;
}
if (item == null || item.getType() != Material.COMPASS || !item.getItemMeta().getDisplayName().contains("bouncy")) {
PotionEffect bounce = new PotionEffect(PotionEffectType.JUMP, 100, 2, false);
p.addPotionEffect(bounce);
return;
}
}
}
Whenever I right click an item named zoomy bouncy or strok I only get speed. Do I need to make different handlers for each effect or did I mess up with all the ifs?
hi, I also need a good playtime plugin with mysql support
Why don't you just check if the item is a compass and if it is check the name? You're making this more complicated then it has to be @celest current
Beside horendous loops you call "return" after the speed effect meaning nothing more will be checked @celest current
for example, here I have connected to the same database 2 servers and I have 2 different times
They already do. They dont get the other effects
If the first condition is meet return kicks in after you apply speed effect
The item can be anything renamed
@frigid ember It can be anything that has zoomy in it
So why dont you check for that rather than coverig everything else?
Thats what i preach every week. Early escape.
if item == null -> just return
I just found thius somewhere. someone send me this cuz i dunno how to make listeners or handlers
Now you see why copy pasteing code is bad habit...
true
so you don't know how to do something so your solution was copying?
works in school lmao
do a switch statement, looks cleaner
@frigid ember nice itemmeta check Kappa
yeah a) that is a terrible habit to get into and b) it won't work in coding
A item can have no itemmeta
Noted @balmy sentinel
Not his point
Both getItemMeta() and getDisplayName() are nullable
Unless they've joined before, no
@frigid ember Yes get the OfflinePlayer for example
Their names aren't cached if they've yet to join, smile
No server is a UUID
@frigid ember yeah ive got fkd by that alot of times where itemmeta returns null same to displayname
well displayname
returns a notnull
Doesnt getOfflinePlayer initiate a mojang api call if the player did not play before?
whot? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/ItemMeta.html#getDisplayName()
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
how
javadoc lieing
That looks to me like an incorrect annotation
i mean it has a warning
"check hasdisplayname before"
@frigid ember there is a method
Bukkit.getOfflinePlayer(UUID)
ahh offline uuid
its rather impossible as offline servers create a uuid based on name
if (component == null) return "";
Nevermind
Apparently it returns an empty string
Ok just checked. The OfflinePlayer will have a null name if the player has not played before.
Though I've always been under the impression that it's been nullable
oh thats rather special
yeah me too
i always checked if it had a displayname
unless they joined at least once
nope
Not impossible. You just need to make a mojang api call
can you even request a offline mode uuid from mojang?
i thought its created by server itself
you are gonna become like the guy above
learn some java first...
copy-paste doesnt help
Java is 90% C#
But if you have never written a plugin then this wont work...
So when java reads return it stops reading the code? Like it wont go any further?
No one is going to spoon-feed you. You need to do your own research and your own coding. If you have a problem come here and we'll help.
If you JUST want the name then you can go on websites like this one:
https://mcuuid.net/
Minecraft UUID and username lookup. Resolve, convert and view name history of any username/UUID today.
@grim halo Hey, it's me again, i got something, the line "nerf-mob-spawning" is just reset after each restart. How can i fix it ?
Stop the server. Change the setting. Start the server agian.
If you JUST want the name then you can go on websites like this one:
https://mcuuid.net/
@grim halo oh wow that actually exists
Minecraft UUID and username lookup. Resolve, convert and view name history of any username/UUID today.
this starts to get confusing
wut
also just to be sure
you will never have both online and offline
together
just a friendly reminder to not overcomplicate yourself
I mean... yes. You can just throw in the uuid on this website and get the name...
Several people are typing...
Anyone know why my friend is getting the bungee error unable to connect to <ip>?
@wind dock Whats the exact error?
why no named air ?
Yes named air seems like something usefull
@grim halo I'm pretty sure the error that comes up is "unable to connect to <ip>"
@grim halo the most epic way to kill someone,with a named air
c# wanted its own toy to play with and not share javas one
so he just mostly changed name and some syntaxs
"mommy I want my own toy!!!"
basically yeah
@frigid ember There is quite a bit thats different. The VMs are different. C# has Namespaces. C# has unsafe while Java has native...
I think you should google that
more or less i think mods are a bit harder
as you dont work with that much documentation
also mods testing is a pain
Mods are fundamentally different. If you know the concepts of OOP from C# you can start with both.
If you have little java experience, it may be a little easier to start with plugins (although you should learn java first anyways)
compared to spigot where we have the hugest database of information its quite a difference
Otherwise just do what you wanna do
bad
Gradle is a dependency manager like maven
i mean i did start learning to make plugins at 14
14 is fine 😄 Just learn some java (at least to the fundamentals of oop) and then get started
dem youtube vids did the hard job
I think writing plugins is way easier.
we have alot of videos/tutorials for it so i can agree
Depends how in depth you get
i did with 16, and today in 2020 there is almost no difference between 2 years lol
As soon as you leave the API mods are generally easier because functions are mapped
i mean rn i think im abusing oop too much
i have the habit of creating a object for almost every small shit lol
I wrote a energy transformer for ThermalExpansion back in the day and i can remember that it was a huge pain.
Forge has built in energy API now
Based on RF too which is nice
man i still remember imerssive engineering such a god mod
i need to play sevtech again
Also mods have mixins
Because mojang is only a suggestion
he has more playlists
this will help you make ur first baby plugin
for java google is your best friend..
I also learned spigot on his channel
as its different for everyone,maybe you like learning java by videos or by text
hmm w3school had a nice short one
just hit for the spigot forum. there isnt so much bullshit i think
the most stuff helped me there lol
is filled to the rim with garbage
while its true
yeah if you learn lava thats true
we also have the hugest database ever
like every possible question was answered at least in 3 different posts
dont think there is a question i can think of that wasnt answered
we have that covered mostly
for real? lol
@grim halo hi again, i did it two times but it still reset the line on restart :/
Some hosts dont let you edit every config line...
If it's the world name you usually need to do it from the console
pay for stuff you cant edit... lmao
it depends..
some have theyr own config editor in a separate tab
so you cant edit directly from files
I mean if you pay for 5 slots then you get 5 slots. Cant just edit it up. Makes sense
Mine just gives 200
yeah so stuff like 5 slots...okay... but i had a host, who didnt let me edit the whole server.properties. really had to stick without command blocks
As if I can fill that without the server dying
The server offer is the best one, so it's strange that they dont allow me to do it. I'll contact em
Usually they dont even bother placing a player limit
the server its still gonna die with more than 5 on 1gb ram..
as long as you dont got mcpro 🤢
from couple years i only used vps sofar
got tubeHosting, idk if it gives english support/etc, but really good imo.
well, but its a virtual server host... so no gameservers
tbh gameservers are way too expensive
depending on your budget.. if you want a server thats like 6-7 gigs and you're willing to pay $12/mo just get a ovh vps
got a 24gb 6core with 3,8ghz, for 20€ (idk how much $)
you can switch games w/e you want
im not saying 8gig bc its not rlly recommended to use all the ram on the system lol
6 should be fine 7 if u wanna be risky and live life on the edge
😎
modded mc with <10 gb... traaaash
had horrible experience w soyoustart
its actually a good number
as even the modpack creator warns you dont give more than X gb
literally would crash at 70 players and the ram wasnt an issue
i mean depends which ones you get
the game servers are about 6 year old hardware
yeah ig
we switched to pnap and still have basically everything we had on our soyoustart dedis (not the hardware)
and it runs smooth
i would rate everyone rather getting a linux machine instead of a gameserver
but only makes sense if you wanna have multiple server for example
raspberry pi 3 host ?!?!?!?!?
really want to make my cubeworld server on my machine, but it has a .exe to start it... soooo bad
also they usually increase the price due to the platform
they pay for license to give you that gameserver menu
@tough kraken you have the equivalent for linux
terraria server is only .exe so you run a compatibility
i mean a pi4 works pretty nice.
I got a cooler on my 8gig pi4. Overclocked to 2.1Ghz and it runs spigot just fine.
you ever had a mc-server on a windows server? lmao
would have to put my mc servers as well there
made only bad experiences lol
its just a preference
i mean its not that different
my pc is windows 10 i just think linux servers are easier to use
windows i think uses a bit more resources by default
yeah hosting on like for example ubuntu servers are way easier
yep
freakin dont gotta hunt down every software
just go ahead and do apt install
just know the software name
agree
never tried it so i wouldnt know xD
tbh
how much ram do i acutally "need" for about 7 gameservers (+bungee) and about 20 players at same time
just prefer linux still (ubuntu :))
maybe 24gb really are too much but idk
i dont understand how many gameservers tho use
multicraft
i see no problem w it just the design is like
and how slow it is
yeah i know, but just to know
for 7 instances of a server i would at least get a 64 gig machine. You also need a CPU with at least 8 physical cores
havent experienced any
what is lagging here please guys
https://spark.lucko.me/#M8FPk4LUBT
just havent had a good time w multicraft ever lol
its on its 2nd to latest version
the latest one is a dev release and its not good to use in a work environment
@limber summit Cant you just send us the timings
i mean, whats about this
?paste
6 cores, 20gb ram 80gb ssd
what cpu is it lol
6 cores isnt enough info
yeah imagine paying $2.5/mo for that
again i really hope to see companies switch to ptero
@frigid ember thread sleep is probably from the spigot server to await the next tick
@limber summit Pls send us the timings.
Intel Xeon E5-2699v3
idk if thats good lol
Is someone able to make me understand better a little things about the Bukkti Events API?
yes there is
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
theres a null multicraft? lol
Is someone able to make me understand better a little things about the Bukkti Events API?
@sturdy oar Basically, let's suppose i instantiate my event (which implements Cancellable) and I call it. Will checking if it is cancelled after having called it make me able to know if anyone using my API has cancelled the event?
something like this
it has a port?
Well it fixed the spawners AI but my pigmens still dont moove 😶
it should just be localhost/phpmyadmin
thats the default
you have to install phpmyadmin
mysql doesnt come with it
you can either do that or use a mysql compass
learn mysql's basics i'd suggest before trying to implement it
I get my servers from a industrial server host. Machines from old clients that are not needed anymore.
25/month
1000Gbit up + download
all i'd recommend learning for now is how to create tables, insert, update, select, and thats it i think?
wow smile
want to link me this for future reference LOL
@grim halo well i figured out, the config is ok and my mobs now got AI on spawners. But it didnt help with pigmens, they still dont moove, that's the main issue
🤷🏽♂️
Id rather not. I have done this in the past and the prices went up.
The servers are up for 48 hours and then they get cheaper. And now ppl buy servers like this one for 30/month
^^
high school broke gang wya
hey can some staff help me setup lucky perms?
i added it to my mcpro server and cant use op now i need to setup a thing for it but im not sure how
could we hop in a cole and i couild screenshare and you could guidbe through it?
call*
does lp have config.yml?
how do i do that im kinda new to this
@normal steppe
do lp user <user> permission set *
to give yourself all permissions
do i do that in console @bronze acorn
yes
this is the only async code from elytra https://paste.md-5.net/pekijeqebe.cs
How much ram for my bungee with ~600 players guys?
ok
i am the author
i think elytra is causing the other plugins to have spasms
?paste
https://paste.md-5.net/yodimegeso.java this was the palyerinteractevent from elytra plugins
@hollow thorn Send the
Elytraplugin and we'll find out.
@frigid ember as in teh hole thing
isnt that long
StaffWeaponUse:652
that's where the null is happening
Caused by: java.lang.NullPointerException
at com.javaminecraft.StaffWeaponUse.onOpen(StaffWeaponUse.java:652) ~[?:?]
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot.jar:git-Spigot-0509002-7c03d25]
... 21 more```
it happens in all 3
oh
@bronze acorn can you watch my scrren rq?
for that one i was lazy
yeah that's not
for space i have 5 classes but inly use 2
wait im confused code
which error are you looking at
https://paste.md-5.net/kuhojijaga.sql this one right
can I only use this.getConfig() in the Main.java?
can someone explain me why it returns a list of what it didnt remove instead of what it did remove? How do you know what is removed then
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/Inventory.html#removeItem(org.bukkit.inventory.ItemStack...)
declaration: package: org.bukkit.inventory, interface: Inventory
@frigid ember then how do i get info from a config file into another class?
well i still dont get it
i want to have a config, that just contains players with boolean.
if i use config#set, does it add a new Player or replaces the old?
private static <insetclassname> plugin;
@Override
public void onEnable() //this can be onload or onenable
{
plugin = this;
}```
and then at the bottom
public static <pluginclassname> getPlugin()
{
return plugin;
}```
that's how i do mines 🤷🏽♂️
or you can be weird and do <classname> plugin = <classname>.getPlugin(<classname>.class);
public static <pluginclassname> getPlugin()
{
am i the only one who hates it to see the brackets at the next line? lol
lmao
mines auto do it to be right next to it
it depends if im lazy or not i'll just move it to the next line
🤷🏽♂️
idk i am kinda confused if i see that
So either way will let me call config info in a different class?
dont you need to import like the main class or something
You need a instance of your main class
that'll work too
anyone know why i might be able to see invisible mobs ?
for example when i apply an invisibility potion effect to a mob in mythicmobs, i can see the potion particle effect on them, but they are not invisible. i can see any entity that turns invisible on my server.
(i talked to some people on the mm server, and i'm not entirely sure this is a mm-specific issue)
@hollow thorn No it doesn't. It repeats every 20 ticks.
@frigid ember oh your talking about that one
@frigid ember So I have an instance defined but not used. How would it connect to getConfig?
ahh yes. it would be instance not this. big brain move
if my config file is divided into categories how could I get a string from an item inside a category? I dont know what its called so google doesnt know what to show me
effects:
speed: zoom
strength: stronk
jump-boost: bounci
regen: healmeh
whats that called ^
getconfigurationkeys
get each category
then do whatever with each
ie get the item
tbh
you shouldn't use the configs as permanent storage
i would still move them in a less generic place
okay so I can get a key when its sectioned off
yes
the data in the keys is what people can rename items to in anvils for the effects to work. I want to be able to change the string from config rather than the java
thats what I had written down but i am looking for what to put in there now
visible confusion
it is but it's slower
because of the operations it needs to be done in order to obtain the values
the keys have to be split and searched in hashmaps
can someone help me with some port forwarding thing, i cant join my server
cant you just use localhost?
It's a localhost server, but thats the point, im trying to make it public
I already port forwarded it
