#help-archived
1 messages · Page 224 of 1
@frigid ember if you want the player object you need to check if they’re online first.
how can i recursive get keys in bungeecord?
how can I do a task every x seconds?
bukkit scheduler
Hessky this is an official tutorial: https://bukkit.gamepedia.com/Scheduler_Programming
how can i recursive get keys in bungeecord?
thanks
those somewone now a shop plugin whit a good interface Pls tag me
keys for what
What do you mean by "Bukkit#selectEntities()"? You mean an instance of Bukkit? How do I get that?
configuration keys
yaml
The bungeecord configuration api doesn't provide a depth option
only the root keys
@frigid ember it's a static method that pretty much just forwards it to Server#selectEntities(CommandSender, String)
just iterate over all keys and get the underlying value?
yes
then you can check if it's a section and repeat the process
but what if the underlying keys have other underlying keys?
then they're maps
recursion
get and repeat the process
hm
Bukkit.selectEntities() isnt showing up. I'm writing for a 1.8.8 server so maybe that's why?
i will try
yes that would be why. you're 5 years out of date
new features get added in newer versions
how would i prevent players from pressing f on an item while they are in an inventory (i.e. moving it into their offhand with the new 1.16 hotkey). Couldn't find new events and cancelling InventoryClickEvent doesn't seem to work
probably the same event called for putting items in the off hand. I forget its name
that isn't working either
in fact, docs even say
Called when a player swap items between main hand and off hand** using the hotkey**.
that isn't working either
@molten acorn Show us your code
yeah that only works when you press it when you are not in the inventory and it swaps the item but since 1.16 you can press it on an item within the inventory
where should i put the code?
?paste
ive just had a thought, probably shit, but you can see if the slot the item moved to was in the shield thing (by listening to inventorymoveitemevent) and if it is then just cancel. but then people can drag the item into the shield thing, which isn't pressing f 😦
wait na not a good idea
@molten acorn it's an InventoryClickEvent
InventoryMoveItemEvent is for hoppers tho :/
ok maybe it's just a ghost item because i cancel that event, i'll try updating the inventory after cancelling
more than likely, yeah. a call to player.updateInventory() should resolve that
@subtle blade is there a reason why WorldSaveEvent isn't cancelable?
probably because a plugin should never cancel the world being able to save?
guys how do I make that every 5 minutes a message is sent and everyone can see it
didn't someone link you to scheduler programming earlier? Or was that someone else?
nope it was linked for them.
then this isn’t the profession for you tbh.
😭
It involves a lot of reading and your own research.
google🤮
Or DDG. Your search engine of choice lol
DDG❤️
im just tired, i needed to go to bed like 13 minutes ago
That sucks. So if someone passes in a target selector I have to go thru the list of players and filter them out myself?
dont have time to read
That sucks. So if someone passes in a target selector I have to go thru the list of players and filter them out myself?
@frigid ember yeah that sucks
@frigid ember That doesn't suck. How else would you handle that
How would the server know what you want to do
Anyway it isn't hard or time consuming to do
and you think you’re going to make your first scheduler in 13 minutes work exactly the way you want?
maybe
thats what this channel is for
One thing you need to learn is you’ll learn more from reading than you will from us giving you the answer. All communities like this will point you in the right direction, none of them will spoon feed you the answers.
The channel is for people looking for help with Spigot development. If you need help will point you in the right direction, no one is going to spoon feed you the code.
ok
Meh
Cup of code
If that link doesn’t help you learn about schedulers there are a ton of other tutorials even video tutorials.
@lunar widget using other people their code wont gain you any experience.
If you want to learn you have to start coding yourself
Learning what something does and means
oh..
gn
👋
probably because a plugin should never cancel the world being able to save?
yet I can unload a world without saving it?
NPE at Powers line 29
what's at line 29
It's happening at line 29, https://i.imgur.com/FtH0q5s.png
ik
NPEs are extremely easy to find and fix, especially when they show up
if (event.getItem().getItemMeta().getLore().toString().contains("Click to get moon gravity for 10s")) {
my guess is maybe it has errors because the item doesn't have a lore?
why are you using List#toString() xD
close enough PlayerInteractEvent
why are you using List#toString() xD
@jagged torrent changed it
didn't change any results
I mean if it’s like a hub plugin you really just need to get the item as I doubt you have the same item doing different things.
if not it might be easier just to look at the name of the item
im making a plugin that gives people super powers
this power gives you and item you can click on to use your power
it works but if they click something other than the item it spams console
are there vanilla items with a lore?
hey guys, is there a plugin to give random/custom rewards based on %drop to a specified player via commands? (not trying to do ptw just keys for players who have higher playtime & for voting)
I just pasted the sample PersistentDataType code for the UUID
How do I make use of it?
https://paste.helpch.at/piliwohipu.cs
https://paste.helpch.at/relopaxava.cs
if i click with an item that doesn't have a lore i get that error
got it working 🤯
[playercounter.activated, playercounter.text, overrideonline, online, overridemax, max, protocol.activated, protocol.text, icons.activated, test.test.test, test.test.test2, motd.activated, motd.text
public void iterateKey(String gkey) {
for (String key : configuration.getSection(gkey).getKeys()) {
if (configuration.get(gkey + "." + key) instanceof Configuration) {
iterateKey(gkey + "." + key);
} else {
keys.add(gkey + "." + key);
}
}
}
@wary ledge which one of all those lines is line 46?
and
for (String key : configuration.getKeys()) {
if (configuration.get(key) instanceof Configuration) {
iterateKey(key);
} else {
keys.add(key);
}
}````
if (event.getItem().getItemMeta().getLore() == null) {
The meta can be null
^
Because the meta can be null
ItemMeta will be null if the item is AIR
Keep that in mind when creating your plugin
How would i Make a custom perms system like luckperms and pex, any good Ressources i can Look at, or can someone tell me How to hook into spigot so i can add/remove perms from a user
ok i fixed it
Hello. I need help.
So I do PlayerInteractEvent e and then e.setCanceled(true);
This is supposed to cancel interacting with items. However, when I try to place a block it does cancel, but it disapears from my hotbar, and only when I click the slot from the inventory with mouse, it appears back. any ideas?
spigot 1.8.8
(1) Update, you're 5 years out of date. (2) If you want to cancel block placement, BlockPlaceEvent.
All else fails, call a player.updateInventory() one tick later in your interaction
ItemStack control = new ItemStack(Material.BEDROCK);
control.getItemMeta().setDisplayName("Moon Gravity");
control.getItemMeta().setLore(Arrays.asList("Click to get moon gravity for 10s"));
player.getEquipment().setItemInMainHand(control);```
No, I want to make a spectator settings gui open when I click the comparator item
why does it not have a custom name or lore
and it does open but when I click floor with it, it disappears
ill do updateinv then
getItemMeta() returns a copy every time you call it
get it, assign it to a variable, modify it, set it back to the item
How would i Make a custom perms system like luckperms and pex, any good Ressources i can Look at, or can someone tell me How to hook into spigot so i can add/remove perms from a user
@floral laurel bump?
Look at their sources @floral laurel
large majority of what you'll be working with is the Permissible and PermissionAttachment interfaces
I don't see a real reason why we need a new permissions plugin
LuckPerms has everything you can imagine
And if not just create an addon
True But i want to Make everything myself, not only for experience But also to learn hands on
Look at their sources @floral laurel
@mellow wave Yes But they have too much stuff that is not really permission related to i wanted some Ressources to really get only the info i need, luckperms Has lots of Different stuff in it
Then it's a great opportunity for you
Since you need to trackdown the permissions part you will have to look and understand how it works internally
It's a win if you want to learn
How do I change a players message color everytime they chat after running a command?
Since you need to trackdown the permissions part you will have to look and understand how it works internally
@mellow wave doesnt luckperms have lots of permission related stuff that isnt needed?
- Detect command
- Set a color variable for the player
- Grab the next message sent by the player
- Set that message to the color from the variable
@raw arch
@floral laurel It does but you learn while looking at the code and trying to trackdown the part that you need. It's a great opportunity to learn proper code standards
.setDisplayName(ChatColor.AQUA + ChatColor.BOLD + "Moon Gravity"); is corrct right?
Yes
@floral laurel It does but you learn while looking at the code and trying to trackdown the part that you need. It's a great opportunity to learn proper code standards
@mellow wave ok will do! Thank you
Error:(34,46) java: bad operand types for binary operator '+' im just joining things
.setDisplayName(ChatColor.AQUA + "" + ChatColor.BOLD + "Moon Gravity");
^ try that
it worked
Is there a way to stop the push mechanic on players in 1.16?
@opal adder Player#setColidable
why can i not find this
declaration: package: org.bukkit.inventory, interface: PlayerInventory
declaration: package: org.bukkit.inventory, interface: PlayerInventory
on this page it shows there are 2
Hmm okay
What API are you using?
on my IDE there is only 1
i am trying to put an item in slot 8 (9)
but i don't have that option
It's just inventory.setItem(8, item)
Why PlayerJoinEvent is not Cancellable
oh i was using equipment
Because you can't cancel it like that you need to kick the player not abort the connection
I mean you probably could but no that's bad
I wanted to make a join priority system
so basically my server has 50 slots , but the last 5 slots are reserved to VIP
Do I have to use PreJoinEvent
That should be perfect for what you need
Yeah for now it's fine
Although I think I'll transfer this to a Velocity plugin because it's better to let the proxy handle this
player.setCollidable(false); doesn't do anything
Read the javadoc
My bad use this: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.Spigot.html#setCollidesWithEntities(boolean) @opal adder
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
Anyway Javadocs are a good place to start :)
I'm confused this is really only showing how to do it with entities, but I only want to disable collision with players on players
Yea I know that, I just don't want their push to be disabled on anything but players
is that not possible?
you can make use of the collision exemptions introduced a short while ago
Inventory.updateInventory() is deprecated. What should I use instead?
Maybe just re-open the inventory
Inventory#updateInventory()?
Yes
That definitely doesn't exist anymore
What's the collision exemptions?
Are you thinking of Player#updateInventory() per chance?
You can also add all players to a scoreboard team and set the collision to own team
I think at least
Weird, it says it is deprecated. Maybe vscode is stupid. I should use real IDE.
VSCode is definitely an unorthodox choice for Java
I used netbeans but the keybinds suck a lot
I prefer IntelliJ
perhaps I should give it a try
btw, how can I get iron_pickaxe from an ItemStack of iron pickaxes?
getType?
btw vscode works fine for me too
That what u mean?
The item key will be part of the material. getKey()
Although, if it's iron_pickaxe, you're on post 1.12.2 items?
Idk it's just something I made up based on what I saw before lol
Material.IRON_PICKAXE.getKey() will return you a NamespacedKey with the value minecraft:iron_pickaxe
What's the recommended java version for plugin development?
8 I guess 🤔
8 if it's public, yeah. though if you're just writing a private plugin for your own server, you're fine (and are recommended) to use anything post-8
not enough server hosts have jumped to 11
What's the recommended java version for plugin development?
@graceful vigil 8
Imagine using Java enterprise 5
i mean, in MC 1.7 and 1.8, 7 was practically standard
the jump to 8 was only a handful of years ago
i still remember having discussions on the forums about whether or not to compile plugins against 8
and here I am with openjdk 14
which, again, if you're writing plugins for a personal server, please do
I use 11 mostly. and 8 only where needed.
you get the benefit of working with newer features in the language and you get the fixes and performance improvements from modern java versions
9's module system didn't break anything for CraftBukkit or Spigot servers so the desire to stay on 8 should have been long gone after 11 was released
how can i lock an item in a player's inventory?
like they can't move it, place it, drop it, drop it when they die ect.
would it be InventoryInteractEvent?
and here I am with openjdk 14
@frigid ember wait you all use Java?
xD
I code all my plugins with JRuby
why does throwing an item count as left click air
oh sorry it thinks im spamming
ok just did some testing
if i look at a block when throwing it's not even an event
ok that's weird
it's not doing it now
@wary ledge BlockPlaceEvent, InventoryClickEvent, and PlayerDropItemEvent
@rigid pier what have you tried?
wdym when you throw it? Like it’s a projectile or when you drop it with “Q”
Q
PlayerDropItemEvent should stop that if you’re checking correctly what do you have?
For me ?
@rigid pier what exactly are you trying to do you’ve given nothing.
@rigid pier are you trying to make a command that will create a cooldown on other commands?
@balmy sentinel when i removed the drop item event and it seems to still happen
it's not that big of a deal as a player shouldn't have more than 1 of these items
but kinda weird
does the drop event get called?
i have like a ton of events in 1 class and im registering he class
?paste
i don't have issues making them work
let me see what you got
@rigid pier are you trying to make a command that will create a cooldown on other commands?
@frogsoup.parker#0501
Give the cooldown in the golden apple
@wary ledge send the message before the if statement just to check if the event is being called
@rigid pier so you want to stop people from spam eating golden apples by implementing a cooldown on them?
it is being called
Yes pleas
then something is wrong with your if statement @wary ledge
@balmy sentinel
@rigid pier so what have you tried?
is event.getItemDrop().getCustomName().equalsIgnoreCase("§l§bMoon Gravity" maybe not the way to check the item
let me look at the event Need_Not
no but I don't understand which command to ask
try event.getItemDrop().getItemStack()
ok so i removed the if statement and it doesn't let me throw it
Need_Not
but it seems to be LEFT_CLICK_AIR
@rigid pier so you haven’t tried anything correct?
Does spigot support Datapack custom dimensions yet?
wait @rigid pier are you trying to make a plugin or run a command in game
if i could find away to cancel the LEFT_CLICK_AIR if i throw, but only if i throw because i use the LEFT_CLICK_AIR for other things
Yes
@rigid pier use this event, https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/FoodLevelChangeEvent.html.
check if the item is a golden apple
at worst you don't have the command to do on an apple or enderpearl with / cooldowns
Pleas
@rigid pier do you know English as your first language?
@rigid pier check out that event I don’t know what else you need. Create a map and store the player within it if they’re on a cooldown. Once the cooldown is over remove them from the list.
does anyone know if i am allowed to link a plugin in this chat? I have a question about...
I m frensh
I‘m sorry
just asking because some servers dont like advertisement, even tho this is not my plugin lol
what do you need help with
@solid sundial anything you need help with regarding Spigot development can be posted here 🙂
https://www.spigotmc.org/resources/parkour-1-8-8-up-to-1-14-3-automation-update.30599/
i am wondering if this is 1.16 compatible. I went on their test server, (1.16) and some things worked. I was just wondering if it works completely for 1.16 🙂
have you tried contacting the author?
Thé /cooldowns <command>
The*
What the command for use in the enderpearl
Our golden apple
what did they say?
why cant people connect to my MC server? i portforwarded and it seems to have worked but apparently
not
@rigid pier I’m sorry I really don’t understand what you’re asking.
@ebon girder are you sure the port is open
@ebon girder what is your firewall
i set up in windows firewall and disabled avast shields
would malwarebytes be doing it ?
@ebon girder are you sure the port is open
@frogsoup.parker#0501
how do i double check
just check with your security client
I believe there is something on Windows to look at open ports hang on a sec
in fact he indicated the command so the / cooldowns <command> but what is the command to put
I am use google traduction
I am sorry
Good evening!
I would like to know how it would be possible for me to put a custom head on an existing block? Currently when I do it I have a little mistake in console x)
code: https://prnt.sc/tvzmay
error: https://prnt.sc/tvzmgu
class import: https://prnt.sc/tvzmuk
@ebon girder https://canyouseeme.org I can’t find the utility tool on Windows. Go to this site and enter your public IP and port
A free open port check tool used to detect open ports on your connection. Test if port forwarding is correctly setup or if your port is being blocked by your firewall or ISP.
in fact he indicated the command so the / cooldowns <command> but what is the command to put
Pleas
@rigid pier are you trying to create a plugin?
Nope
@ocean prism get the location of the block, increase the y by 1, place the skull on that new location.
🤔
@rigid pier okay to my knowledge there is no way to change the cooldown time on enderpearls and/or golden apples. If you want to change them you need to either create a plugin, find a developer to do it for you, or find an already existing plugin.
disable the cooldown with stuff like 1.8 pvp plugins and then change it?
sorry i had to compress and drop the FPS on the video so that it wouldn't be that big because my internet sucks so bad https://streamable.com/ofg8dt
but you can see how broken the cancel drop event is for me
also idk why it says badlion
im using my own custom client
not even modified badlion because that's bad
i just want to lock the bedrock in the 9th slot
so if they throw it, die, anything! it will always be there
Bon bah merci à vous
Je vous laisse
Sur ce bah merci
👍
Bon travail
A vous
Je vous laisse
@wary ledge check this out https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryAction.html.
Et je suis pas anglais c’est pour ça que je ne Sais pas parler
not sure tho
creative is dumb with the inventory click event
wait so....
@balmy sentinel i cant enter my IP
@ebon girder is the IP shown already your public IP address?
actually yeah it should be so just enter the port and run it and see if the port is open.
if the port isn’t open that’s your problem.
did i use the wrong IP address
well if you didn’t port forward properly that’s another problem.
you also might want to check if your router actually allows port forwarding. I know some ISPs let you set port forwarding options, but don’t actually open the port.
i have vault, essentials, deluxemenus, worldedit, worldguard a few more but basically nobody can break stuff in spawn but they cant break stuff in skyblock either. How can I fix this
what's the best way to store data?
database
sqlite or other?
how do i get the name of the item with InventoryAction event
won't it have worse performance?
I assume you load the data and save when player leaves or save it every half of a minute or so
yeah, load data when they join
save it periodically (so they don't use much data if the server crashes)
and save it when they leave
I am scared what if server crashes
just save it periodically
so TextComponent.fromLegacyText seems to be ignoring &r reset codes, or at least for color but not formatting. do I need to do something else?
Okay, thanks :P
I keep my hub compass when going to iridium skyblock
@balmy sentinel its not blocked
the site says the port is open?
ye
then clients should be able to connect. If you’re still having issues I’d check firewall settings
im supposed to use the ipv4 address in ipconfig when you put that in the terminal right
maybe i used wrong ip
for the internal IP address yes.
for the external IP address you need to put your public IPv4 address.
how do i check thazt
go to your search engine and search whatismyip
for the external IP yes.
when do i use my diff ips
for the internal IP you want to use the IP address that shows up in ipconfig
anyone know a playershop/chestshop plugin that shows a mini hologran like this above to show the amount of items in like this : 🟩 🟩 🟩 🟥 🟥 🟥 🟥 🟥 🟥 🟥 ?
what is an API
Spigot's an API
what does it do?
Allows us to make amazing things
Application programming interface
:)
Pretty much anything front-facing that makes programming easier
In short, yeah
but does anyone know a plguin...... https://discordapp.com/channels/690411863766466590/690470011382267904/741447849023373323
that sentence is not english
what one
the one you said
press the . link
why
anyone know a playershop/chestshop plugin that shows a mini hologran like this above to show the amount of items in like this : 🟩 🟩 🟩 🟥 🟥 🟥 🟥 🟥 🟥 🟥 ?
@frigid ember to this
ohh i could make one
Is anyone able to teach me how to make plugins? I know the basics but I want to learn how to do more stuff.
@empty seal do you know java?
I want to learn java
isnt there a test plugin
I know how to create a basic plugin but I need help with other big stuff
i can teach you skript is is a lot easyer than java
use intellij it is better
I like eclipse. It looks clean and stuff
do you know java
wana vc
Sure
https://cdn.discordapp.com/attachments/741136052420345879/741462970554646598/unknown.png is that where i put my whereismyip address
HI friends, may I know if there is a way to change the snowing height for cold biomes with a spigot plugin? Thanks!
I don't know whether I have to play with nms for this
I am making a gui and i am adding a second item to it but it keeps the lure and name between the two. How do i fix this
OutlinePane pane = new OutlinePane(0, 0, 9, 5);
ItemStack item = new ItemStack(Material.ICE);
ItemMeta meta = item.getItemMeta();
String[] strArray = {ChatColor.RESET + "Test"};
meta.setDisplayName(ChatColor.RED + "Test");
meta.setLore(Arrays.asList(strArray));
item.setItemMeta(meta);
GuiItem guiItem = new GuiItem(item, event -> event.getWhoClicked().sendMessage("You clicked on ice!"));
pane.addItem(guiItem);
gui.addPane(pane);
OutlinePane pane1 = new OutlinePane(2, 0, 9, 5);
ItemStack item1 = new ItemStack(Material.ICE);
ItemMeta meta1 = item.getItemMeta();
String[] strArray1 = {ChatColor.RESET + "Test2"};
meta.setDisplayName(ChatColor.RED + "Test2");
meta.setLore(Arrays.asList(strArray1));
item.setItemMeta(meta);
GuiItem guiItem1 = new GuiItem(item, event -> event.getWhoClicked().sendMessage("You clicked on ice!"));
pane.addItem(guiItem1);
gui.addPane(pane);
why is my portforward not wroking
people cant connec to the serber
i checked the port using https://canyouseeme.org/ and ti says it works
depends, are you giving them your IPv4/IPv6 (public hostname), and are you sure that you port forwarded it correctly
where am i supposed to put what>
didn't ask that.
one for port forwarding in your router, did you forward your actual computers local ip something like 192.168.0.5 forwarding 25565
you can either compile it your self using buildtools [google it]
ok your computer has it's own ip address within your house, per say
Ou thanks
your router has to know which computer it is letting the internet talk to
local ip doesn't matter
the local ip address is the one in IPV4 right
open up command prompt, [assuming your on windows]
type ipconfig
@brisk spoke sorry i don´t speak english but how do I download spigot 1.15.2 to make a server?
Thanks
the ipv4 is what you'll use
@brisk spoke sorry i don´t speak english but how do I download spigot 1.15.2 to make a server?
Thanks
@shy valve once again, you'll need to use buildtools
type ipconfig
@ebon girder yes, find the IPv4 for your computer
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
if (player.getKiller() == null) {
return;
}
EntityPlayer nmsPlayer = ((CraftPlayer) event.getEntity()).getHandle();
if (nmsPlayer.getKillingEntity() == null) {
return;
}
Entity entity = CraftEntity.getEntity((CraftServer) event.getEntity().getServer(), nmsPlayer.getKillingEntity());
if (!(entity instanceof LivingEntity)) {
return;
}
PlayerKilledByEntityEvent playerKilledByEntityEvent = new PlayerKilledByEntityEvent(player, entity);
Bukkit.getPluginManager().callEvent(playerKilledByEntityEvent);
}```
This is an event caller I wrote
for a custom event
yet when I try listening to it, nothing happens
i'm going to guess here, my experience with the spigot/mc api is limited. are you registering the event class?
public class PlayerKilledByEntityEvent extends Event {
private final Player player;
private final Entity entity;
public PlayerKilledByEntityEvent(Player player, Entity entity) {
this.player = player;
this.entity = entity;
}
public Player getPlayer() {
return player;
}
public Entity getKiller() {
return entity;
}
private static final HandlerList HANDLERS = new HandlerList();
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlerList() {
return HANDLERS;
}
}```
This is actually my first foray into writing my own events
and are you sure you're returns are not firing nulling the event
No, I might not be registering them
ya if you're not registering that'd explain it :p
This code should work as is, it's basically ripped from my other plugin that handles this fine
Oh wait
Yes, I am registering my events
if i wanted to make a compass point to a specific entity, could i create commands to set entities to “hunter” and “speedrunner” then use those in the code with the compass and making the compass stay in inv when dies
Sorry, I thought you were talking about I had to define my custom event or something
But yes, I am indeed registering my listener classes lol
cool, have you tried logging to see if the event is firing?
Im planning on creating a minecraft manhunt to play with my friend or at least test on a test server
Yeah I'm about to move on to that phase, I was just checking to see if anyone spotted some glaring errors
I didn't have success with that
probably should do that before coming here 😛
I'd rather just get the nms field
As I download 1.15.2 for a server I don't speak English and I don't understand how, I never did something like that
HELP PLISSS
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i've already guided him to that
Not sure if there is a translation of that
@shy valve are you on Windows
Oh, it worked after I put in log lines. Must not have loaded it properly.
once you install those, you'll need to download buildtools using this link: https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
Buildtools seems complex to me :c
i'm trying to guide you through it..
that's not the problem, the problem is me
Yes, i want the spigot 1.15.2
have you downloaded the before mentioned links?
No
you need to do that..
Try translating the page to your native language and following it along
that may help
o, sorry I better not use spigot since I am very complicated, thanks for the help
and your time
Well, don't revert to Bukkit should you decide to not use Spigot
If you're not going to use Spigot, use Paper Spigot
Which is easier to download.
ok
I haven't touched bukkit in years anyways lol
why anyone still uses it in any capacity is a total mystery to me
Nah buildtools still builds it
Though BuildTools is so much better for getting spigot in your local repo
I am ashamed to admit that I still can't figure out how to get paper's api in my repo
Why does the first line respect the reset but the second doesn't (the second line is fully bold, despite the reset in there)
String message = "" + ChatColor.BOLD + "test " + ChatColor.RESET + "test";
player.spigot().sendMessage(TextComponent.fromLegacyText(message));
player.spigot().sendMessage(new ComponentBuilder().append(TextComponent.fromLegacyText(message)).create());
speaking of which i really need to start working on buildtools integration into my panel
@sleek ivy Question, is this on 1.16?
TextComponents + legacy chatcolor formatting does not cooperate well
use the supported .color() and similar methods
Plus legacy chat color is kinda messy in 1.16 in general
I'd recommend using a ComponentBuilder for some sanity
I can't, I'm processing external config stuff
can you not write a parser if not doing it internally? (not my field, not very knowledgeable in spigot api again)
I guess you'll have to write a parser for that 🙃
ugh
Best of luck lol
😄
You know, I don't think it would be that hard
I'd get the string, and at every instance of a chatcolor format, split it and apply it to individual segments in a component builder
it will be a tiny bit tedious but not too bad
probably
might need regular expression though which is never fun
@brisk spoke so my IPv4 address is what i use in portforwarding
i leave the remote ip address as any
and then i give them my external ip address
How would i send a command as a player?
player#performCommand
public class PlayerType {
private static final List<PlayerType> types = new ArrayList<>();
public static PlayerType register() {
System.out.println(types); //null
}
}
How come types is null there?
A temporary fix is initializing it in the register() method but that's a weird workaround imo.
This honestly doesn't make any sense.
In function1 I print the value of types. because that function adds one to it and it has one entry, which was obviously to be expected.
Now, in function2 which gets called afterwards I also print the value of types. This time it's empty.
How and why does this happen?
Likely a stupid simple solution but how can I get a ChatColor from a string color code like §6
Hello. I am currently working on an SMP Earth server for 1.14.4 for a Discord server - For some reason, when I join the server my skin suddenly changes into a steve skin, and the same occurs to other players. I went through some possible plugins that could be causing this issue, and deleted the unnecessary ones. However, I still cannot find a solution. Please @ me if you have any suggestions/ideas on why this may be happening.
Offline mode?
Nope
?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.
you tagged 2 mods to help you lol, not a high chance anyone will help you that way
hello please help me
i export jar file and when running the server nothing happen on the game
@hoary cove Ever tried restarting?
the server?
mhm
🤷♂️
any errors
i dont see the file executed on the server
package me.tabootwo.essentialcommands.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import net.md_5.bungee.api.ChatColor;
public class God implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if(!(sender instanceof Player)) {
sender.sendMessage("Console is already a god!");
return true;
}
if(!(player.isInvulnerable()))
player.setInvulnerable(true);
sender.sendMessage(ChatColor.BLUE + "You have enabled god mode!");
return true;
if(player.isInvulnerable());
player.setInvulnerable(false);
sender.sendMessage(ChatColor.BLUE + "You have disabled god mode!");
return false;
}
}```
hey im trying to make a god mode command
im trying to make it check that if you already have god mode on, it will turn it off
but what im playing around with just isnt working, anyone know how I can fix that to make it work
wheres your brackets
if(!(player.isInvulnerable()))
player.setInvulnerable(true);
sender.sendMessage(ChatColor.BLUE + "You have enabled god mode!");
return true;
```
will only call player.setInvulnerable
then the rest will always be called
and returning false means the command as done incorrectly
so ```cs
if(player.isInvulnerable());
player.setInvulnerable(false);
sender.sendMessage(ChatColor.BLUE + "You have disabled god mode!");
return false;``` implies that
when it should be returning true
turns what off
invulnerability
no setting the invulnerability is fine
its returning false
what are the errors
package me.tabootwo.essentialcommands.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import net.md_5.bungee.api.ChatColor;
public class God implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if(!(sender instanceof Player)) {
sender.sendMessage("Console is already a god!");
return true;
}
if(!(player.isInvulnerable())) {
player.setInvulnerable(true);
sender.sendMessage(ChatColor.BLUE + "You have enabled god mode!");
return true;
}
if(player.isInvulnerable()) {
player.setInvulnerable(false);
sender.sendMessage(ChatColor.BLUE + "You have disabled god mode!");
return true;
}}```
you still have to return at the end
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if(!(sender instanceof Player)) {
sender.sendMessage("Console is already a god!");
return true;
}
if(!(player.isInvulnerable())) {
player.setInvulnerable(true);
sender.sendMessage(ChatColor.BLUE + "You have enabled god mode!");
return true;
}
if(player.isInvulnerable()) {
player.setInvulnerable(false);
sender.sendMessage(ChatColor.BLUE + "You have disabled god mode!");
return true;
}
return false;
}```
I have a problem.
I don't want to spam forum, but it is a necessity to have 20 posts in order to post new thread.
Can I get verified by moderators... or if I will construct a job offer you can post that for me?
ayy fixed, tysm
no worries 🙂
(I am danielduel.67648)
hi guys whats the best free plugin for pvp tags and cooldowns 1.8.9
Anyone got ideas? #help-archived message
@somber bluff I doubt they’ll change it. Just read forum posts and answer where you can.
but don’t spam or bump old threads
Yaaaa, that's why I wanted to "Hey forum mods... Could you switch that button for me?" 😄
Okay, end of topic, it is getting slimey
^^
if they make an exception for you they’ll have to do it for everyone it turns into a slippery slope. Just be active and you’ll get there.
@frigid ember me here
@ember bay how long has this issue been occurring for?
I just started working on this server exactly a week ago, mabye I got it a few days ago?
does anyone know of a PersistentDataType implementation for Entities?
I'm trying to make pokeballs
- Do
/pluginsreturn your plugin in green? - Are there some startup issues with plugin?
@ember bay
All of them are green/up to date
Is that your plugin?
Ah, w8, you are not the person that I was replying to xD
nvm
@lilac gorge ~~https://imgur.com/a/Tx4WqwM~~ looks like you fixed it and I didn't see it
if semicolon.
maven shits me sometimes
all my shades are working except one but i'm doing nothing wrong o-o
<configuration>
<artifactSet>
<includes>
<include>javax.servlet:javax.servlet-api</include>
<include>com.sparkjava:spark-core</include>
<include>org.slf4j:slf4j-api</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>spark.Spark</pattern>
<shadedPattern>me.buby.oauth2mc.spark</shadedPattern>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
<shadedPattern>me.buby.oauth2mc.slf4jk</shadedPattern>
</relocation>
<relocation>
<pattern>javax.servlet</pattern>
<shadedPattern>me.buby.oauth2mc.javax.servlet</shadedPattern>
</relocation>
</relocations>
</configuration>
``` anyone know whats wrong with this? the javax.servlet shade just isnt getting shaded
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>```
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Feed implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
if(sender instanceof Player) {
if((player.getFoodLevel() == 20));
player.sendMessage("You have already been fed");
return true;
}
if(!(player.getFoodLevel() == 20)) {
player.setFoodLevel(20);
player.sendMessage("You have been fed loser");
}else{
System.out.println("Only players can eat food, silly console");
}
return false;
}}
can someone help me with this, trying to make it so if I am full hunger, it wont feed me, but it says "you have already been fed" either way
not sure why
does spigotmc have anywhere any rss?
i would use that do design my github page.
Player player = (Player) sender;
if(sender instanceof Player) {```
you should check before you cast
if((player.getFoodLevel() == 20));```
and it's because the semicolon
damn I fixed it before looking at this, I completely reformatted it to work differently xd
lmao happens to the best of us
thx tho
anyone know whats wrong this? commands.yml ```command-block-overrides: []
ignore-vanilla-permissions: false
aliases:
icanhasbukkit:
- "version $1-
givedirtmsg:- "give @s minecraft:dirt $1"
- "say Gave dirt to @s"```
the givedirtmsg not work
or is this wrong channel
to ask
Spacing looks wrong. Move givedirtmsg back 2 spaces
ok thx
How would I use the API to make a clickable (and styled) message that overrides in the AsyncChat event
@undone narwhal Do you know how to do that with deluxechat's api xd
I thought it was just regular chat
apparently not
not really
I need to replace [warp] with
[Click here to warp to ...'s island]
and if u click it runs /is go <plr>
do I need to seriously rebuild the deluxechat formatting using text components for this xd
hello please help
is this the only i need to change on config.yml in auth me?
MySQL Hostname
MySQL Port
MySQL Database
MySQL Username
MySQL Password
Hi, how do I detect zombies holding items and remove them? (zombies or items, doesn't matter)
I've been trying to change a final value through reflection and I've confirmed through the debugger that making it "not final" worked and that the field is accesible
the field is static if that's of any use
hmmm.... is there a way to send this target name to another class? https://pastebin.com/HvR7A4Hk
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I have a data class (dont know if thats what you'd call it) structured like this:
public class BankAccount {
public int index;
public UUID player;
public int bankAge;
public int lastLogin;
public List<ItemStack> storage;
public int debt;
}
Now there are going to be many instances of these data classes. I've followed a few tutorials regarding saving data with yml but I cant wrap my head around it.
I need my yml file to be structured like this
UUID:
INDEX:
AGE:
LASTLOGIN:
DEBT:
INVENTORY:
(LIST OF ITEMSTACKS)
UUID:
INDEX:
AGE:
LASTLOGIN:
DEBT:
INVENTORY:
(LIST OF ITEMSTACKS)
There will be less than 50 instances of this bank file. And databases would overcomplicate it
Just use a ConfigurationSerializable
this thread should help you
That tutorial is partially wrong
Is there a way to restore broken end portals?
I think there is
How can I do that? Are there already any plugins that do this?
Hey folks
There used to be a way to cancel chunkUnloadEvent, what's the 1.15.2 alternative?
How can I do that? Are there already any plugins that do this?
@kind crow Manually recreate them?
@kind crow Manually recreate them?
@karmic sable it's not the solution. There are too many portals and they got constantly destroyed
Well you could
a) prevent them from being destroyed with worldguard
b) roll them back with coreprotect
c) have them fixed on a fixed time daily/hourly/...
Hey folks
There used to be a way to cancel chunkUnloadEvent, what's the 1.15.2 alternative?
@karmic sable
Tag me if anyone knows :)
I just want a certain area (in a void world with only one structure) to never unload.
Well you could
a) prevent them from being destroyed with worldguard
b) roll them back with coreprotect
c) have them fixed on a fixed time daily/hourly/...
@karmic sable c) could be a good solution. But how do I fix them automatically?
Rundik code using the world edit API, or get someone to do it for you, you'd need to provide more context though
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
public class Move implements Listener {
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
Player player = e.getPlayer();
if(!player.hasPermission("cmd2.use")) {
e.setCancelled(true);
}
}
}
``` Hey I made this little event to stop players without a permission from moving, and it does not work, im racking my brain here. anyone know why?
Register it
so
did you register it in your main tabootwo
i have a question
I really want to slap myself sometimes, I did the register wrong
Rundik code using the world edit API, or get someone to do it for you, you'd need to provide more context though
@karmic sable I have an anarchy server, so it's better to do it automatically without any admins flying around. Can't I do it without worldedit?
the Bukkit has error
is it possible to modify a static final field that's not a primitive type?
you cant modify a final field
using reflection
@karmic sable I have an anarchy server, so it's better to do it automatically without any admins flying around. Can't I do it without worldedit?
@kind crow no no no, if you code it using the api, then you don't need any players to do it..., it would be a plugin
Uh with reflection, yes i believe so
got it nvm
can you run a minecraft server on... wait a minute let me get it
Wtf I got auto warned for quoting too many people
https://prnt.sc/tw4sxv one of these
wot
yes mynameisearl you can host a server on something as small as a raspberry pi, the only question is whats the size of the server, howmuchwould it need to be able to take
Yeah cause I'm having issues modifying a static final field through reflection. I checked through my debugger that the code that made it accesible and "not final" worked but when I go to set it I get an IllegalAccessException
can't just give a picture of a tower then assume we know what it is lol
@kind crow no no no, if you code it using the api, then you don't need any players to do it..., it would be a plugin
@karmic sable yes, I understand that. But having no dependencies would be much better I think (worldedit isn't a lightweight dependency either)
so a literal server tower
public static void makeAccessible(Field field) throws NoSuchFieldException, IllegalAccessException {
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~ Modifier.FINAL);
}
this is the code which makes it accesible
what is a good hosting site
Rundik if its for your custom server, why not use dependenies, I do it sometimes its just easier..
Could do it without dependency, story a copy of the area in a file; and replace it with the copy every few hours but idk might get messy
Earl, I use Bisecthosting
ah that explains it
Rundik if its for your custom server, why not use dependenies, I do it sometimes its just easier..
Could do it without dependency, story a copy of the area in a file; and replace it with the copy every few hours but idk might get messy
@karmic sable do I store it as .schematic? Can I place schematics on vanilla spigot actually? I don't think I can, I need a plugin for that too
if your structure isnt too big you can just storethe blocks individually
But ye with worldedit you can place schematics, I don't see why you wouldnt use a dependency
hmh
if your structure isnt too big you can just storethe blocks individually
But ye with worldedit you can place schematics, I don't see why you wouldnt use a dependency
@karmic sable it's just 3x3 area of end portal blocks
what is a good hosting site
I'll try it, although that code works on other fields just not that one
hm strange
@mystic bluff depends, do you want dedicated machines, vps, what location?
Ok, thanks for helping @karmic sable
and one that's also static final, and I'm even doing something that's more hacky 🤷
just out of curiosity what is the variable for
uh idk im new to this
surely theres some workaround
rn i use aternos lmao
Goodluck with it Rundik
but uhm
if its litterally just the 3x3 portal area, then I suggest you don't even make the copy and just forcefully replace the blocks with the correct ones to "repair" every now and then, I'm guessing its just the portal blocks
AttributeDefaults.b
@mystic bluff how big of a server do you plan on hosting
that's the value I'm modifying
yes
Do you already have that playerbase, MyNameIsEarl? If not, then I suggest starting smaller and upgrading your host as you move along
I hear pebblehost is really good
@karmic sable that's why i said 20 players lol
realistically it will take a year to even get 50 concurrent players
i have about 10 people rn
I got 50 concurrent players in a month from scratch with almost no ad ;)
The value is in an ImmutableMap I'm modifying so perhaps I can do a workaround by getting the ImmutableMap and just force add the new values through more reflection
@EventHandler
public void onChunkUnload(ChunkUnloadEvent e) {
if (e.getChunk().getWorld().getName().equals("test"))
e.getChunk().load();
}```
To go back on my own question from before: would this work to keep the chunk from unloading?
Just did what people wanted that didn't exist already
Don’t do that smh
about 3-4 days
declaration: package: org.bukkit.event.world, class: ChunkUnloadEvent
there is no e.getChunk function
That's weird because I didn't make that up, I'm on 1.15 not 1.16
???
im blind
Just use plugin tickets
JanTuck I don't knowwhat that is, and googling it didnt give me what you meant
Is it possible to make spigot server without any worlds and just send players custom packets?
Is it possible to make spigot server without any worlds and just send players custom packets?
@kind crow Theoritcally yes, technically would be quite hard to do
MyNameIsEarl people, including me, have been suggestign a few already ..
where?
In this chat ...
declaration: package: org.bukkit, interface: World
can you quote it?
Thank you @bold anchor
@kind crow Theoritcally yes, technically would be quite hard to do
@jaunty night I have plugins that work with chat, but I want to send custom packets about the world
sure
is that hard to google
It's much easier to deal with chat packets then send entire worlds through packets
I've seen servers generate temporary structers using packets
wyncraft being one example
but entire worlds is gonna be quite the technical feat
Anyone know if .schem files hold nbt & tile data or just block type and pos?
It's much easier to deal with chat packets then send entire worlds through packets
@jaunty night I already did that with javascript anmost from scratch, but I really need that spigot plugins, so I'm doing it in spigot
It's just empty world packets
What is your end goal here
like what are you planning to use this "no-world" spigot server for
As an auth server
Use void world and disable nether and end
2gb of ram is enough?
For what
server
why is this not working? ```import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin implements Listener{
public void onEnable() {
this.getServer().getPluginManager().registerEvents(this, this);
}
public void onMove(PlayerMoveEvent event) {
Player MovingP = event.getPlayer();
Location loc = MovingP.getPlayer().getLocation().clone().subtract(0, 1, 0);
Block blockOn = loc.getBlock();
String blockOnS = blockOn.toString();
MovingP.sendMessage(blockOnS);
}
}```
@bold anchor
Just to check:
I have a nested forloop, one iterating over an x value, and one over an y value, and for each x y value it would then call
stronghold.addPluginChunkTicket((x+x1), (z+z1), CiviliaFAQ.getInstance());
I alreay had the for loops for a different purpose, they only run once during the onEnable to initialise an enum, would this be good enough to keep the chunks of this area loaded?
its registering the plugin but doesnt send the message
Use void world and disable nether and end
@sturdy oar I actually want end skybox and that's what I'm currently using. But having no world would be better, because sometimes players stay in the world after logging in and can move around
its registering the plugin but doesnt send the message
@dusky sigil add @EventListener above the event
Rundik you can do a hacky workaround: generate void world with multiverse, you can choose the skybox (for example end or nether) and have a protected glass box or something where players cant get out
@mystic bluff I suggest using vps, it would be cheaper and you can customize more
for a beginner though
i just want a semi vanilla server lmao
buying a vps means you have to learn some sysadmin, security etc
theres a premium to mc hosts but i think its worth it for beginners
buying a vps means you have to learn some sysadmin, security etc
@marsh hawk he looks like typical sysadmin from his avatar 😆
its a tv show lmao
Rundik you can do a hacky workaround: generate void world with multiverse, you can choose the skybox (for example end or nether) and have a protected glass box or something where players cant get out
@karmic sable no that's not what I want. I want also to minimize the performance impact from this server
Rundik may I ask what the concept or context is? Seems rather shady :p
And. Ppl are in spectator mode there anyway
What does Bukkit.createInventory do with the owner passed as the first argument? I know that it doesn't need to be the actual InventoryHolder the inventory is opened for, and it can even be null. So what is its actual purpose?
Rundik may I ask what the concept or context is? Seems rather shady :p
@karmic sable just an auth server. I know it doesn't have much impact as it is, but I would sleep better knowing I optimized it the best I could 😆
should i pay annually or what
@mystic bluff better monthly in case you want to switch server or something
How you pay is up to you
Anyway the amount of ram required depends on how many plugins and players you're expecting
I switched hosting 3 times in two months so I wouldn't suggest paying annually
^ok
if I concat a ChatColor.DARK_BLUE (for example) to a ChatColor.RESET, the final text should be white, right?
yes
https://paste.helpch.at/atuvenetil
https://paste.helpch.at/zucuhetaza
https://paste.helpch.at/jezogoduba
Is something wrong here ?
Cause its not working (Minecraft 1.16.1)
Is there any way to hook up EssentialsX's AFK System to a world?
its basically just when you go afk you get sent to an afk room
so im doing this:new BukkitRunnable() { @Override public void run() { nowAir.setType(Material.AIR); } }.runTaskLater(this, 1);. Now, I switch from 1 to 30 and it makes 0 difference. It really feels the same, No more or less delay. Now, If i recall correctly, 20 ticks is a secend, so I shouldve felt this, but it isnt working!
??
what do you mean by ??
this new BukkitRunnable() { @Override public void run() { nowAir.setType(Material.AIR); } }.runTaskLater(this, 1); feels the same from this new BukkitRunnable() { @Override public void run() { nowAir.setType(Material.AIR); } }.runTaskLater(this, 30);
wait
am i looping it?
OHHH
i should break
There are multiple ways to handle this. Here are 2 that I can think of
- You can read ItemMeta such as the DisplayName and lore
- You can also use NMS to read raw NBT tags
@frigid ember ^
or rather return
If you want to add data it's ItemStack#setItemMeta and some NMS methods repectivly
Hey guys how do I make a custom itemstack?
So like an emerald with a custom name and the enchanted effect?
ItemStack#getItemMeta
ItemStack item = new ItemStack(Material.EMERALD)
ItemMeta itemMeta = item.getItemMeta()
ItemMeta.setDisplayName(”custom name”)
Then i think you can do like ItemMeta.enchanted == true or something
Can I use colour codes in the name?
yes
Yeah if you type ChatColor.translate something i don’t remember
Thanks a lot guys
Also after all that item.setItemMeta(ItemMeta)
How would one inject a custom entity into AttributeDefaults
I keep trying to replace AttributeDefaults.b using reflection but I keep getting an IllegalAccessException, I've already wrote code which modifies the fields modifiers to make it not final and I confirmed with a debugger that it worked and I honestly don't know what the f... is going on
The code I use works with other static final fields but not this one
and It's not a primitive type either, even if that was the case it would throw an IllegalArgumentException not a IllegalAccessException...
I'm honestly contemplating just writing a spigot fork just to expose AttributeDefaults.b and make it mutable so I don't have to put up with this bs
how do you make it possible to create notes
How can I kill all zombies in the nether but keep the ones from overworld?
for (Entity z : Bukkit.getWorld("nether").getEntities()) {
if (z instanceof Zombie) {
//kill code
}
}
or with command?
how do you make it possible to create notes
@quasi hornet Notes?
for (Entity z : Bukkit.getWorld("nether").getEntities()) {
if (z instanceof Zombie) {
//kill code
}
}
@rare prairie thanks, that would work
wrong server
or with command?
@rare prairie it would be better, but I don't think it's possible in 1.12
Does someone know how to generate a circle area that merges to the existing world? (screenshot)
why not
