#help-archived
1 messages Β· Page 45 of 1
either it is something in the config or it has to do with your startup arguments o.O
somewhere you have priority 0 specified
here ig?
https://prnt.sc/s64v1y
so i tryna change from premium server to crack server, i need a login server so i add it. before this i put lobby in it and it works fine tho
@whole niche yes, server auth must not be defined as a valid server
cracked mc is a no go
my friends doesn't have an id so..
not like mc costs all that much to get
instead of compromising your entire network by setting online mode to off, why not help your friend get an MC account π
yeah.. dem unmigrated accs going for less than 1$..
Hello
Guys i have a question
#Runner
if argument 1 is "Runner":
console command "/clear %player%"
give player a iron sword named "<red>Knight's Sword"
give player a diamond named "Gem of death"
equip player with all iron armor
set {%player%.class} to "runner"```
How to add speed to the kit ?
speed like potion?
Yes.
oh wait
But Infinite
i saved an chestinventory using this:
ItemStack[] chestinv = chestblock.getInventory().getContents();
and i am trying to get it back with
chestinv.setStorageContents((ItemStack[]) chestloot.get("loot.chest" + listnumber));
but this seems not to work
nope
i save a chestinventory with 1 command
and on an event set the chest inventory with that saved one
Could not pass event LightningStrikeEvent to Airdrop vBeta 0.9.2
java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Lorg.bukkit.inventory.ItemStack;
how do i fix that
Umm.
.toArray
Canβt just cast a list to array
#Runner
if argument 1 is "Runner":
console command "/clear %player%"
give player a iron sword named "<red>Knight's Sword"
give player a diamond named "Gem of death"
equip player with all iron armor
set {%player%.class} to "runner"```
How to add speed to the kit ?
Do you know Rik ?
eclipse suggested it me so I tried it @fleet crane
don't take suggestions for granted
??
probably should do it on wherever eclipse told you to
where do i add .toArray @fleet crane
okay
well i got it to work but im suppressing "unchecked"
and don't feel comfortable
@SuppressWarnings("unchecked")
List<ItemStack> theinv = (List<ItemStack>) chestloot.get("loot.chest" + listnumber);
ItemStack[] invarray = (ItemStack[]) theinv.toArray(new ItemStack[0]);
chestinv.setStorageContents(invarray);
ahm.. getInventory.getContents return an array
i need to convert "loot.chest" + listnumber" to an ItemStack[]
ItemStack[] chestinv = chestblock.getInventory().getContents();
yes..
it returns an array of the inventory
yes
lmao typing yes 2x got a warning π
once you do that you can simply loop
for(ItemStack itm : chestinv){ otherInventory.addItem(itm)}
this works if you dont care about order/slots
you can also get from the list the array but the proper way to do it is
List#toArray(new Element[sizeoflist]);
I think sizeOfList can even be ignored and set to 0?
hmm it may do the size by itself
which method should i use?
toArray(Arr[]) btw does the exact same you do
It also suppresses the unchecked warning
ah okay
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
if (a.length < size)
// Make a new array of a's runtime type, but my contents:
return (T[]) Arrays.copyOf(elementData, size, a.getClass());
System.arraycopy(elementData, 0, a, 0, size);
if (a.length > size)
a[size] = null;
return a;
}
do w/e you think fits,overall all methods will work
i would like to try yours
hmm you want to take a list of items from config?
yea i saved an chestinventory in the a yaml called chestloot.yml
and now i need to get that chestinventory and put it in a chest
do you also have a getinventory for config? or you only save the object itself?
show the code how ur saving it
1 sec
ItemStack[] chestinv = chestblock.getInventory().getContents();
this is how i get the inventory and then i do:
chestloot.set("loot.chest" + chestcount, chestinv);
Hi, is there any Event to detect (and possibly cancel) spectator dismount from an entity? I tried VehicleExitEvent, but as expected not every entity is a Vehicle...
technically its not set as passanger or a vehicle
the camera follows him
you could make a runnable cancelling any target
also this might do it @sacred wave https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerTeleportEvent.TeleportCause.html#SPECTATE
stellrow should i just leave it like this since it works or is this a bad behaving method
@SuppressWarnings("unchecked")
List<ItemStack> theinv = (List<ItemStack>) chestloot.get("loot.chest" + listnumber);
ItemStack[] invarray = (ItemStack[]) theinv.toArray(new ItemStack[0]);
chestinv.setStorageContents(invarray);
@vernal spruce I will try that, thank you!
@narrow crypt if you like it,leave it like this,you will eventually get better and find a better way
hmm okay
Question (again) sorry. I managed yesterday to get everything working as expected. all great. But now I stumbled upon the issue that I can't store like 1000+ block locations in the memory of the plugin
And yes it needs to be in the memory
Limit as in?
why not more than 1000+
How to send Json message (clickable) to players ?
(ping me fucking)
It's either the packets that are causing the issue ,or the data
So let me explain my use case
@frigid ember https://www.spigotmc.org/wiki/the-chat-component-api/
I got a class named "Zone"
for each zone I want users to be able to add as many points as they want (BorderPoint)
@frigid ember https://www.spigotmc.org/wiki/the-chat-component-api/
@vernal spruce Json :/
You can convert json for it..
@vernal spruce so it will detect mount itself (but it will not cancel it) but dismount is not detected this way... π¦
@sacred wave the spectator will always be teleport
But If I load the points that were placed before, that becomes alot, very fast
with bukkit api
because you cant do a perfect location on him,just call setTarget to null on the spectator when the teleport happens
@peak marten load the points before? arent every position set?
Yes that's not the problem. There is some kind of editor mode. And if I edit the zone, those border points become visible again
But it can up to a few thousand easily
@vernal spruce so there is no effective way to lock spectator to certain target except for constantly re-setting its target?
can a spectator switch targets?
@vernal spruce I want to prevent that...
switch to another target and dismount from target
well.. that runnable and setting target will do the job..
@vernal spruce ok, thank you!
how do i get the 5th element from data.loot
someone suggested
chestloot.get("loo.chest").get(5);
@sturdy lotus that is a crash report
Your swag plugin is doing dum shit
Your server crashed
but anyone?
@narrow crypt gonna need more jnfo than that
i have a yml file :
loot:
chest0:
items etc
chest1:
and i need the second item(chest1) without knowing the name
So i assume you have configuration section
Ur gonna use YamlConfiguration#getList::get(4)
@wanton delta how to fix it
Idk
It means your server crashed
I have no clue why
@narrow crypt
Thats fonna get the 4th chest
yea
Not the 2nd item right
yep
π
i still got some errors but im trying to figure it out
hi
hmm getlist(loot) gives null
System.out.println(chestloot.getList("loot")); tried to see but it gives me null @wanton delta
loot:
chest0:
it should give a list [chest0]
am i right?
System.out.println(chestloot.getConfigurationSection("loot").getKeys(false));
i can't put .get after it
but printing just the keys does give me the list
It returns a Set<String>
yea just found that out
mhmm why would this not trigger?
if(b.getLightLevel()>=15){
if its in the open sky during day
is b for block
yes
martoph, any idea how i should continiue to get the index?
i need to make it a list
Look up somthing on converting a set to a list
You mght be able to do
.stream().Collect(Collectors.toList());
@narrow crypt
That would return a list
Hello, I need some help with my runnable as it won't cancel thanks ```java
public void onStart(Player player) {
Runnable runnable = new Runnable() {
int time = checkTime(player);
@Override
public void run() {
if(time != 0) {
time--;
int hours = time / 3600;
int mins = (time % 3600) / 60;
int seconds = time % 60;
String timeTo = (hours > 0 ? hours + " Hours, " : "") + (mins > 0 ? + mins + " Mins " : "") + seconds + " seconds";
player.sendMessage(timeTo);
} else {
//stop runnable
//This works
Bukkit.getScheduler().cancelTask(TaskID);
}
}
};
TaskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, runnable, 0, 20);
}``` ```java
AutoMiner autoMiner = new AutoMiner(plugin);
Bukkit.getScheduler().cancelTask(autoMiner.TaskID);
player.sendMessage("ID:" + autoMiner.TaskID);```
do this.cancel?
the task id returns 0 everytime
also i never see you assign the task
to anything
Runnable runnable = new Runnable() {
TaskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, runnable, 0, 20);```
@crimson sandal You didn't fill out the CLA form correctly. You need to provide your full mailing address.
@wintry jasper I thought I did? What is wrong with it?
Its only a partial address. You need to fill the form out again.
Oh damn it, Chrome auto filled the line when I entered my phone number
oh I wonder if that what happens to the other people who do that. It happens pretty often that I will only get the one line. Its a legal agreement, so I can't take it like that.
I've just submitted a new one! π
Yeah maybe, I guess most forms separate out the address from city, country and postcode.
That's why chrome only stores the first line I guess
Ok James, you're all set.
@wintry jasper how do you know when it is reviewed & good to go?
do you get an email or something
if a PR was accepted, you are automatically notified by it being accepted. For other times, usually MD comments on the PR.
unless you mean the CLA
XD
yeah i meant the cla
In that case I am not entirely sure as I don't remember if I got an email or not
does getting it approved give me access to something? i can check that i guess
it's not been 24 hours yet, and i don't plan to immediately contribute anything anyway but i'm curious
getting approved gives you the ability to make PR's
i need help w/ Votifier's port and stuff
im using superbvote + votifier
i need help w/ it
Ok James, you're all set.
@wintry jasper Thank you! π
The port on server lists always just dont work
If u can help w/ that and maybe other problems ping me
quite a basic question but where do i put FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml")); in my main class so i can acces it
im confused cause i added it under here: public class Main extends JavaPlugin{ public static Main plugin; but then the plugin wont load
do you have an onEnable
yes
thats under : public class Main extends JavaPlugin{ public static Main plugin;
@runic wadi ?
did you initialize plugin to be non null
@rotund fulcrum which host are you using
yeah idk what youβre doing wrong
@hollow rivet self-host
on your PC
?
if you had to do port-forwarding for your server then you also have to do that for your votifier
hmm did setClickEvent changed from textcomponent?
quite a basic question where am i supposed to
public static Main plugin;
FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
@Override
public void onEnable() {```
its about the data file, where do i put it
cause now it gives an error that it can't load the plugin
@boreal tiger Why not go ahead with dependency injection?
yeah that would be better, but since he was using a singleton I suggested that
Right.
Setting enabled to on would help also π
Yes
@narrow crypt plugin is null when you're using it.
@hollow rivet where inside of the SuperbVote config does it say what reward to give when someone votes?
completely lookup over that
and how do i get a platform to hook up votes
so something responds
found rewards
βοΈ
i'm not sure idk much about superbvote
does anyone else know a good SuperbVote tutorial?
so i need to put it under plugin = this;
right @rigid nacelle
That initialization happens first. Just initialize it in your onEnable method.
What are you trying to accomplish anyways? You could define it in your onEnable and pass it through the classes constructors instead of using a singleton pattern.
i want to be able to use data trough out the whole main class
Right, so, just initialize it in your onEnable. Should be fine.
char[] msg = message.toCharArray();
int msgLength = msg.length;
int capitals = 0;
for (char c : msg){
if (Character.isUpperCase(c)){
capitals = capitals + 1;
}
}
int capitalPercent = (capitals/msgLength)*100;
I'm using this to calculate if the message is 25% capitalized, capitalPercent is always 0 unless 100% of the message is capital. Any help?
private final YamlConfiguration configuration = new YamlConfiguration(); then load it when necessary.
@narrow crypt
does anyone else know a good SuperbVote tutorial?
majority of people in here aren't going to be using tutorials for plugin configs tbh, your best way to learn would be reading the wiki that's linked on the superbvote page i'd think
just play around with it until it works
public class Main extends JavaPlugin{
public static Main plugin;
FileConfiguration data;
@Override
public void onEnable() {
plugin = this;
plugin.saveDefaultConfig();
data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
did i do it right @rigid nacelle ?
no i didnt
it kind of works
Hey when making a PR to both Bukkit and CraftBukkit how exactly do I link them together? Do I have to post them first and then can you edit the PR afterwards?
Yes. That's usually what I do. Or you can do some 300 IQ magic and look at the next PR number on the opposite repo and read the stash's mind
@ashen stirrup You probably want it the other way around for the percentage.
Oh okay
(ids are incremental so lol)
@narrow crypt
data = new YamlConfiguration();
data.loadConfiguration(blah)
I think that is what you want
its weird cause writing to the data.yml works but reading doesnt
It's just load fyi.
@subtle blade Ah okay I'll just post and edit then π
and you don't need to do Main.plugin.getDataFolder(), you just need to do getDataFolder();
Ye. Safer that way because otherwise there may have been a more recent declined PR you missed
@narrow crypt
data = new YamlConfiguration(); data.loadConfiguration(blah)
@dusty topaz loadConfiguration is a static method iirc.
will that work with 3 yml files in the plugin folder
So if it's a new instance of the class it's most likely just load(...).
yeah it's just load
I misremembered
https://www.spigotmc.org/wiki/config-files/ might be worth referencing this rik
@subtle blade wait what exactly is the syntax to link them? Or can you just post a link?
ill read that thanks
Yea just copying the link is fine
there are so many methods( i believe) that im getting confused xD
There might be a #number syntax or something but idk. Haven't messed around too much
Like if you do SPIGOT-1234 it will link that issue automatically
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/660/overview Sweet just made a PR, don't think I've missed anything have I?
@ashen stirrup Also, I think you could just do String#chars() which returns an IntStream, with that you could filter the uppercased characters and then return the amount by invoking Stream<T>#count().
,_space_1 π
oh and after getposotion too
and you really dont want to call getTileENtity.getWorld twice, assign that to a var
Wait where is there a space missing? lol
there is no easy way to get the open status, right?
And well that code is literally ripped directly from the TileEntityChest
That calls .getWorld twice
Yea but that's NMS π¦
see, you want to do better than mojang
π
and I bet it doesnt call getTileEntity twice
Alrighty... I'm sure this is a question that is asked waaaaay too much on here. But... How in the world do I get my Minecraft server to work?
Ah okay, I'll change that then
I had one made that was working, 5 year old messed it up, so I decided to delete it and make a new one. Did everything the same as I did before and now it wont let me join my server
World world = getTileEntity().getWorld();
world.playBlockAction(getPosition(), getHandle().getBlock(), 1, open ? 1 : 0);
world.applyPhysics(getPosition(), getHandle().getBlock());
Do you include a space after the var?
or a line break I mean
Create a variable for getHandle().getBlock() as well, but yea, I'd break between the two like you've done there
Not sure it really matters
One for getPosition() too
Basically, anything you use twice lol
Oh man 'org.bukkit.block.Block' is already used in this class
But it uses 'net.minecraft.server.Block'
Yea, you can inline specify the type
I know they just make the code look ugly af lmao
shame, it's neither
Wait what's the need in storing the getPosition() method... it literally references a variable itself? So it's no different calling getPosition() or assigning it to a var?
Yeah .getBlock() casts to Block as well so that makes sense
Oh man I just pushed a new commit and noticed IntelliJ automatically rearranged the imports
import net.minecraft.server.BlockChest;
import net.minecraft.server.Blocks;
import net.minecraft.server.ITileInventory;
import net.minecraft.server.TileEntityChest;
to
import net.minecraft.server.*;
i have auto imports on but have the asterisk turned off
import everything individually to get line count up :D
Should clarify. Just Bukkit & CB I have it off for
i have it off for all Β―_(γ)_/Β―
what happens if after setting it open a player opens and closes it?
It would close
But that should be the expected behaviour
Yeah
If you don't want it to close you just listen for the inventoryopen/close event
i imagine a big use case would be for stuff like hunger games, where it is open after being looted
but you would want it to close again if items remain in it (say a player desposits items), so i think it's the best way to have it π
that moment when u finnally fixed an bug but you dont now what u did....
Been there done that. π
Yep, also my plugin opens a remote inventory when you open a chest instead of the chests own inventory so it's perfect for that π
k boys most epic question,how th do i dismount a passanger
removing it from passangers list doesnt seem to do the job
do i force call the exit event?
public class Main extends JavaPlugin{
public static Main plugin;
public FileConfiguration data;
@Override
public void onEnable() {
plugin = this;
plugin.saveDefaultConfig();
data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
got it to work @rigid nacelle
problem was that the saving wasnt going right and i thought i didnt set up the file correctly
thanks :D
aham i see
@narrow crypt Glad you figured it out.
Welp im getting an npe calling it
p.getVehicle().eject(); on command
Question being can a player ride another player? π€
Sure
choco do you ever get account stolen reports? π€
i had a buyer today who had his account stolen and i could check it too
@subtle blade then why would i get a npe on this? rider.getVehicle().addPassenger(p);
@narrow crypt Also, you don't need to use plugin.saveDefaultConfig(). You are in the main class at that point and you could just use saveDefaultConfig() or this.saveDefaultConfig() which just means current instance.
savedefault config should be done after getting from config the values to generate the user config
You lost me at getting from the config. I would like to assume that the user wants to save the default config.yml resource? What's the point of getting if it doesn't exist?
I think I might've misunderstood what you meant.
@tiny dagger Feel like getting me on the same page as you? Because I am genuinely lost.
savedefaultconfig also creates a config for the user to be able to edit
All saveDefaultConfig() does is it invokes JavaPlugin#saveResource("config.yml", replace) if the file doesn't exist AFAIK.
yeah
@vernal spruce either the vehicle is null or the player is. I am going to assume it is the vehicle
Theyr both 2 valid players as im alrdy checking for null
does the world#spawn() method trigger a CreatureSpawnEvent in case of a creature?
@vernal spruce vehicle is possibly null
since you are using rider, it is possible for the rider to exit the vehicle in the time it takes to process the code to add a passenger to the vehicle the rider is on. Which would cause the vehicle to become null.
@rigid nacelle oh yea thats true, thank you
Hey guys!
Is there a way to.. see how many chunks and entities are loaded right now on my server?
Is there any command or something?
unknown command)
*paper.1.15.2
Hi there, I know this might be a bit retarded to ask but I really hope that some plugin magic might be able to help me out because I didnt figure out a vanilla way to this (and I cant use mods as this is supposed to be added into my spiggot server).
https://cdn.discordapp.com/attachments/385167853919141889/704002829991411802/2020-04-26_00.53.32.png
I retextured the snow texture to grass so I could have a smooth terrain.
as expected, it only displays the snow texture but I instead want the snow to mimic the block below it so that the terrain can be made out of whatever block I want (smooth beaches, smooth hills, smooth mountains... you get the idea)
Overlaying does exist in this game but it only works with the block next to it while I kinda need to invert this data. any ideas?
mb it was some plugin?
Coz I swear, console write me that it's unknown command)
? we do have layered grass
you can even add arguments so it displays correctly depending on the terrain youre in
where exactly?
1.15.2? I dont understand the question
there, layering works
if you wanted to, you could overlay the whole texture on top of another
are you sure thats not ur texturepack
/memory
@vernal spruce it's and Essentials command, lol
btw, thanks)
oh nice
I just need to find a way to trick the game into layering the block depended on the block underneath it and I hope that plugins might help me out with this because I cant find any options that allow me to do that otherwise
Can someone explain to me how I could use date place holders with PAPI
Like I want est time like this along with date
you know it means forcing players to use a specific texture pack wich they wont
they have to, you can disable that they can choose
and if they find a way arround it so be it i guess? then their whole map and game will look super weird
Guys, Do you know how I can fix it? https://timings.aikar.co/?id=241b5da3036f4e19ac80dba5467bbbeb
You probably want to look in to the amount of hoppers and armor stands
does anyone know the sound name for when a player shoots another player
the ding noise
entity.arrow.hit_player?
ill give it a try
I gave you what it's similar to
not what it is.
Dependent on the version will change the result ofc.
Infact, you gave the exact name of the sound enum.
Well, I mean a part from the uppercased letters and underscores. π
I was wondering if I could get a bit of help with a listener that I'm coding right now, I'm trying to cancel the consumption of any suspicious_stew however it doesnt seem to work the way im trying to do it, could any of you point me in the right direction?
public class ConsumptionListener implements Listener {
String prefix = ChatColor.GRAY.toString() + "[" + ChatColor.DARK_GRAY.toString() + "Qbit" + ChatColor.RED.toString() + "UHC" + ChatColor.GRAY.toString() + "] ";
@EventHandler
public void consumptionChange(PlayerItemConsumeEvent event) {
if(event.getItem().isSimilar(new ItemStack(Material.SUSPICIOUS_STEW))) {
event.setCancelled(true);
event.setItem(new ItemStack(Material.BOWL));
event.getPlayer().sendMessage(prefix + "Suspicious stews are disabled!");
}
}
}
Checking the type should be enough, huh? For example:
@EventHandler
void onConsume(final PlayerItemConsumeEvent event) {
final ItemStack itemStack = event.getItem();
if (itemStack.getType() != Material.SUSPICIOUS_STEW) return;
// type is SUSPICIOUS_STEW, do what you feel like
}
@quartz kernel
I feel like I'm doing something wrong on the condition
o
I was doing everything wrong jesus
It didn't meet your condition because they're two different objects.
I've got a lot to learn then
AFAIK, ItemStack#isSimilar is the same as Object#equals a part from isSimilar ignoring the amount.
Can someone explain to me how I could use date place holders with PAPI or MVDW
Like I want est time like this along with date
Also, @quartz kernel. There's a utility method in the class String called format. You can do quite a lot with it, it is very useful. In your case of prefix, it could look a bit nicer using it. For example:
private final String prefix = String.format(
"%s[%sSpigotMC%s]", GRAY, RED, GRAY
);
π
@median abyss With PAPI? Is there not a list of placeholder categories out there on (a) WIKI?
There is @rigid nacelle, struggling to use it π
There is %server_time_<format>%, not sure if that's what you're looking for?
<format> being a DecimalFormat pattern.
Tried this
Did you download the extension and reload PAPI?
/papi ecloud download Server to be exact.
Yeah downloaded
Is your scoreboard plugin supporting PlaceholderAPI at it's current state?
Infact, what scoreboard plugin are you running?
Yeah it is, Featherboard
It does not support PAPI directly AFAIK.
You'll have to use {placeholderapi_<placeholder>} IIRC.
Is there a MVDW placeholder for it?
What I sent should work.
I.e {placeholderapi_server_time_HH:mm:ss}.
@median abyss Got it to work?
Awesome thanks π
π
About how long does getting persistent data from a block take?
well it's found inside the block s data so i doubt its anything noticeable
Where is persistendatastorage saved (For example I create a item, grab it's itemstack. Add persistentdatastorage to it and give it back to the player) when server is stopped?
Does it have to load ALL of the "storages" of every single item that has it on server startup or is it only loaded if a online player actively has it in their inventory or if the item is in a loaded chunk? (or if I call for it otherwise for example messing about with a players dat file) I'm planning to store 42 bytes of data in the item and I'm trying to think a bit more future forward by considering what would happen if 1 million items were created. It's only 42 MB but it would be nice knowing if 42 mb has to be loaded into ram or not. Because eventually unless you start clearing items, 10 million items would be 420 mb and that would be 420 MB ram dedicated just to items.
in the itemmeta itself
Depends on where it was written
i think
Items are held in the player's inventory (player data), blocks are held in the world data, etc.
It's loaded just the same as all other NBT for that object
So it is as I described it? Only when a player is online OR if the chunk that has the item is loaded?
I was planning to follow this tut to get started: https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
i think its stored inside the item
is there a possibility, if you have an bungeecord server ( so different servers etc pp) to make them visible for just some players.
kiss
``
ItemStack itemStack = p.getInventory().getItemInMainHand();
NamespacedKey key = new NamespacedKey(mainclass, "waterbreathconfigurator");
ItemMeta metadata = itemStack.getItemMeta();
metadata.getPersistentDataContainer().set(key, PersistentDataType.INTEGER , Data);
itemStack.setItemMeta(metadata);
p.getInventory().setItemInMainHand(itemStack);
``
Seems to make sense. Thanks for the help guys.
tr
Hello
I'm trying to use this :
I paste all the custom event in a class
Then I write an @EventHandler with just event.getPlayer().sendMessage(Integer.toString(event.getPlayer().getName()));
But nothin appear
Is it a new spigot version? I'm getting a outdated-message now (came yesterday or something). Can't see a new version on the website.
@analog roost How come you invoke Integer.toString(Player#getName)?
It's not rly this x)
Huh?
@EventHandler
public void onVillagerTradeEvent(VillagerTradeListener.VillagerTradeEvent event){
event.getPlayer().sendMessage(event.getPlayer().getName());
}```
This π
When adding a potioneffect to an entity how do I make the duration unending?
@analog roost How come you invoke
Integer.toString(Player#getName)?
@rigid nacelle I change the code π
I'm trying to make an invis armor stand but do I need to add a potion effect to make it invis or not?
you can just setVisible() on the armor stand
^ ArmorStand#setVisible(bool)
Anyone interested in helping make a MineZ plugin
help me !!!
on my server were players left without permission for anything? what to do?
What? Can you elaborate a bit more on that?
hello, I need some help with the simple portals plugin. I have it on my server, but my friends say they do not have permission to use any of the portals. I don't know what I am typing wrong for the command to work. Please and thank you.
my friends on the server were left without permission for anything
use a permissions plugin such as Luckperms to give them permissions
@golden vault yes I already downloaded this, how do I configure it?
@strange geyser What permissions have you given them?
@golden vault ?
make groups, put the permissions you want in the groups then assign the groups to the players, you will need to look at their wiki for specifics
@rigid nacelle I didn't give them any permissions nor did I take any permissions from them. I thought you were suppose to add in a command on the portal to allow them to use it
@strange geyser Exactly what plugin are you using? According to the first SimplePortals that I found, they need to have the permission simpleportals.portal.<portalname> or the wildcard (simpleportals.portal.*) in order to use them.
PS: Resource on Spigot.
How do I make a plugin compatable with multiple versions of Minecraft
@rigid nacelle See I tried typing in the command for that, but they say they still get this error message that they do not have permission. I'm trying to figure out what I'm typing wrong, or are they suppose to type it?
I'm not really sure what plugin it is, so I can't really help without any knowledge.
Could you provide me with the resource? @strange geyser
Thank you. I'm not really sure if you're allowed to send links in here. Just to make sure, delete the message.
ah I'm so sorry
That's not worries, I asked you to send the resource. That is my fault.
But yes, as I said before, simpleportals.portal.* - Allows the player to use all portals..
Thank you so much for helping me.
Hmm, I guess I'm just typing the command wrong?
What command are you executing?
/simpleportals addcmd <player name> simpleportals.portal.*
The thing is, the third argument, in your case simpleportals.portal.* is wrong.. What you're doing is adding a command to whenever a player enters the specific portal.
If I have a player then how do I get the location 0.5 blocks to their left? I can't use Location#subtract because that uses the X Y Z cords and a player might be standing diagonal or just looking in another direction
Ah, gosh. What.
You need to create a portal before actually adding a command to it. So steps for example:
/simpleportals create <portal name>NOTE: You must select a region before executing this command, keep that in mind./simpleportals addcmd <portal name> <command>
@strange geyser
Oh, gosh ok. I'm very stupid. Thank you so much for this and have a very nice day. π
@rigid nacelle
How would you code an async mysql database lookup with a bungeecord plugin?
I've got the lookup part working, just need to convert it to async.
The scheduler API perhaps?
TaskScheduler#runAsync(owner, task) should most likely do it. A part from that you could have a look at ExecutorService.
@late tangle
An enchanting table's data extends tilestate right?
I don't think it does. It's not a tile entity afaik
Oh. Apparently it is... https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/EnchantingTable.html
yes, it does
TIL enchantment tables can have custom names... for some reason
Choco loco.
lucky perms did not work i imported groups but still could not get it to work... i am used to doing permission nodes manually and am used to group manager format i did find an updated group manager i would recommend: https://www.spigotmc.org/resources/groupmanager-1-7-1-15.40615/ my issue was it saying there is a newer update but learned i can just disable it in language but removing the text from update message i just left the coding format and nothing else. wanted to say that i have fixed my issue from last night
thank you all who helped me
@rigid nacelle Thank you. Works perfectly.
Glad to hear it.
My resouce is still under review, I would like to update it though. Is that possible?
no
There is no such thing as a maintained version of GM
ngl, I tried forking GM as I was using it for my own stuff because that's what the owner was familiar with and not 100% convinced about LP yet, the codebase is so terribad that large parts just literally need rewriting to go anywhere with it, I seriously doubt that anybody is actually looking after GM in the way that it would require
why none of these methods work? ridee.eject();
ridee.leaveVehicle();
p.removePassenger(ridee);
none of them seem to dismount the rider
nvm fixed
How can I "rotate" a vector?
I got a vector like this
β
I need to get it like this
β¬
rotate your screen 45 degrees
._.
Question, is registering/deregistering listeners expensive or lightweight?
Vector#rotate(), Skrump
Wa
Well, not #rotate(), but there are rotation methods
Registering, sort of. It uses reflection to find methods with the event handler annotation, james
Removal, don't think so. Registered listeners are in hash maps
O(1) afaik
Okay, cool
What sort of rotation methods are there?
I thought maybe get the crossproduct from a vector like this β
But idk how to get a vector like this β
wdym like this ->
in PathFinderGoalSelector#a() what's the first argument for?
is it the priority?
afaik yes
oh right cool π can multiple goals have the same priority?
Yes
oh right cool π thank you π
you should look into minecraft remapped source code tbh :d
yeah I found it but I wasnt sure about the multiple goals with the same priority thingy xD
I got the vector rotation thing
it's so useful the minimap thing
k boys how do i do this better?
messages.put("noplayerfound", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.noPlayerFound")));
messages.put("sentrequest", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.sentRequest")));
messages.put("cantcarryself", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.cantCarrySelf")));
messages.put("notcloseenough", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.notCloseEnough")));
messages.put("playerleftoraway", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.playerLeftOrAway")));
messages.put("alreadyinvited", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.alreadyInvited")));
}```
public HashMap<String,String> messages = new HashMap<>();
you want an enum or a list of constants
so you dont have to reference messages by hand
My bungeecord Network stopped working!! What do I do?
No like the commands (/server) dont work anymore
Hi, does anyone know how to reset Advancement progress for a player (or at least for everyone) as would /advancement revoke <player> everything command do via the api? I could call the command, I am just wondering if there is a cleaner solution... Also is there a way to catch actual completion of advancemets and get their names? I know there is AdvancementDone event, but it spills to much information and I did not find effective way to filter out only the advancements (and not recipes etc..)
AdvancementDoneEvent is probably the only way you'll get that
You can get the key of the advancement with #getKey
mhm what would be the best way of preventing entities from leaving an area?
I thought about using a runnable every 3-5 seconds to reduce the load a bit instead of checking every second or tick.
Is there a better way of doing this?
pretty sure aikar explained this the other day
saying it's not possible to do cleanly
@dusty topaz Thank you for answer, and can I somehow detect whether it is Advancement or Recipe unluck except by doing some Set of expected keys?
ah right
@boreal tiger you could alternatively set pathfinding goals I guess
mhm
I'd have to make a custom one I think that checked if the distance is too big
from the center
@sacred wave I'm unsure, not too familiar with Advancements (didn't even know it got called for recipes)
does #getCriteria spit out anything useful in identifying?
@dusty topaz I will try that, but I am sure key itself is totally useless... :/
key will give you a unique identifier for each advancement
so you could always filter by key
wait entities cant cross world borders π
@dusty topaz Yea, that is clear, unfortunately minecraft has tons of Advancements which are updated regurarly, and having a set of them is not really good solution imho...
that is fair, check the output of criteria
and @sacred wave to reset, it looks like you have to
player.getAdvancementProgress(advancement).revokeCriteria(advancement.getCriteria());
You would have to foreach those, but yea, that's the way to do it
ah yeah
AdvancementProgress progress = player.getAdvancementProgress(advancement);
progress.getAwardedCriteria().forEach(progress::revokeCriteria);```
not doing it on one line isn't cool
Progress is used more than once
my brain imagined it like:
criteria.forEach(c-> player.getAProgress(adv).revoke(c));
despite that being worse
Β―_(γ)_/Β―
@subtle blade btw is there a way to see inside caffebabe? Kapp π€
Dude, that's creepy
didnt sound sexual at all
whaaaaaa
yeah, either that or you just use JDA docs
it's pretty much the same, you just have to be careful to run things async
@dusty topaz Criteria are even more useless... π
but JDA makes that easy
this whole log contains only one Advancement π
nice
Then unfortunately it looks like you're stuck to keys lol
unless there is something I do not know about
which is probable
@subtle blade thank you, I will try that, too bad there is not simple way
This is how vanilla does it too
it seems pretty straightforward to me
@subtle blade @dusty topaz I know, but I hate to reinvent the wheel π
But this is the wheel π
What do the keys look like for the advancements?
Don't believe they're all prefixed with advancement_
Just wanting to see what they look like to see if there is anyway to filter them
What's wrong with AdvancementDoneEvent again?
@subtle blade I need ideally detect "Stone Age" advancement... and not the other stuff
wat. Are recipes filtered through AdvancementDoneEvent?
Or am I misunderstanding what you're showing us lol
Is it possible to intercept everything sent through the bukkit logger?
That is what is happening I believe
awww feels bad man no list of keys https://hub.spigotmc.org/javadocs/spigot/constant-values.html#org.bukkit.NamespacedKey.MINECRAFT
Which surprised me
@EventHandler public void aaa(PlayerAdvancementDoneEvent e) { Bukkit.getLogger().info(e.getAdvancement().getKey().toString()); }
Just check if the key is:
story:mine_stone
Yea... that's a bug. Because I PR'd https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerRecipeDiscoverEvent.html a while ago
Recipes shouldn't be considered advancements
@subtle blade ah, that seems logical... I thought it is feature, so I did not report that π
If you're on the latest version, I would report that
Doesn't seem intentional to me
?jira
aw come on
THANK YOU
Yea you're a little behind
~8 versions
Though you should be fine to report it. No commits to have addressed that
@subtle blade is there such a thing as food eating progress?
or its handled client side
Want to say that's client-sided
hmm k
@subtle blade I update only when spigot starts bugging me with 20 secs update notification π
I update only when spigot starts bugging me with 20 secs update notification
why is this so relatable
noice
π
well time to lay in bed
hey what is the best-practise way to store an ItemStack with custom NBT on it to a database?
sql or config?
SQL database
if its config,itemstack is serializable meaning you can simply call setItemStack
in that case not your man..
I read that serialize removeed NBT data online, is that still true because it also seems to be what everyone is doing
how is that hacky?
well
that sounds great
I use NMS methods
but how do you get the blob haha
rip compatibility π
to convert NBT data into byte[]
so yeah
rip compatibility
you can use something like ProcotolLib or PowerNBT (idk if its updated)
as 3rd party library
instead of NMS
or write your own serializer using Bukkit API
writing my own serializer sounds like more effort than the rest of the project in its entirely so that's definitely not the way to go
ProtocolLib has support for ItemStack serialization?
I remember ProtocolLib having API for working with NMS stuff
i have a general dev question, not exactly related to spigot & bungeecord - am i okay to ask this in here? if not dw
means you can serialize it on "low level" instead of going through every possible extension interface for ItemMeta
minecraft items is a perfect example of OOP being used where it is not appropriate lol
@inland meteor just ask lol
it was made so people won't break stuff
because in old minecraft versions corrupted NBT data would just crash the client
and for tile entities that meant that any client loading chunk with it would crash the client
how does OOP help against crashes?
I would have imagined a component based approach would be much easier to work with
(and more moddable, which is of course interesting for us)
is it possible to force people into using optifine?
as far as I know you can force mods but optifine requires installation so im not sure
why would you want to do that
Hello, i'm trying to check if player can hold (Has enough space) to hold my item stack
I found this java final Map<Integer, ItemStack> map = event.getWhoClicked().getInventory().addItem(recipe.getResult()); // Attempt to add in inventory if (map.isEmpty()) {} // If not empty, it means the player's inventory is full.
But this add items to the inventory
And I just want check without add
There is no clean way that I know of to check if a player can hold an item (say it's full of 1 wood block in each slot, to check that he could pickup a wooden block but not a piece of redstone)
however, if you're not too bothered about that, Inventory#firstEmpty does that you need
mhm, is it necessary to use nms to allow a zombie to break doors?
Zombies can break doors anyway?
You can change vanilla behaviour(hardmode)
In hardmode they can
Zombir have a 5% to go for doors
You might be able to force target the player wich in theory should allow the zombie to go for the door
mhm
Basically spam the zombies with settarget till it doesnt lose player
I think you have to use NMS
yeah
private final PathfinderGoalBreakDoor bA; in EntityZombie
Or nms..
yep
With a Bungeecord command, how would you allow tab completion, so I only have to type part of the command? Like /Di and then tab, and it would change it to /Discord.
why does everyone suddenly care about tab completion o.O
It's fancy
Hey, I'm kind of new to world generation and I was wondering where can I see how the vanilla world generator is coded?
Or something that can help me get an idea of how is the correct way of handling terrain generation.
The vanilla generator is tens of thousands of lines of code
isn't another game was maded with codes of alpa versions of vanilla generator π
And spread out among numerous classes as well lol. I still remember your sufferings a few major versions ago
I have a quick question, and the answer is probably fairly obvious - but I've only ever dipped my pinky toe in the world of networked servers using Bungee.
How would I totally prevent UUID spoofing - without using AuthMe type plugins?
Using online mode, preferably
Right, so would I force the hosts then in order for the servers to be bungeed?
Or, rather, on bungee you would route it through the proxy
I guess I'm a little confused - like I said, I've hardly ever used bungee.
Bungee acts kind of like its own authentication
The servers have to run offline in order to be added to the 'bungee' config? no?
So then the proxy running in online mode would prevent that/
Yes
so you say make bungee offline, make backens online? Or I got it wrong? choco
no
bungee online, other servers offline
Whats the easiest way then to force clients through proxy, and disallow connections directly to the bungeed servers?
I have made a util for my projects. In this util some class has chain methods. And they are very useful for my some projects.
So, I want to use them like "LeaterUtil.chain(stuff)...."
And, abs dont want to do it with an instance of this class.
Everything goes good, until one of my project uses older libraries than others. So some part of some class's (includes the class which has chain methods) need to be different a bit.
Then my issue starts here. How can I make this?
I cant do it with abstract classes cus I dont want have an instace of classes which has chain methods. And dont want something like this
public static void run() {
xxxInstance.run()
}
}
``` because some class has really much method and dont want to add them and this can break my some chains.
@analog roost I have a method which checks if there is enough space in the inventory, if there is not it just drops the item on the ground at the player's location
if you want it you can have it :)
actually, addItem returns the items which cant fit inventory
so, addItem(items...).foreach((key,value) -> World#dropItem(Location, value)) something like will help
and you can set dropped item's velocity to 0 to make that will drop yo the center of location
Sorry if this is a stupid question... super novice dad that's been running a server for my kids and their friends for about a year now with no real issues... just went to spin up a new server, downloaded and compiled the latest build tools, but now every single time I launch the server, it rebuilds a new world. I assume I missed a change somewhere in the last few months. Can anyone tell me what I'm doing wrong?
@safe mesa check server.properties
ok
@vital willowno have idea
maybe the issue of latest build
and why are you building from build tools?
if you dont need source codes theres sites you can simply download
Are you sure it's rebuilding a new world? Like log off, restart, and log back in the world is completely different?
@fair abyss You should build yourself instead of trusting 3rd party sites.
and why are you building from build tools?
if you dont need source codes theres sites you can simply download
No
Do not ever download Spigot from anywhere
BuildTools is the only legal method of obtaining the modded server jar
@upper hearth Yep... I launched the server.. logged in... looked around... Shut the server down... restarted it. Logged back in, different world. Noted the spawn coordinates.
Tried it again... same thing... tried warping tot he spwn thinking ok maybe it was same world just different spawn.. but nope...
What plugins are you running?
I was gonna ask that >:l
The default server setup shouldn't be doing that
none... I literally started this from scratch tonight. Started with nothing but spigot-1.15.2.jar and my start.bat in the folder... launched once and then edited the eula. on every restart since, i get a new world
Is a new world being generated every time? What's your server.properties look like? That's strange
?paste your properties here:
(Ctrl + S to save, send the link back here)
I don't know what it would be doing with the old world file
I never edited anything... I don't remember editing anything when I started a new server previously... https://paste.md-5.net/pexawukozu.bash
Is a new world being generated every time?
As in, do you have any worlds other than "world"?
(_nether & _the_end excluded - consider those just one world)
I only have 'world' 'world_nether' 'world_the_end' folders.. and it appears to regenerate those every time I launch
Want to send a paste (same link above) of your latest and second latest log files?
I'm genuinely confused lol
sure! thanks so much for taking a look! I appreciate it!
What's your start.bat? I wonder if it's deleting the world files before the server starts? Literally no clue
oh... this last time... I ran save-all and now I go back into the same world when I log in... but if I place anything and then restart the things i just placed are gone...
Latest Log: https://paste.md-5.net/pezudizike.md
My start.bat is just: java -Xmx4G -Xms4G -jar spigot-1.15.2.jar nogui
did you stop the server via command or just clicked x icon?
i am literally not fancy
have you ever write stop to the console?
I did just click 'X'
dont do that again
That may be why
use the stop command
Surprised the server didn't yell at you while starting though π€
I can't imagine it would generate an entire new world because he clicked X
on windows especially if using the x on the window, it sends the kill process and doesn't give the server a chance to stop properly
I think it would because nothing gets saved, Dessie
You'd have seen world save progress at the end of the log
should bukkit's autosave save the world every 10 minutes
Yeah that's why it would make sense that his blocks placed aren't there, but does the entire world not save after it's been generated?
maybe its disabled?
So Barahir, when stopping your server, run /stop (or just stop when from the console, no need for a /). Think beyond that you're all good to go
Reason it's regenerating is because world data was not yet written to disk
Guess that makes sense
I kind of thought X-ing out might be why.. but i swear I've done this before and not had an issue. Like when I first started, creating a world, logging in.. and then logged right back out, closed the server adjusted the RAM in the bat, and restarted just fine...
but i could be wrong on that
like there was at least and initial auto save once the world created... but... that def doesn't seemt o be happening right now...
If that's the case, it may have saved at some point during run time. Though they've made a few performance improvements since then, this may be one of them
The stop command will ensure the server completes is shutdown processes
I'll buy that... so... 'stop' command.. or at the very least.. wait 5 mins yea?
Always use stop command
Lol at the very least, yea. Though it's best to use /stop. Plugins will disable properly, server will disable properly, etc.
Doesn't X-ing out cause the the world to get corrupted sometimes?

wtf I thought you knew everything
yeah.. i definitely don't want corruption.. I had a server we worked on for a few years that I stupidly didn't back up, corrupt when I tried to jump a few versions when i updated... it was a sad day. i don't want to go through that again.
I am all knowing... with the exception of whether or not worlds will corrupt with you x-it out of the console window
I lack knowledge in very specific areas
Tis a reasonable thing not to know
I thought I heard that I has the possibility to corrupt, but what do I know
always x on my local server haven't ever corrupted lol
Lol, well I think that should fix your world issue, Barahir. Good luck with the server though π
?resources to browse plugins you can use on the server
well thank you guys so much! I really appreciate talking this through!
I really need help with my servers tps issues
I've tried optimizastion files, chaning mob stacker, changing mob stacker size, testing plugins i just idk
You're on a fork. Not our problem
What's a fork?
Not Spigot lol
wait what
Paperspigot ?
Not us
Oh damn lol
(and is the reason they changed their name to just Paper)
I've had 6 years of experience and never knew that
I just assumed it was a diff ver
They have their own support Discord, though I don't have the URL on hand. I'm sure you can find it quickly on Google
Having a looooot of players being kicked for a "broken pipe" error from our servers to our hubs. We have no idea why and it's just randomly started happening after no changes. Any ideas?
I made a pickaxe tool to mine in a 3x3x1 area, I used rotation to check which direction a player is facing and Blockface, the rotation works fine, and the 3x3x1 break does but only when I'm looking down, if I look up or in front of me, the blocks that are below my feet break in 3x3x1, but I want the target block that I'm breaking to break, can someone help me?
here's what I mean, it's breaking below my feet instead of breaking around the block that I broke in front of me.
Just do something like Math.round(yaw / 45.0))) to get the direction. That'll probably work well
Could you explain where in my code?
I'm using triple for loops to break the blocks in 3x3x1
What is "block"
Block block = player.getLocation().getBlock();
How can I turn ItemStack(Material.SKULL_ITEM); into a Wither skull?
Pretty sure it's just a data id, no? At least for 1.8 it was
I believe both are deprecated
BigBadDuck you're removing the blocks below their feet by doing y = -1
Ah, right, so how would I fix it so that no matter which direction the player is facing it always breaks in a 3x3x1.
example?
Maybe just Set<Mateiral> now actually
player.getTargetBlock((Set<Material>) null, range)
Do that
Or better yet
Why don't you just do this on the interact event?
When they click a block
Then do that loop on the clicked block
I have it on the block break event
so you mean to do the for loop seperate on the blockinteractevent?
Whaaat? Then why you doing Block block = player.getLocation().getBlock();?
Why not just use the Block provided by the event?
Destroy all the blocks around the destroyed
so Block block = e.getBlock()?
I'm trying to break the blocks around the targetted block so that it creates a 3x3x1
Yup perfect
so no need for Block block = player.getTargetBlock?
No I just said that because I was confused as to what your intention was
Then you just wanna do something like this:
for (int x3 = x; x3 <= x2; x3++) {
for (int y3 = y; y3 <= y2; y3++) {
for (int z3 = z; z3 <= z2; z3++) {
Block b = world.getBlockAt(x3, y3, z3);
}
}
}
}
To loop in a square
x = min, x= max
So
x = (initialBlock.getX()) - radius;
x2 = (initialBlock.getX()) + radius;
Creates a box around it basically
x = (initialBlock.getX()) - radius;
x2 = (initialBlock.getX()) + radius;
Or just do what you're currently doing in the loop. I just prefer to do a more direct approach
It's an option. The one you're doing should work too
Okay thank you, I'll try it and see
for (int y3 = y; y3 <= y2; y3++) {
for (int z3 = z; z3 <= z2; z3++) {``` doing this gives me an error
in the IDEA itself
Do the x, x2, z2, z, y, y2 variables all exit?
Those need to exist. They're your axis aligned box's bounds basically
int y = block.getY(); yep so doing this basically
What do you suggest my radius to be
The size you want this box to be
so 5 would be: 5 to the left, 5 to the right, 5 below, 5 up, 5 forward, 5 behind
Or you could just stick to what you were doing. Same idea basically
so since its 3x3x1 my y would be 1 my x would be 3 and z would also be 3
but it will be different according to direction
It's suppose to grow in a certain direction?
If that's the case
then just do what you've got atm, but change
block to
no I meant it's dependent on my rotation
block = event.getBlock().getRelative(blockFace)
because without rotation it will just break 3x3x1 in one direction, I tried it before
Ah okay I see
there is no docs?
Like when I wanna find documentation, I'll just google "Spigot Block" for instance
To find Block's documentation
wow, thanks got all of em π
Np
is that possible to run aternos server in local environment?
Isn't that a host...?

