#help-archived
1 messages · Page 158 of 1
help i get this error and my server shuts down
?paste
help?
wdym
weher
Corrupt chunk @frigid ember
@cobalt yoke what?
where is copupt chuck
could you paste it so I check as well
Did you enable your server wirh 1 Mc version
And then changed
To another mc version?
Your server was always in that versikn?
is there a way to password protect a vanilla mc server?
how do I make it so a structure like a house moves 1 block sideways ever second or so?
is there a way to password protect a vanilla mc server?
Vanilla? No. Though this sounds like "I want to run an offline server" 101
If you only want friends to join, however, use a whitelist
yeah, we thought of that but we allowed different clients to play because some of our friends use it
and people could just use our names and join in
I'm using 1.16, is there any plugins that allow bypassing of the 32x32x32 limit for structure saving using structure blocks?
@lost cipher should probably tell your friends to buy the game 😉
imagine buying games when you can give them access with an unsafe option from server.properties!
I will never understand why SpigotMC mods and most people is against offline-mode, but spigot itself gives an option to enable it
if (event.getItem().getType().name().toLowerCase().contains("raw"));
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 0));
}``` This is a code i wrote, so i player eats raw items he gets poisoned. But when the player eats cooked items even then he gets poisoned. Any solution for this?
Might be better to check if the type equals something like raw chicken or raw porkchop
You put ; at the end of the if statement
You're basically closing it
remove ; and your code will work
@karmic stone
Yeah you'll get poison whenever you eat anything with that plugin
or consume anything
if my code is wrong then i should get poisoned right
Yeah you'll get poison whenever you eat anything with that plugin
ohh lol
I will never understand why SpigotMC mods and most people is against offline-mode, but spigot itself gives an option to enable it
Because vanilla does
Not to mention it's a useful development tool
Additionally, Spigot uses it for Bungeecord
^^^ same as "if /reload is so bad, why doesn't spigot remove the command"
We're not against offline mode. We're against offline mode if people are using it to support people pirating the game
if (event.getItem().getType().name().toLowerCase().contains("raw")){
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 0));
}
}```
like that?
Yeah you litteraly did lol
Hmm
I get this error while running buildtools
java.lang.TypeNotPresentException: Type org.apache.maven.plugin.surefire.SurefirePlugin not present
Here's my log
Any ideas?
twinMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new
AttributeModifier("generic.attack_speed", 3, AttributeModifier.Operation.ADD_NUMBER));
Is this the correct way to add an attribute modifier to an item?
I always end up getting:
Tankuu lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: minecraft:generic_attack_speed
What is the key it is referring to? I assume the string, but what do I set it to? I've set it to:
generic.attackSpeed, generic_attack_speed, minecraft:generic_attack_speed, and what it is right now.
Confused lol
ok i think i fixed it
@ember heart I see no commits recently that change Spigot, Bukkit nor CraftBukkit's pom.xml. Download latest BuildTools, delete the Spigot, CraftBukkit and Bukkit directories and re-run
As of right now it is 1.16.1 and I believe the BuildTools is up to date unless there was a new 1.16.1 release
or unless the problem is that it's 1.16.1 haha
@subtle blade I'll try again, I've had this error every time I tried builttools from the time since I started doing plugin development
Been a year since I tried last
LOL
"You are 81 versions behind"
That'd do it
hahaha thanks
@subtle blade ran it again, same error, completly freshly downloaded Buildtools jar.

smh im so lost
I guess I'll have to stick to semi illegal downloads for the rest of my poor life
Please don't lol
If you're going to do anything, at least do something legal and get a build from Paper
Though I recommend reporting this bug to the JIRA
I found this dude having the same problem
Even though he's having some difficulties reporting it properly he's also never solved it
Next suggestion would be to make sure your version of Java is up to date and that you're running using Java 8
i.e. J8 b252
(or 251, whatever)
Let me have a go at that
I'm on java build 1.8.0-251-b08
should be the newest
I'll hava a go with maven then
Yeah, Maven updates often get neglected
Hello! I can't create a world, just normal world, by myself plugin. It error, but it say not a Spigot error, but I can't screenshot it, because it so many and so fast text appear.
please help
how i do the plugin DeluxeTags
if you click about tag parkour is give you parkour prefix
Tanku, ever have any luck with that thing?
If I were to have an event that triggered something such as: Check for the next 5 seconds for [event], would I use BukkitRunnable? I want like... I click once, then for the next 5 seconds it checks to see if I click again and then says something if I do
@winged sparrow Indeed! I got it to work the exact way I wanted to. I was going to message you about it but I ended up working the rest of the day on it haha
1 sec, Tanku. Let me send you a snippet
Ah that's awesome.
Yeah, it was much fun working on that. Thank you again Gizmo 😛
can't verify my acc since it was verified with my old discord that got deleted what to do now?
Thank you!
It's what I used to accomplish this
https://cdn.discordapp.com/attachments/522281748684341249/723354306790686821/aiRtXwaJqV.gif
You can apply the same thing to inventories and whatnot, similar concept
If you don't want to send a message after the 5 seconds has expired, you don't need that runnable at all. You can use a Map<UUID, Long> instead where the long is the time they clicked the block
Damn that is hella impressive
If current time - the player's mapped value is < the time you want, success. Otherwise, failed
In this case, I wanted a message to be sent 😛
Ah okay
/function as:admin/craft_book_toggle
Can somme1 help why is this command not working?
Why your old discord got deleted? lol
Rip to WorldPainter it doesnt like 1.16.1 level.dat's had a 512 sphere from worldborder loaded to mess with a map without being ingame and it wont load all the chunks XD
@subtle blade are tile entities able to store persistent data?
Yes
OwO
Tile entities, players and items
A lock system
someone's trying to add it to chunks too
Yeah I know lol
Tile entities, entities, and items*
Right, sorry. *Entities. Lol
Didn't know players could store persistent data though.
Sounds like something I can abuse in some way.
The only use of persistent data I have is with the keys
I use it a lot with items
I'm writing actual lock information to a JSON file
I’ve also used it for spawner stacking
Best part is, I have everything wrapped behind a nice little API to do it all for me 🙂
Obviously everything there is optional, but you get it
Those key flags are handled by a single integer in persistent data too which is pretty awesome. I just use a bitmask
Choco is the key thing just a model?
ah ok
I like how you can have items look decent without a resource pack and with one now
Rather than them all being a tool without the pack
Yeah, model data was a great addition in 1.14
I can make my keys look however I want with a resource pack
Optional, obviously, but I bundle it with the plugin and save it in the plugin directory in case server owners want to use it
At least tripwire hooks sort of look like keys in vanilla so it's not a huge deal
I wish server resource packs were less finicky
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
if (event.getPlayer().getInventory().getItemInMainHand().equals(Items.twinBlade)) {
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
Runnable checkClick = () -> {
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
}
else if (event.getAction() == Action.LEFT_CLICK_AIR) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rl));
}
};
Bukkit.getScheduler().runTaskTimer(plugin, checkClick, 5, 60);
}
}
}
How exactly would I go about having it check for the right-click again, instead of it checking twice for the first right-click?
Seeing from the messy code I have I know that it will just say that I right-clicked once, but display both r and rr when specified to, because it checks for the first right-click each time.. if that makes sense lol
That's where the Set comes in from earlier
ohhhhh alright
Add the player's UUID in a set in that event. In the runnable, if the player is still in the set, send that message
got it
The runnable should remove them from that set after x amount of time
tank
Take another look at how I did it in my snippet
I should have clarified, that bigger nested block of code was called before I did any of my unlocking stuff
and the removal from the set at the end was done after I unlocked everything
I've already made each strike deal damage :P
We're doing something to present an idea to a community
yeah i got your snippet up and i'll go off that as well as everything you've said so far, i think i'll be able to get it

I have been meaning to open source everything too. Gotta do that soon. Just kept neglecting to do so
Maybe later today if I get bored lol
Hello! ask 1! I use Linux server, every process of the server, like creating file or directory, then why that file or directory always set group to "minecraft"? Is it by default for the server? And can we change them?
Would it be possible for me to provide and relocate my own SQLite driver?
I currently have few reasons to provide my own driver version so i dont't use Spigot's one, would that be possible?
I currently need 3.23.3, but older spigot versions provide very outdated builds
@lofty meadow it should never be Minecraft by default, you mustve set it yourself or your host provider
Ohh, how?
or are you using minecraft as username?
You mean my host name? Or my user name?
anything
My host name is minecraft
then change it
Is there a method like isBlock to tell if an item has a 3D model like a block/chest or a 2D texture like a sign/sapling etc.
Or am I going to have to manually write a switch statement 😭
is it possible to take a 1.8.x java world and put it in my 1.8.x spigot server?
sometimes
What I'm looking for is when I first right-click, it triggers an event that checks for a second right-click for the next couple seconds. When that second right-click happens, I want it to immediately send a message.
For clarification, is that what you were showing me @subtle blade? If it was, you don't have to re-explain it, I just want a clarification whether or not my brain is working slow today haha. I'm just struggling to understand and want to make sure I'm looking at the right thing
Why is this erroring lmao
it's not initialized?
You can't just put a for in a class without having it do anything
how do i put armor on citizens npcs
Are you trying to make it return those values?
if so put it in a return statement
@lapis plinth
public void listTopPlayers(Player player) {
for (Player player : Bukkit.getOnlinePlayers()){
User,getUser(player).getIsland().getOwner();
}
}
if this is supposed to show a list.
oh
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
if (event.getPlayer().getInventory().getItemInMainHand().equals(Items.twinBlade)) {
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
Set<UUID> HAS_CLICKED = new HashSet<>();
Runnable checkClick = () -> {
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
}
};
Bukkit.getScheduler().runTaskTimer(plugin, checkClick, 5, 60);
}
}
}
I mean, shouldn't this technically work? Idk I feel that since there is a 5 tick delay, it checks for another right-click 5 ticks after the initial right-click for a 60 tick duration. I did try it with the UUID Set though I'm struggling to grasp on how I can apply that with this, so I'm trying other ways for the time being
if (event.getItem().getType().name().toLowerCase().contains("raw")) {
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 0));
}
}```
This code should make raw food poisonous as per me, for some reason it doesnt
(1) You need an @EventHandler, (2) Have you registered your listener?
i have eventhandler
on essentials with the kit delay is it in ticks or minutes
it works if i write the same for rotten flesh
Also, if you're in > 1.13+, there are no "raw" materials
wdym
It's BEEF, CHICKEN, etc.
RAW_BEEF, RAW_CHICKEN was what they were called before 1.13
lol so again i cant give poison
You should have a Set<Material> of materials that you want to have give poison
private static final Set<Material> POISONOUS = EnumSet.of(Material.BEEF, Material.CHICKEN, ... so on and so forth ...);
if (POISONOUS.contains(event.getItem().getType())) {
// give poison
}```
so i need to make a new EventHandler?
No, you can still use the same one. Just change the condition
umm ok
Hello! in Linux there are 3 types of file or directory permission, are u, g and o, I want to know that if the server interact to a file or directory, which permission that the server stand for or play as ? u, g or o?
server interact as an 'u' or a 'g' or an 'o'?
Now using the UUID, I think my main problem is I don't know when to remove the UUID from the set?
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
if (event.getPlayer().getInventory().getItemInMainHand().equals(Items.twinBlade)) {
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
Set<UUID> HAS_CLICKED = new HashSet<>();
HAS_CLICKED.add(event.getPlayer().getUniqueId());
Runnable checkClick = () -> {
if (HAS_CLICKED.contains(event.getPlayer().getUniqueId())) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
}
};
Bukkit.getScheduler().runTaskTimer(plugin, checkClick, 5, 60);
HAS_CLICKED.remove(event.getPlayer().getUniqueId());
}
}
}
I'm getting there... slowly but surely.
HAS_CLICKED should be a field, not a local var
and removal should be done in the runnable
hey choco where do i put the event name then?
public static final Set<Material> POISONOUS = EnumSet.of(Material.BEEF,Material.CHICKEN,Material.RABBIT,Material.PORKCHOP,Material.SALMON,Material.COD,Material.MUTTON,Material.TROPICAL_FISH);
if (POISONOUS.contains(event.getItem().getType())){
Player player = (Player) event.getEntity();
player.addPotionEffect(new PotionEffect(PotionEffectType.POISON), 80, 0);
}``` ik this code is incomplete
private static final Set<UUID> HAS_CLICKED = new HashSet<>();
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (Items.twinBlade.isSimilar(event.getItem()) && event.getAction() == Action.RIGHT_CLICK_AIR) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
if (HAS_CLICKED.remove(player.getUniqueId())) {
// Here, the player has clicked for a second time within 5 seconds
return;
}
HAS_CLICKED.add(player.getUniqueId());
Bukkit.getScheduler().runTaskTimer(plugin, () -> HAS_CLICKED.remove(player.getUniqueId()), 5, 60);
}
}```
@tiny pebble
@karmic stone make that Set a field. It should be a constant field in your class. Then listen to the event like you had before but instead of
event.getItem().getType().name().toLowerCase().contains("raw")
use instead
POISONOUS.contains(event.getItem().getType())
how can i sell a mc plugin on spigotmc
?premium
ohh
where can i see my posts?
thank you
and when i have all i can do sell plugins instantly or should i go to the support first
Who called? Oh... nvm
Would I add the UUID to the set just under where the first message was sent?
Yes, sorry. Forgot to include that
Right above or below the runnable call, wherever
@limber forge when you meet all requirements, the system will automatically allow you to upload premium resources. Though give it an hour or two of the requirements being met as it's not instant
You can actually make that a bit nicer by just moving the remove() call upwards
😉
See edit
u mean like that choco?
Yes, then replace your if statement from your method earlier
yeah i did that too
ohh
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.POISON, 80, 0));```
maybe this works
😐

only problem i got is that it goes straight to thinking i clicked twice
might be the tick delay being 5 tho lol
It's because you click with both hands
You can ignore one of them if you'd like
if (event.getHand() == EquipmentSlot.OFF_HAND) {
return;
}```
ohh choco thanks, it worked. 🙂
My first plugin is almost ready
Also i really miss my idea of the dragon's breath giving u wither effect. If u get any updates or a method to do that pls DM me. Btw i just made the dragon a bit more OP so i could balance it
cya
?paste
Well I fixed the bug on 1.16.1 and PR'd it into CraftBukkit so it should at least be fixed then, but I can't speak for previous versions. Doubt that would be backported
We don't backport fixes unless it's gamebreaking
i mean.. u fixed it how? R u kinda staff?
Yes and a contributor. It's not in CraftBukkit yet, md has to review it
but I made the change that would fix it
o/
lol
I'd like to assume my problem now is just as simple as the if statement being out of place... where should that be if not the 5 places I put it 😂
As now it doesn't recognize the second-click
Can RGB chat colours be used in the motd?
yes
@hollow thorn format that better, it's unreadable
@tiny pebble How will it display to older versions?
https://www.colorschemer.com/minecraft-color-codes/ There's specified MOTD code here
I'm not sure about the older versions but I would assume it would show the same
Here is a list of Minecraft Color Codes and Format Codes that are available. You can use in chat and game commands.
how do i format it better
@tiny pebble Those aren't the rgb chat colours
The motd code look like unicode references
I don't think they're encoded hex colours
@hollow thorn fix your indenting
its the default indent
RGB colours are not displayed in the MOTD to clients older than 1.16
What's displayed instead @subtle blade
Not certain what the client defaults to. White most likely
I'm hoping the ping packet has a version attached
Yeah my thoughts are more if the client doesn't know how to parse it, @subtle blade it may display horrible json. And yeah I hope so, there's a small chance it's only in the return payload
and nice
I suppose I can write some code to choose between 2
Thanks
https://discordapp.com/channels/690411863766466590/690470011382267904/728307663980462130 here's my failure btw
@hollow thorn this is the part where you say what's wrong with it
it is outputting an error whenever i try to use the item
wait no thats the wrong link
?paste
Plugin already initialized!
Yeah that's about the most self descriptive error ever
and since you've not posted the full class the line numbers don't mean anything to me
:doubt:
that initialises it
Okay, before making any more plugins
then how do i make bukkit runnables
go and learn how to code
omg really!?? who would've guessed that new creates another instance???
then learn how to use java
^
how do i make bukkit runnables when the folder is in a different file
and i already have learnt how to code
what do Bukkit runnables have to do with files?
i just dont know the hole code
aight now my only problem is that it only registers the second click if its basically instant
what do Bukkti runnables have to do with files?
@sturdy oar i intilise the plugin in a different file to the file that im in currently
The problem here is you've no idea how OOP works
I haven't understood but ok
are you building a "plugin" module system for your plugin?
@sturdy oar He doesn't know how to transfer the instance that Spigot creates into another file
no i just have the use event
@sturdy oar and if we spoonfeed him, he'll never learn
in a different file to the initializer
Yeah i don't like spoonfeeding either @wheat mirage
private static final Set<UUID> HAS_CLICKED = new HashSet<>();
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (Objects.equals(event.getHand(), EquipmentSlot.HAND)) return;
if (Items.twinBlade.isSimilar(event.getItem()) && event.getAction() == Action.RIGHT_CLICK_AIR) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(r));
if (HAS_CLICKED.remove(player.getUniqueId())) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(rr));
}
HAS_CLICKED.add(player.getUniqueId());
Bukkit.getScheduler().runTaskTimer(plugin, () -> HAS_CLICKED.remove(player.getUniqueId()), 5, 60);
}
}
Anyone know why exactly it only registers my second click if it's like almost instant? Did I mix up the delay and period or..?
@sturdy oar and if we spoonfeed him, he'll never learn
@wheat mirage fixed it
replaced new StaffWeapon() with Bukkit.getPluginManager().getPlugin("StaffWeapon"
)
don't do that
Not a great solution
use dependency injection or static getter
@tiny pebble what you've done is make it remove them every 5 ticks after it's been 60 ticks.
Or is it every 60 ticks after 5 ticks.
Aghh.
so should i make them both equal 🤔
i just want it to check for the second click within those said 60 ticks
Are you trying to make a cooldown?
i would like a small cooldown for being able to click again, which is why i got the 5 in there
Ahh, kk. Yh.
doin a double click thingy
What you've got will currently repeat.
If you do runTaskLater(Plugin, Runnable, tick time until it's run)
So if you want a 1 second cooldown, that tick time would be 20. P sure you know 🙂
ahha, it has worked! thank you 🙂
👍 noice.
how exactly would I go about adding in a third click check though 😅
Ah okay
I've also gotten the third click down 😛
now just gotta check for a left-click after the right-click 🤔
if i've gotten this far I can get further
Hmm, I'm trying to make my plugin send a message in the chat, something like "Plugin started" when it starts. Although it doesn't seem to work when I'm using "onEnable", it seems like it just ignores the "broadcastMessage" command?
isn't it only broadcast(); ?
also, onEnable fires before you can join the server
so you can only see it after a /reload
I tried with a reload
It takes two strings as arguments, I don't really know how I'm supposed to use it though
Lmao I'm sorry if I'm really annoying, I'm quite new to this thing xD I've coded a lot in the past but not plugins
sure
lemme take a look
ok
so
I was wrong, you only need to use Bukkit.broadcastMessage(string);
Ah, okay
make sure you have all the arguments right
Yep, thanks!
happy to help
:D
Hmm, it still doesn't print out anything :/'
It does print out stuff when it's disabled and when it's 'supposed to', but not when it enables
This is my code:
@Override public void onEnable() { Bukkit.broadcastMessage("PlayerGreeter 2 has been enabled successfully!"); getServer().getPluginManager().registerEvents(this, this); }
broadcastMessage() sends a message to online players
Of which there are none onEnable() unless you're reloading
I'm reloading :/
As in /reload
Yea
¯_(ツ)_/¯
This is really driving me crazy xD
you know serve r ip ?
my friend cant why ?
i have seerver ip why cant porblem ? i take it my friend say not work ?
so why cant server ?
i have serve online
try joining and then leaving
before telling him to join
thats a glitch that happens with my servers for some reason
no my server ip ?
i had a problem
Oh wait, I'm stupid, I didn't build the plugin before I tested the solution xDD
where other people couldnt find my server
i sent pic ok
soo,,,,
my friend say not wrok why ?
i have online ip adress why cant my friend not work ?
hey
fsr there isn't a "server" command now
it just
disappeared off the face of the earth
: Particle REDSTONE requires data, null provided
world.spawnParticle(Particle.REDSTONE, loc, 0);
is there anywhere i can look to replicate the sweep_attack particle that the swords do? i know how to spawn the particle but I mean when it's in front of the player a specific distance that they're looking
how to port forwar
does the PlayerMoveEvent fire only if the player inputs to move, or will it fire whenever they move (specifically, will it continue to fire if the player is falling)
Any change in the x, y or z axis, or pitch and yaw
I have a 1.16.1 server and whenever i enderpearl through the end city portal the server just crashes. idk what to do cuz me and my friend wanna play further on into the game
Update
what?
Update spigot
how do you do that?
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
sorry?
Silly bot
Is there a simple way to have a block auto-connect to solid faces when setting the material or will I need to do this manually. E.g. Walls, glass panes, iron bars
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
my spigot plugin dosen't work
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
First time I've done that haha
Caused by: java.lang.NullPointerException
line 117
the Object playerConnection = this.fieldPlayerConnection.get(entityPlayer); line
i'm basically trying to make a command that makes me take 0 kb without having to use hacks or anything for fun with my friends
If it's just for friends, you're likely only running this plugin on your own server on a specific version. There's no real reason to use reflection here
((CraftPlayer) damaged).getHandle().playerConnection.sendPacket(new PacketPlayOutVelocity(damaged.getEntityId(), knockback.getX(), knockback.getY(), knockback.getZ()));
Though with that being said, that's not going to have the effect that you really want
It's sending a velocity packet to your own client but all other clients won't receive it. And even then, what you want to modify is what the server sees.
One tick later, zero the velocity using the Bukkit API
Hello, Please help me how to glitch mob from spawner. (not to hurt me)? If you write to me tag @frigid ember
(I say one tick later because events are called before they actually happen, so your velocity change will be overridden by the server otherwise)
I got a bit fogged here
hello, don't wanna interrupt the current conversation, quick question, should i shade/depend on log4j2 dependencies in my plugin or are those provided by default in bukkit?
afaik Bukkit supplies you with Log4J
sweet, thanks
Or maybe it's vanilla. Idk. I believe one of 'em does lol
yeah seems to be provided by default
hey so i got build tool and git and did the command to update it all to 1.16.1 but it still crashes the server
What does /version say
do i put that into git bash?
ok just put it into git bash and it didnt work so what do i put it in?
No, on your server. It's a command
it says this
This server is running CraftBukkit version git-Spigot-758abbe-2b00831 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT) Checking version, please wait... You are 81 version(s) behind
Then you didn't update
what do i put into git bash then to update it?
java -jar BuildTools.jar --rev 1.16
i think i did do that but ill try again
Did you replace the old jar with the new one
the buildtools.jar?
Your server jar
Copy the one buildtools made to your server
am i meant to place the buildtools.jar file into my server folder?
how am i meant to tell if it has?
--rev 1.16.1
Not 1.16
After running BuildTools, the compiled jar should be in the root directory - the same place you ran that command
hey
Copy it over into your server directory
ohhhhhhhhhhhh i didnt look there so the folder called spigot-1.16.1.jar i put it in the place of my original server.jar file?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
Use imgur or something
coll do i do what i said a min ago?
what does it say?
let me show you
import java file isn't showing as an option for me
I already exported in spigot
im not sure honestly i dont know loads about java but i thought i should've asked to see whats up incase i knew but sorry
@light orbit you need to have Spigot as a dependancy for your project, I forgot exactly how to do it in Eclipse but I figure that eclipse has Maven https://www.spigotmc.org/wiki/spigot-maven/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@opal bay
the pING
ow do I access a repository whatever
Hello!
Does anyone has a good paid/free plugin for ranked/unranked 1v1 (duels). i'm trying to make a gamemode on my server.
is there any free shop gui plugins for 1.16.1 yet?
If I want a task to repeat every 40 ticks if a specific requirement is met, what would I use within the BucketScheduler? or Runnable..?
For context, I have Runnable regen = () -> player.setFoodLevel(player.getFoodLevel() + 1); which I want to run every 40 ticks when event.getPlayer().getFoodLevel() < 20 is true
@EventHandler(ignoreCancelled = true)
public void onDamage(EntityDamageByEntityEvent event) {
Player entityA = (Player)event.getEntity();
for (Player playerz : AntiKB.tobesecret) {
if (playerz == entityA) {
if (!(event.getDamager() instanceof Player) || !(event.getEntity() instanceof Player))
return;
Player entity = (Player)event.getEntity();
KnockbackHandler_17.sendKnockbackPacket(entity, 0.0D, 0.0D, 0.0D);
} else {
return;
}
}
}
@EventHandler
public void onKnockback(PlayerVelocityEvent event) {
Player player = event.getPlayer();
for (Player playerz : AntiKB.tobesecret) {
if (playerz == event.getPlayer()) {
EntityDamageEvent lastDamageCause = player.getLastDamageCause();
if (lastDamageCause == null || !(lastDamageCause instanceof EntityDamageByEntityEvent))
return;
EntityDamageByEntityEvent lastDamageCauseByEntity = (EntityDamageByEntityEvent)lastDamageCause;
if (lastDamageCauseByEntity.getDamager() instanceof Player)
event.setCancelled(true);
}
}
}
``` why dosen't this work?
You have to Port Foward on Router and your PC Firewall
when using BuildTools, is it a known issue that it spits out the craftbukkit classes an extra level down? everything is packaged under v1_16_R1/v1_16_R1: https://url.octyl.net/mwjrfo9mfpttwwqcmsd8
laptop
It's the same, you have to have the ports open on the laptop's firewall
😕
eww Windows firewall
its woorkk
it hurts my eyes everytime
what firewall do u use then
Guys how can you remove all vanilla lore?
Including Enchants
cause when I use ItemMeta.getLore().clear() it gives me a Null Pointer Exception
maybe the lore is null?
what firewall do u use then
@opal bay UFW\Iptables
I use firewalld
ohhh should i do a check before it?
Na didn't work sadly
enchants aren't part of the lore I believe.
you can use ItemFlags to hide the enchantments among other things.
Ok but you no I still can't remove all the other lore
If the lore is null, the item shouldn't have a lore?
im trying to use org.bukkit.Color but its getting overriden by javautils
Hello there! How can I convert a simple chat formatted text to json (for NMS)?
i think there are already some text APIs out there
so there are no inbuilt thing for that?
TextComponent
And ComponentBuilder
so there are no inbuilt thing for that?
@tawdry venture ChatColor
im trying to use org.bukkit.Color but its getting overriden by javautils
@hollow thorn import the correct library
@winged sparrow so I can use that in ChatSerializer.a(String) for example?
tab header and footer, to be certain
Oh. There are in-API methods for that.
||shame on me, but 1.8||
Is there currently anyway to check if a player is respawning to a respawn anchor?
with or without protocollib, I have to use json
I have zero expertise in that arena
Does anyone know how to simply grab a random entity from the EntityType.values() array?
Oh nevermind I just found it out
I was being stupid
it looks like that ChatSerializer.a("{\"text\":\"" + formattedText + "\"}") works
Hello, when I want my plugin to load first of all, is there any way I can set it in plugin.yml? I am thinking something like this: depends: [*all plugins here*] but I can’t type in the names of all the plugins. Tried to search on google and the spigot website, no results
Is there a tag or something that I can add to a GUI that isn't the title so I can test for it in another class?
I can't do getTitle()
me ?
No
i want plot pls
@worn fiber Are you trying to get the custom name of the GUI?
If so, do getInventory().getViewer or something
/plotme
I know you can test for the name of the ui with a getViewer
?plotme
@peak glade http://letmegooglethat.com/?q=plotme+1.8.9
@winged sparrow I want to add a market or flag or something to the GUI that I can check for that isn't the GUI name because the name may change
getViewer() gets the name of the person who is looking at it
UUID?
I'm certain there's a method or similar one that is either getViewer() or getView() that lets you see the name, but perhaps you can put a specific item in there?
whether or the not the inventory GUI is a custom one and whether or not I should cancel the click event
I always base this kind of events on the GUI name
I can do event.getView().getTitle() but if the GUI name changes I have to edit all instances of it
Checking an item tag could be heavy
How do you define the name of your gui?
If you really want to be sure, just add invisible color code to the inventory name
Like §1§2§3§f
It will be invisble
And you just have to
if (event.getInventory().getName().startsWith("§1§2§3§f"))
(check for possible NPE also)
If I do event.getView().getInventory(1).toString()
It outputs org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventoryCustom@545524a9
Don't you have event.getInventory() ?
It will say CraftInventoryCustom
event#getClickedInventory
This is safe and easy
Warning: There is a @Nullable annotation
That outputs the same thing
getClickedInventory() outputs the same thing as getView().getInventory()
I'm gonna use getClickedInventory().contains("CraftInventoryCustom");
No
public class GUI implements Listener {
private final Inventory gui;
public GUI(int size, String title) {
gui = Bukkit.createInventory(null, size, title);
}
// Defaults quantity to 1 if not specified
public void addItem(ItemStack item) {
gui.addItem(item);
}
public void show(Player player) {
player.openInventory(gui);
}
}```
Cause getClickedInventory() returns an Inventory object
👏 When 👏 you 👏 open 👏 the 👏 inventory 👏 ... 👏 save 👏 the 👏 InventoryView 👏
and you're applying .contains(STRING)
toString()
@EventHandler
public void clickEvent(InventoryClickEvent event) {
if (event.getClickedInventory().toString().contains("CraftInventoryCustom")) {
event.setCancelled(true);
}
}```
🤦♂️
👏 When 👏 you 👏 open 👏 the 👏 inventory 👏 ... 👏 save 👏 the 👏 InventoryView 👏
What for?
So you can confirm whether or not it's your inventory
There are bunch of options
CraftInventoryCustom is every single inventory opened by Bukkit
It's implementation
All Players are CraftPlayers, for instance
All Worlds are CraftWorlds
Try to open a chest
Works fine
Because that's type org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory
with your code, you cancel the click event of any bukkit made inventory.
not just your own.
Do you guys know how to make Zombie Pigmen forced aggresive?
I don't know what else to do without hardcoding every single GUI I create
Or turn aggressive
- Set a specific name
- Save Inventory
- Save InventoryView
- Cancel specific items click
- Check if there is a special item
.
.
.
Writing a snippet
You mentioned I could check for a character in the title
Maybe I could prepend something like Shop : Main Menu
I told you exactly how you can do it
I don't know how to check for the InventoryView though
And I've wasted enough of your time via the power of sheer idiocy
You save you're inventoryview in a variable
Then as Attlantiz said: event.getView()
And add a .equals(Your saved View)
you'd probably make a map of UUID -> InventoryView
That's a perfect shoot
Why do you use Bukkit.getPluginManager().registerEvents(this, this);?
Just forgot the getCommand().register but that's okay
Oh right
I give you a 13/10
I didn't forget anything
Is there a problem to using the InventoryHolder way?
Yes. Bukkit is not meant to be implemented by plugins
Implementing InventoryHolder was never intended
It'd be the equivalent of implementing Recipe, passing it anywhere and expecting the server not to blow up
In this case, it just happened to have worked
Also, RE:
Just forgot the getCommand().register but that's okay
All commands from a plugin have their default executor and tab completer assigned to the JavaPlugin instance. It implements TabExecutor
Just saw it sorry
😛
But yeah, the custom inventory handling took no more than 2 listeners and ~10 lines of code
I learn so much stuff everyday ! Thanks \o/
If you keep track of your inventory views, you have yourself a flawless system
it opens an inventory, and yes
IntelliJ doesn't show anything when I hover
it returns an inventoryview
you can check that in the javadocs here https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/HumanEntity.html#openInventory-org.bukkit.inventory.Inventory-
public InventoryView show(Player player) {
return player.openInventory(gui);
}```
I made a custom GUI handler
This will call and return the function, right?
idk what gui is but that would return what openInventory returns yeah
GUI is an Inventory
plugin.customGUIs.add(menu.show(player));
I modified the code Choco sent to this
openInventory() returns an InventoryView, yes. That's what I'm keeping track of in my Set
And that's what you can use to compare against InventoryEvent#getView()
Ok cool
To differentiate between different types of GUIs in your plugin, you would have to keep track of different Sets of InventoryViews
Gonna test this now
Whether that's doing a Map<Class<? extends GUI>, Set<InventoryView>>, or holding a static Set in each of your GUI's classes, whatever
How you want to handle that is up to you
It cancels everything. Perfect!
Including stuff happening in my actual inventory
Meaning they can't drag stuff in there
Right and if you want to only do it for a certain inventory, InventoryView has getTopInventory() and getBottomInventory(), and the event has getClickedInventory(). You can compare and cancel accordingly if you'd like
Guys i have a egg wars server. And when the game finished. Server shut down. İs there any code for autostart server ?
the first map you sent choco would be hard to get the gui for a certain inventoryview
plugin.customGUIs.add(menu.show(player));
If I don't add this, then it's ignored
🎉
I don't think there's a scenario where I only need to block one or the other
The only scenario I can think of that would require a special case is blocking specific slots
if (INVENTORY_MAPPINGS.get(MyCustomInventory.class).contains(event.getView())) {
} else if (INVENTORY_MAPPINGS.get(MyOtherCustomInventory.class).contains(event.getView())) {
}```
@boreal tiger
Thanks a lot Choco
Or handle it in the GUI itself and delegate
if you have multiple guis how do you know which gui class to use though
I literally just showed you
but if I have 4 guis thats gonna look a bit ugly xD
Or handle it in the GUI itself and delegate
ah right
yeah thats what I meant
how do I export a plugin from intellij
to mc
I have the plugin I just don't know how to export to the plugins file
You using Maven/Gradle or not (just play old stuff)?
I don't know
I assume probably not then.
Go to File -> Project Structure -> Artifacts -> Click the + button -> JAR -> From modules with dependencies -> Specify main class, IDK if it's really required, probably not -> Remove anything that shouldn't be compiled with the JAR, e.g Spigot.
Sir that is a chicken
/gamerule doMobSpawning false?
not ?
cant
@light orbit what are you using to connect to the server, e.g what IP?
idk I'm trying to do a spigot test server
I have my terminal thing in the background
saying it was set up
It doesn't just show up in your serverlist.
how do I get it
If you use the IP localhost you should be able to connect to it.
ok so the plugin I made isn't working
the thing in the plugins folder just says manifest
and when I open it its not my plugin
You shouldn't need to make a manifest file for a plugin.
Did you put it in the plugins folder?
Huh?
is there a way to just like get the plugin in a file and manually put it in the folder
let me show you what this says when I export
how do I build it
At the top, hit Build -> Build Artifacts then it'll bring up a small menu in the middle. Click Build under the artifact you created.
Hey does anyone have any idea why the NBT of a playerskull is resetting when the user opens their inventory?
k whats wrong with thishttps://imgur.com/a/nNhEak7
No ;
sorry I'm still learning
hmm
im going to post my code cant get my UI to populate when in game
what isuue
Then again at the end ```
But http://paste.md-5.net/ is probs a better place the link here.
anyone know how to make a multiple version minecraft server? like kitpvp is 1.8 and towny is 1.15? so the HUB SERVER will have 1.8-1.15 support
@frigid ember you just run them on different versions.
If you mean allow other versions to connect, check out the ViaVersion/ViaBackwards plugins.
@proper cairn try setting the owner, IDK if it's required but just try (the one you have as null RN).
Do as I said before then kill mobs.
You can kill all non player mobs by doing /kill @e[type=!Player]
say error: player not found ?
You running Essentials?
yes?
What's the easiest way to compare the additions/removals from each api version? Like a javadoc comparison or something?
/minecraft:kill @e[type=!Player] run that instead.
Ok, did you do /gamerule doMobSpawning false?
here goty
Am I allowed to post a zip of a plugin to ask why it's not working?
everything compiles properly, but the actual stuff it's supposed to do just doesn't work in-game
It's an edited plugin and the only changes I made were updating to the latest Spigot repository
(for crafting recipes)
Wha?
wait
?
I have absolutely no idea what you mean.
Are you using some plugin to modify items?
yes
Probably caused by that then. Nothing I can do.
Does anybody know why updating a repository would break a plugin? and how I can fix it
how do i make an npc (citizens) have an inventory like a shop or be able to speak once clicked
hmmm
hola alguien que ayude con mi problema
spanish
no
plis
ill go on google translate
Do they help me with my problem
english fam
entonces cual es tu problema @glossy thicket
yeah i see
¿Hola?
te ayudaré con tu problema @glossy thicket
si me vas a hablar por favor @ me
whats a good quests plugin, something with a gui maybe?
Quests is good from what I've heard.
hola @frigid ember excelente servicio te pido una disculpa me equivoque de servidor de discord pero gracias por intentar ayudarme
ok
qué está mal @glossy thicket
hay algo mal con un complemento
o algo mal con tu servidor
Por qué no chateamos en los mensajes directos @glossy thicket
Quests is good from what I've heard.
@odd knoll luxuryquests is better no cap
🤔
😆
What cap?
CrazyCrates.
CrazyCrates has gui set up?
¯_(ツ)_/¯
GoldenCrates doesnt work too
:|
how do i get rid of a world on multivers e it says "could NOT delete world"
hay algo mal con un complemento
@frigid ember He said that he asked on the wrong Discord server, he meant to write on another server xD
oh lol
I updated a 1.14 plugin to the latest repository and it stopped working. Anyone have any idea why this would happen and how I can fix it?
Hello! in Linux there are 3 types of file or directory permission, are u, g and o, I want to know that if the server interact to a file or directory, which permission that the server stand for or play as ? u, g or o?
@lofty meadow Hello! can anyone help me?
I can't delay on join event
@hardy cedar You can tryjava Bukkit.getScheduler().scheduleSyncDelayedTask(<plugin>, <Runnable>, <timeInTickToDelay>);
anyone know if it's possible to give a spawner item with a specific type of mob?
Not without a custom system
thats dumb
How do I get the color of a bed on the PlayerBedEnterEvent
And when I get the color
cancel it for that bed
getType()?
yes
n
Not without a custom system
wot
just specific types
sure you can
how 👀
well @proper wolf just check if the block type is/isnt the color you want?
@subtle blade how would I use that to give like a creeper spawner?
what do I pass in getType @torn robin
you dont pass anything
it doesn't expect a atgument
yeah you dont pass anything
Get ItemMeta, cast it to BlockStateMeta. getBlockState(), cast to CreatureSpawner, modify to your desire, setBlockState()
Re-set the meta. You know the item meta system I'm sure lol
Ummmmmm i have a big issue
@torn robin
if (event.getBed().getType().equals(Material.RED_BED)){
This would be the final code?
WHenever a certain player joins my server, the server crashes, is it possible that something in his inventory is causing it to crash or is there something im missing here
you should use =='s for enums but yeah that'd work
it's very possible @neon epoch
@subtle blade
ItemMeta meta = item.getItemMeta();
if (!(meta instanceof BlockStateMeta))
return item;
BlockStateMeta bsm = (BlockStateMeta) meta;
if (!(bsm instanceof CreatureSpawner))
return item;
CreatureSpawner spawner = (CreatureSpawner) bsm;
spawner.setSpawnedType(EntityType.CREEPER);
bsm.setBlockState(spawner);
item.setItemMeta(bsm);
this look about right?
@torn robin I am gonna make a item stack to check for multiple colours
Sure only BlockStateMeta will never be an instance of CreatureSpawner
o
Though BlockStateMeta#getBlockState() might
gotcha
@proper wolf id probably make an enumset and check if the material is in that set
cleaner than making multiple item stacks
idk how to do that lel
You just want specific colours? Because you can just get all beds with Tag.BEDS
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Tag.html#BEDS
Mojang's way of grouping items and blocks together
It's an over-glorified EnumSet
(I guess in Mojang's case it would be an over-glorified HashSet lol)
Can someone help me plaease
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
It is kind of sloppy, yeah, but it allows for data-driven customizability
You can create your own tags in data packs
But how do I get a specific colour from a tag lets say
to exclude a bed
I'm limiting bed mining
and making it so it can be done with specific beds
hence why an item stack (my method) would be better
because if i wanted to add more features later
i can easily call it
I could also make dyes expensive on the "Blackmarket"
If you want just specific beds, you would do what MSWS suggested and create an EnumSet of your own
Droppers don't fire in the end dimension for me in spigot 1.15.2
@distant silo plugins?
How do I do that tho Choco