#help-archived
1 messages Β· Page 9 of 1
com.voidcitymc.OtherPlugin.Main
if you stick to naming them in their own packages then you shouldnt have anymore issues at all
If we followed proper naming conventions it would be
com.voidcitymc.police.Main
and
com.voidcitymc.otherplugin.Main
^
Imagine uppercase packages
π€·ββοΈ
There's like 1 million other bins
I have GitHub, havent pushed it yet.
Lol.
But I also just dont feel like sharing my project yet
Okay I'll check out your current code
It's nothing special.
Just to save other people time.
Like, if they want to sort their objects into pages like for commands
I mean certain things could be better but good work
params lowercase though
Name conventions is important
They were lowercase before, I actually uppercased them for other reasons.
I'll probably change it.
Hello, to make a server selector when I need to use the bungeecord api or not?
The only reason I even bothered to make the class, was because I added the functionality into a command
and then earlier I was like im a fucking dumbass, I should have just made it into its own class
Yeah
@naive goblet, how would you send people to the server then
btw @naive goblet I started learning Java a few years ago and then I stopped for a few years, so if you got any pointers feel free.
besides the naming conventions
I have some but we'll take it when you use a proper bin :]
π
I basically have a command that is just for testing for now, but on command execution an armor stand spawns, I'm trying to make it follow the player after they execute the command.
First youβd need to track PlayerMoveEvent
Then maybe teleport the armor stand ?
With no gravity?
hey guys
Hey
i need a little help
i buy a plugin called BannerBoard but i didn't receive the key for the renderskin function... any idea about it?
idk anything about a key
Contact the developer of the plugin for help in a private message.
We can't help you with something we don't manage.
also do try avoiding asking for support in the review section
theres plenty of other ways
may i ask tho
how does one use the lore thing again
meta.setLore("what to put here?");
keep getting an error
im big brain rn
You put a List<String>
List<String> lore = new ArrayList();
lore.add("Line1");
lore.add("line2");
lore.add("line3");
lol
Anyone can help me set up my server lol
sure
spigot
I do maven but idk
Follow the instructions on how to use BuildTools, it will compile the Spigot server for you.
yes
Follow the instructions on how to use BuildTools, it will compile the Spigot server for you.
@dusky herald Thats what i meant
guys, anyone know how I can use the setVelocity() to have an armorstand follow a player?
it decompiled craftbukkit,bukkit,spigot,and maven
use Spigot
Go to Spigot -> Spigot-Server -> Target
then use spigot-1.15.2-R0.1-SNAPSHOT as your server
You could drag it to a specific folder somewhere else on your PC
you guys know?
and run it off of a bat
@median wing I don't know anything about the armorstand, or even if its an entity...I could maybe figure out a way?
Armorstands are considered entities, and yes please, if you could it would be appreciated
thanks bro
@median wing Velocity is a Vector-type class, you can construct using Vector(double x, double y, doublez) (or even float and int)
i.e. Vector aSMove = new Vector(x, y, z)
armorStand.setVelocity(aSMove);
You can read this to figure out how to calculate your Vector, and how to make it move towards your Player
So you can probably get figure out how much to calculate the vector for the ArmorStand to move, like if it's following the Player
by creating a vector, and using the difference between the distance of the ArmorStand and Player to figure out what your X,Y,Zs need to be
How would I structure multiple animations in an oop friendly way?
and then instead of putting it on a PlayerMoveEvent, you could probably create a Runnable to make your mobs move with your players
because a PlayerMoveEvent would more than likely trigger too frequently.
As far as helping you step by step, I probably cant because that'll take me too much time, lmao.
Just remember the vector is relative to the current position of the Entity
So it's not coordinates, it's rather just the distance you want the Entity to move.
if(sender instanceof Player) {
Player p = (Player) sender;
Inventory inv = Bukkit.createInventory(null, 9, "Weapond of mass destruction: ");
ItemStack gs = new ItemStack(Material.GOLD_SPADE);
ItemMeta meta = gs.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "Claiming Spade");
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.GRAY + "Worse than what both the Americans and Soviets had!");
gs.setDurability((short) 0);
gs.setItemMeta(meta);
inv.setItem(4, gs);
p.openInventory(inv);
that worked well
now i am new
i knew that.
i mean
can someone try connect to my server
i knew that
thx tho appreciate it
@gusty crane it works though right?
i mean honestly i belive this is going way down ive got no idea on how to make this work for bungee but
not getting any errors
You just gotta be creative π
Part of the challenge of developing is figuring out ways to make it work.
there isnt any extra modifications i gotta do tho to make it work for bungeecord
tho is it
hope not
I really don't have an answer for that. What you did should work, but as far as working with BungeeCord; I have no idea. I've never worked with it before.
Trial and error is your best bet. If you haven't really worked with Java much then you should read tutorials online to teach you the basics.
and then read the API Docs for Spigot and BungeeCord and that should help you learn how to apply them to your plugin.
ive worked with python and headaches due to my server doing the impossible
and with little to no sleep this will work by the sheer amount of hope
its not really that advanced its just like u do a command get a gui get a spade and lifes great
ik im good at explaining
yes listen to that man
Hey does anyone know about a plugin that allows for an item economy, but players cannot craft the items themselves? Like some sort of paper with an NBT tag or something?
yes covid 19 plugin
@potent creek https://www.spigotmc.org/resources/vouchers.53220/
works on 1.15.2 and all as far as im aware
@gusty crane Do you use it yourself?
@gusty crane and it works as an economy plugin with vault etc?
works like it
u do the command u get the paper with a very readable name and if u click it it gives u the money
but depends what u mean as an economy plugin
like you right click the paper and it gives you money into your bank account?
yes
ohh that's not what we're looking for - I really meant like an item economy
like how server use gold ingots as a currency, but instead of gold ingots some item that cannot be forged
(otherwise you get mad deflation)
maybe it's me but compared to the old days it has become somewhat harder to find plugins
there is most likely a plugin out there doing it if not one coulda always make one
i can agree in that
ish
hey i'm using protocollib to change the name of an entity via packet
u could prob do some cheap programming so to say tho
yeah getting used to the spigot api now with a couple of customs but I like to avoid re-inventing the wheel
watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(MetaIndex.ENTITY_CUSTOM_NAME.getIndex(), Registry.getChatComponentSerializer()), new ChatComponentText(lineOfText)); is what i got so far, but doesn't seem to work. I can modify values like visibility and boundingbox fine, but the custom name doesn't show.
How can I spawn ender crystals, the same as a normal entity?
hey guys
I need help finding a plugin
that I completely forgot the name of
basically it allowed the players to levelup through a gui with money, it also had the ability to give certain rewards for each level of the rankup (ex. one carrot for ranking up to level 2, four diamonds for ranking up to level 3 etc) Does anyone know the name of the plugin?
I'm pretty sure it was Level(something) I could be wrong though
and I remember that the levels you could redeem had a minecart with chest as the item
levels that you didn't unlock yet had a minecart I believe
hey @fleet crane is there a reason i get access denied on my ipv4 ip when going to this site? one of the plugins i use tries to go there and it causes issues. https://www.spigotmc.org/api/general.php
having an issue with discord, wont let me post. Seems a file name kicks off a warning
First time installing Spigot. Followed the wiki. Ran BuildTools no problem, created build files. Got an error with the start up scrip. The spigot file name with the jar extension has the version in it. Seems like it shouldn't.
that API has been removed a long time ago
the jar name has the version in it
change your script or rename the jar
ok, thanks
Hello, how can I set custom player head textures?
its not mine its this resource: https://www.spigotmc.org/resources/scoreboard.14754/
doesnt change my answer
Should be easy to change
Im messaging the author to see if he can change it as a quick fix im going to build my own version without checking for the api
It can be fixed easily, I just forgot the link
https://api.spigotmc.org/legacy/update.php?resource=
there's the link
The method should also be get now
okay
yeah
the resource id is 14754
any idea why i cannot use tp while i do have the node minecraft,command,tp
replace , with .
operator error
Your name is familiar johncsuti
yours too hmm
is anybody here good with bedwars rel
what server were we in?? @unique hamlet
nope
Hmm,
@quick arch its under Session.java
yeah
looks like most of the code is already there
lol
@fleet crane That was it, thanks again. Working on installing EssentialsX (and Vault)
rip, he forgot to provide the dependencies
lol
any further info on my question ? would really like to be able to tp without being op
use a permissions plugin that works
could it be the permissions plugin tho ill try another one but seems unlikely
yes use lp its the best one around some permission plugins i have tried dont work well with some things permissionsex
thanks
Time to fork it and make a pr
are we able to specify an api version? [22:48:07 WARN]: Legacy plugin Scoreboard-revision vR3 1.4.2 RELEASE does not specify an api-version.
make it full 1.15 compatible?
oh yeah
usually that means something is just not specify correctly however it was made
actually, that shouldn't matter much
yes
that just shows that its still using legacy stuff
true
hey i just wanna ask, is there a free login plugin for 1.15.2 ?
for what
for a server
Hey guys, Are Manager classes a sign of bad design?
Should be the version with 1.14 api-version specified @flint grove
thanks ill give it a go
PR will probably take a while as the author has been off for 2 days
yeah and github hasn't seen him in longer but its a start
yeah
@frigid ember Nah, I wouldn't say managers are a bad design. They're a good way to access your data in a centralized location.
works great thanks for your help
π
I looked it up online and it said that they are a sign of bad design, I'm guessing that site was wrong, thanks
is anybody here good with bedwars rel
@frigid ember I mean, you shouldn't make a manager if there is no need.
there is most likely a plugin out there doing it if not one coulda always make one
@gusty crane I found a plugin that allows for a non-foreable item-based economy! The New Economy plugin works if I add lore to the items!
Guys, how do I change the spawn point when going through the end portal?
Is there a good plugin that logs everything a player does
There usually are, maybe look up a Logger plugin?
Thanks
Can someone explain how this egg crashes my server? https://github.com/Wurst-Imperium/Wurst7/blob/master/src/main/java/net/wurstclient/hacks/ServerCrasherHack.java#L59 It throws this error https://paste.bnn.gg/wurstcrash
im assuming thats just cause there's no quotes on the json? i know that strict json was enforced a while ago. but that shouldnt crash it right?
would that cause a crash though? seems like it should be handled but if that's what causing it I can fix it
One message removed from a suspended account.
yes
π
really the only stuff I need to store on a db is vault,luck perm info, and mcmmo stats right (fac server)
There are resources that will recommend you having to use a database. I recommend reading more over the resource description to see if it is necessary
so, i have some questions - I am thinking of creating a "keyframing" tool, which would allow people to create "custom mobs" per se, through keyframing
my thought is that you'd start a new "project" or something - an armorstand spawns at your location, marking the center. you can spawn other entities or armor stands and "link" them to the origin, adding them to a list. as the mob moves, these entities are teleported relative to the origin entity.
so let's say you create an arm or something; you have a few armor stands in position. you save their data and positioning as a "frame", move them, make another "frame", etc etc. when it's active, each frame is played, one after the next.
my question is this: if i want to extend this to ANY entity, not just armor stands, is there a sort of "catch-all" way i can serialize an entity's data? (such as its armor contents, things it is holding, invisible, potion effects, etc etc.)
you can essentially convert an ItemStack to a String, just wondering the same about entity data
or if i'd have to poke through every NBT value of every entity in the game and make my own saving-parsing-contraption
I'm not 100% sure, but I would say yes, as long as they share the same interfaces. If not, then you would have to go through the values of those entities.
I'd look through the entities APIs and interfaces and see how you could handle them all.
alright, thank you!
any good inventory apis/libraries for 1.15?
used cardboard for a while
?
ahh heck it was a class i found somewhere on the bukkit forums, it's really old but it allows serialization of inventories
they'd be converted to a string, which could be converted to an ItemStack[]
and with that you could do whatever you like
yeah here it is
it's around 15 lines of code
two methods, itemToStringBlob(ItemStack stack), and stringBlobToItem(String stringBlob)
multiverse core isn't working for me - is this due to me having via version installed?
would it just be okay to use multiworld
How would I compress a location to a Long?
return ((long)x & 0x7FFFFFF) | (((long)z & 0x7FFFFFF) << 27) | ((long)y << 54);
note, this does not match vanillas method
see BlockPosition.a if you need to match vanillas
public static long a(int i, int j, int k) {
public static int getBlockKeyX(long packed) {
return (int) ((packed << 37) >> 37);
}
public static int getBlockKeyY(long packed) {
return (int) (packed >>> 54);
}
public static int getBlockKeyZ(long packed) {
return (int) ((packed << 10) >> 37);
}
to unpack it.
Thanks π
hmmmm, this is strange
making a plugin that requires actions given clicking an item in a pop-up gui
what event should I use for when the player clicks an item and then an action occurs
in the gui that pops up
InventoryClickEvent
If youβre going to create menus, you may consider implementing InventoryHolder
any good inventory apis/libraries for 1.15?
@grim sapphire Make your own framework for it otherwise. (:
I'm not sure why this isn't working... π€
Player player = event.getPlayer();
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
BookMeta bookMeta = (BookMeta) book.getItemMeta();
List<BaseComponent[]> pages = bookMeta.spigot().getPages();
BaseComponent[] page = new ComponentBuilder("Click me")
.event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://example.com/"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Visit our website!").create()))
.create();
bookMeta.spigot().addPage(page);
bookMeta.spigot().setPages(pages);
bookMeta.setTitle("Guidebook");
bookMeta.setAuthor("MrReeMC");
book.setItemMeta(bookMeta);
player.openBook(book);```
I downloaded a custom map and is it possible to load all the chunks that are part of the map so it shows up on dynmap? (I dont want to generate other chunks that are not part of the map) (I am on 1.15.2)
You can use ChunkMaster to prevent the world but it doesn't respect the world border
*pregen
i didnt work on 1.15.2 for me for some reason
Really? Worked on my server π€
also my map is 4000 x 10000 will it still work?
Should do.
will it generate more chunks after the map is over?
Yes but you can just turn it off
It also won't generate if there are people online
I think that if you set the radius of ChunkMaster to half that of the world border then it shouldn't generate past that.
i dont have a worldborder
i dont know how to set it up either
do you know how?
i am a noob at this
Half the radius of the map if you don't have a world border
But you will want to set up a border anyway so that people don't accidentally load the chunks and make them show up on dynmap.
@uneven cradle how do you set up a border please tell me
You mean /worldborder set <size>?
i dont know
i just have a 4000x10000 area and i want to have a worldborder around it so no one can go outside and generate chunks
If you are running a server that is version 1.8 and above, just type /worldborder
Well if you wanted a 10k sized worldborder, that extended to 10k on each coordinate, you would type /worldborder set 20000, however you're situation seems slightly different. But you can very easily look up how to set a worldborder online, because that is a default command built into minecraft 1.8+
all the ones i saw made it a square
but i need to make it a rectangle because mine is 4000 x 10000
If youβre going to create menus, you may consider implementing InventoryHolder
@naive goblet noooo, don't do that
/me cries
I mean I used to use titles for detection but inventory holders makes it way easier to check and reliable
So that's probably why people like it
The method literally returns Inventory that you can == on
I have no idea why implement custom inventory holder would be the logical step
hi all can i please have some help
?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.
okay md
Do 0 tick farms not work on spigot? my friend made a server for the 2 of us to play, and it isnt working
i'm pretty sure spigot fixes mc bugs if any found
What if the inventory isn't always the exact same though
I have no idea but it sounds like cheating
Pretty sure heard someone saying they removed them from vanilla in 1.16 anyway
yes but im on 1.15
Good to know
i dont know what to do
and i cant find anytrhing on the internet saying if u can or not
when i do /fill -5376 0 -2688 -5376 256 2688 minecraft:barrier it says position not loaded
www spigotmc org/wiki/creating-a-gui-inventory/ @fleet crane Update this as well?
Velocity
i dont see a version for 1.15
Lmao itβs not likely to change anything that would break earlier versions in 1.15
Player#getInventory#addItem(ItemStack)
and item stack is the id of the item?
For instance java //Getting player Conclure, getting inventory, adding new itemstack with material diamond and a stacksize of 2 Bukkit.getPlayer("Conclure").getInventory().addItem(new ItemStack(Material.DIAMOND, 2));
thanks
@vernal lance checking InventoryView works fine for me https://github.com/Derkades/Derkutils/blob/master/src/xyz/derkades/derkutils/bukkit/menu/IconMenu.java#L133
no need to check for titles or create custom implementations of bukkit classes
Hey guys,
Does anyone know about VehicleEnterEvent and VehicleExitEvent?
At my plugin the VehicleExitEvent is triggered when you enter a vehicle and I don't know why.
I posted my issue in the forum because it's too long for Discord. Check it out π
https://www.spigotmc.org/threads/vehicleexitevent-is-executed-at-entering-a-vehicle.428968/
Contact the author of the plugin?
my plugin
my inventories are dynamically generated and items are changed while the inventory is open
InventoryView stays the same
I don't know if checking equality for Inventory works but md5 said it so it probably does
Perhaps, I'll look into it more when I add support for 1.16
But I personally prefer minecraft itself dealing with the inventory side so I don't have to save it somewhere
Especially if they'd be removed after they are closed
Since they are also per player
my menus are as well
Got examples of yours?
yeah, I use this util for my menus
I can send an example, one sec
leaderboard menu with player heads
(you open this menu by calling the constructor)
my overly complicated server selector menu: https://github.com/ServerSelectorX/ServerSelectorX/blob/master/src/xyz/derkades/serverselectorx/Menu.java
this one has a refresh timer

I'll look into it more when it does end up breaking
or when I have spare time to future proof the plugin
new ItemBuilder(Material.DIAMOND_PICKAXE).unbreakable().damage(40).name("Test").create()
so basically in a nutshell you save the inventoryView and you test that correct?
yes
this util class is basically just a wrapper for everything
it provides a more simple "on close" and "on click" event
new ItemBuilder(Material.DIAMOND_PICKAXE).unbreakable().damage(40).name("Test").create()
@sour dock Wow Easier way than dealing with default standards
wouldn't you also be able to make a custom Inventory object which implements the Inventory class 
so you can easily test that compared to saving the menu yourself
because your solution requires you to save everything
when I could technically add a enum to the custom inventory
which I can easily check for
"save everything" just the inventory object
just a random thought
well each time a inventory gets created
and then you have to worry about removing it after
garbage collection does that
I don't keep iconmenu instances around
there's no need to
so you rely on Java garbage collection to deal with it
I see
not sure how reliable that is
it's not like you can manually garbage collect lol
I suppose
are you talking about manually setting a local variable to null at the end of a method?
you don't have any control over it anyway
go c++
even System.gc() is only a suggestion to run garbage collection
if you just want total control
yeah enjoy segmentation faults and double free errors
Wouldn't be hard to create a plugin that's just nothing but item builders tbh π @sour dock @normal swift
I just shade this into all my plugins
i think i will implement this too in future plugins
never thought about it until now
lol
btw, anyone knows if the 1.8.8 ymlconfig replaced any dot to ,?
it seems to happen to some users all of the sudden since i released legacy version
never ran into this issue
Hello everyone, i have a question. I am not a developer myself, but I'm wondering if it is possible to make a plugin that can display a webpage in a Minecraft server? It will not be used to watch video's, but it would be enough if you can read the website and fill in some things... I was thinking maybe this can be done by using item frames, maps and armor stands?
Since I am not a developer myself I wonder if someone can tell me if this is possible!?
yes
maybe weird things the users were using then π€
Tried to Create YamlConfiguration from scratch?
or you are using default builtin spigot
I don't have a server myself, but I first wanted to know if it is possible
i use the build in spigot
same as i do for the 1.14+ version
but it seems to me both work as expected
yet to 2 users
all their dots are replaced with commas
so weird
But there is already a plugin?
@brazen heron maybe it is posible to display text from website but dont know if you want this
just like spigot update checker for checking server version from string on their website
No I really need a whole picture of the website
you cant use pictures in minecraft chat without mods
It doesn't have to be in the chat either, but it has to be on a wall from item frames
https://www.spigotmc.org/resources/imageonmap.26585/ never tried it but this is maybe what you want
break;
That stops it
Not pause it
I need it to pause it for and X amount of seconds when a string in the list begins with "wait "
add boolean isPaused = true
and check it on loop begining
then via command change it
I got this string list config.getStringList("commands"). I want to execute them after each other but there's a custom "command". You can add - wait 5 which will wait 5 seconds before the next command will execute, I can't seem to find a way to implement it
What
void exec(List<String> commands) {
while (!commands.isEmpty()) {
String command = commands.remove(0);
if (command is wait command)
bukkit scheduler, call exec(commands) after some time
break;
else
run command normally
}
}
it would probably be best to use some other data structure, removing the first item from an arraylist is not a good idea
or rewrite this code so you remove the last element
or keep an index and don't remove elements
you're probably going to have max 10-20 commands so using an arraylist is fine for performance even though it won't be O(1)
for a minimal effort improvement you can use a Queue
since this is FIFO
or a stack and add it backwards π€
though at that point you might as well just use an arraylist in a smarter way
I'm just rambling at this point
java + english
try this
for posting a link
might need to !verify first
and link the code with a code block with three backticks on either side
i need to rest 0_0
I did
@keen magnet write it like that
copy that thing
```java
<code>
```
this
and write the code where it says <code>
?```
anyways I verified myself
ok
@EventHandler
public void onItemDamage(PlayerItemDamageEvent e){
System.out.println("uwu");
}
link
it's not a link
damn
getServer().getPluginManager().registerEvents(new ItemDamageListener(), this);
did you register the event
yes
Hey guys ever heard of Geyser Server?
does itemdamagelistener implement listener
yeah
isn't it supposed to get called when hitting with a sword for example?
oh
wow
it doesn't only for the sword for some reason
Just check the item on entitydamageeveent or smtng
Do I still need to check for permission with sender.hasPermission if I wrote them in the plugin.yml?
commands:
mycommands:
description: The decription
permission: plugin.command.perm
usage: /mycommands [parameter]
permissions:
plugin.command.perm:
description: Allow player to access this command.
default: op
Another question, I always thought YAML will not parse "." (dot) correctly for keys. But this example puts them in: https://www.spigotmc.org/wiki/plugin-yml/#permissions. So YAML will actually parse them correctly?
Yes
when return false;
it will send the permission message
I think you can do like Command#testPermission()
yes, use testPermission
It will test for the permission you assigned in plugin yaml
thanks
If fail it'll send the perm msg I think
how about the dot in YAML file
yes it will send a permission message that is unfortunately unconfigurable
the dots are fine
0.o
may want to enclose them in quotes if you want
Tajam or just create your own command constructor
Not if you do it silent
I think
you don't really need to worry about the dots, you don't need to access the permission yourself
bruh
I wish the bukkit configuration API didn't use dots for accessing members
There's much wrong with the API
But it's working :]
public boolean testPermissionSilent(@NotNull CommandSender target) {
if ((permission == null) || (permission.length() == 0)) {
return true;
}
for (String p : permission.split(";")) {
if (target.hasPermission(p)) {
return true;
}
}
return false;
}
bukkit is considered a legacy API by most people at this point
because I remember last time i place dot in my config file it breaks the configuration
so I am confused
//onCommand
if (!command.testPermissionSilent(sender)) {
return false;
}
``` iirc
shouldn't you return true, so it doesn't send the command usage?
Is false sending command usage?
why?
declaring it in plugin.yml instead of making your own subclass manually is the convention
unless you want to make the command name configurable
Hi,
Can I search for the name of a plugin by giving a description here?
bukkit is considered a legacy API by most people at this point
Those people would be considering wrong because Bukkit is still actively maintained and is the main API the majority of people use. In terms of server software, however, CraftBukkit is considered legacy
yeah I'm not saying I agree
they say move to sponge but sponge doesn't even have 1.13+ versions I believe
I get why people don't like Bukkit but it's hard to change an API for compatibility reasons
More freedom RobinMC. Being able to construct what you want and make subcommands etc. Then we can use the CommandMap and register our commands instead.
yeah I know, I do it myself as well but I wouldn't recommend it to someone here
I'm pretty sure you need reflection to get the commandmap instance
I'd say it's better but ig it's preference, if you want to go with bukkits way of doing it sure.
(or at least if you want to make it version independent)
Yes reflections obv
It's not hard though
You just have to get SimpleCommandMap and then all g.
@subtle blade I donated 10$ is that enough to change name? If so how do I do it?
It is, yes. Though it won't be processed immediately because md does these manually. Additionally, if you've donated with an email not associated with your Spigot account, create a thread in Donation Enquiries with the email you used to donate
@sour dock i would discourage from moving to sponge.
Bukkit/spigot/craftbukkit is simplistic, old and sometimes stupid beyond imagination. but eventually you can always do what you want.
Sponge lacks dozens of features, some parts of its api are extremly retarded.
Eventually in spigot you code your plugin features. In sponge you battle with its api
yeah on the one hand the bukkit api lacks a lot of features, but that makes it easy to understand and get started with, and gives a lot of freedom to create your own utilities etc
I am not saying Sponge is better at all
Just for example to create custom nbt on an item in spigot its one line. In sponge it was around 150 lines of stupid boilerplate code. Which you cannot realy abstract away. And on top of that if your plugin wont load and player server loads the item you lose your nbt tags
We created a very very advanced plugin, with tons and tons of features, and we only used spigot API
Question though, I've never stumbled upon this issue before
@EventHandler
public void onDoorInteract(PlayerInteractEvent e){
Bukkit.broadcastMessage(e.getMaterial().toString());
if(!(e.getAction() == Action.RIGHT_CLICK_BLOCK))
return;
For some reason, the broadcasted message is Always AIR. No matter with what block I'm interacting. Any idea?
is e.getMaterial the clicked block or the item used (in player hand)?
I think there's a getClickedBlock method
How to reset a user's data so it's as if they never joined the server before?
Delete their player data folder
anyone know how to get luck perms prefix with bungee for a bungee plugin with a variable ??
Oh thx
Did anyone try to hover over the server icon of spigot already? That's quite a nice animation π
funnycube made it I think
He is artist?
Is there anyway I could override the ticking functionality of a tile state block?
the one gotten from implementing ITickable
Hey guys, can someone review my source code https://github.com/Phaze209/spotlights/tree/master/src/me/phaze/spotlights . I just want to make sure I'm following OOP principles correctly
oop principles in java
2020
If you are using more than 2 levels of inheritance you are doing it wrong.
Thats all you need to know
@Override
public void onEnable() {
sendMessage("&aSpotlights Loading...");
sendMessage(" ");
this.manager = new SpotlightManager(this);
getConfig().addDefault("texture-enabled", true);
getConfig().addDefault("messages.texture-disabled", "&cAnimated spotlights will not work properly because texture packs have been disabled");
getConfig().options().copyDefaults(true);
saveConfig();
sendMessage(" &a- Configuration loaded!" );
CommandRegistry.register(new SpotlightCommand());
sendMessage(" &a- Commands registered!" );
ListenerRegistry.register(this, new JoinListener(this), new CrystalDamage(this));
sendMessage(" &a- Listeners are listening!" );
Bukkit.getConsoleSender().sendMessage(" ");
Bukkit.getConsoleSender().sendMessage("Spotlights Enabled - By Phaze");
Bukkit.getConsoleSender().sendMessage(" ");
}
``` It's quite messy formatted.
Oh nvm
mb it was just for me on the source code...
If you are using more than 2 levels of inheritance you are doing it wrong.
oh no
I am in trouble
same lol
But @frigid ember you should consider regex when parsing ints through strings.
Is there a more efficient way to do this?
List<String> locations = configLoad.getStringList("locations");
locations.add(loc);
configLoad.set("locations", locations);```
configLoad is a YamlConfiguration object
not sure if the string list returned by the configuration API is mutable, you could try
configLoad.getStringList("locations").add(loc)
Phaze I personally don't like short variable names like "s" or "loc" but it's preferences ig.
particularly, the variable name should not be about the variable type but about the variable content. location is no different from loc. spawnLocation or homeLocation is actually useful!
String string =
Alright, thanks guys
And also when overriding methods
Please use @Override
It'll make it easier for you later I promise.
configure IDE to automatically add override annotaions :)
in eclipse preferences > java > editor > save actions
I can't seem to find it
Switch to IntelliJ
go to save actions
eclipse
2020
Hello, how can I get the playercount for another server within bungee but using the spigot api
plugin messaging channels
if you want an example decompile this https://www.spigotmc.org/resources/totalonlinecount.62722/
though the wiki should be enough to understand it
okay thanks
How does one get a custom ban/kick message
people still use eclipse?
How would you keep certain items on death? The method I tried throws a ConcurrentModificationException
Code:
@EventHandler
public void onDeath(PlayerDeathEvent e){
Player p = e.getEntity();
ItemStack firework = new ItemStack(Material.FIREWORK);
ItemMeta fireworkMeta = firework.getItemMeta();
fireworkMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', core.getConfig().getString("missile-name")));
firework.setItemMeta(fireworkMeta);
for (ItemStack item : e.getDrops()){
if (item.getType().equals(firework.getType())){
if (item.hasItemMeta() && item.getItemMeta().getDisplayName().equalsIgnoreCase(firework.getItemMeta().getDisplayName())){
e.getDrops().remove(item);
}
}
}
}
you give it back to them>?
You could setKeepInventory and then filter the inventory
I can't remove the item from th e drops
Oh
It does remove it from the drops
I think
Any advice on how to handle Dynmap lag?
woof
Choco you got any idea how to make my profile visible?
People been telling me it gives them errors when clicking my link.
public EnderCrystal getCrystal() {
Entity ent = cLoc.getWorld().getEntities().stream()
.filter(e -> e.getName().equals(id) && e instanceof EnderCrystal).findFirst().orElse(null);
if (ent != null) {
return (EnderCrystal) ent; // already checked if its an endercrystal, cast is safe
} else {
return Util.spawnCrystal(cLoc, id);
}
}
is this too much logic to have inside an entity class? https://github.com/Phaze209/spotlights/blob/master/src/me/phaze/spotlights/manager/Spotlight.java
Hi, I'm currently setting up a Spigot server for my first time. I'm doing a 1.15.2 version I downloaded and I cannot get the .bat to work properly.
Send your script over, I might be able to help.
You can DM me if the bot is being stupid lol
ok
How do you check for End Portal creation?
The PortalCreateEvent seems to work for EndPortals in 1.15.2 but not in 1.8
How do you create a custom ban message/screen
the kickPlayer method in Player
Where can I find it?
in the Player class
are you a plugin developer or server owner
^
if server owner, /ban <message> or get a plugin that can do more
Is scheduling tasks per say laggy?
I have a async position monitor that updates every 5 ticks, and everything it calls is part of my own API, which uses concurrent collections, except for the last line, in which I need to get a player's location.
I run this like
Bukkit.getScheduler().runTask(instance, Runnable { fPlayer.lastLocation = player.location })
Is this alright to do?
Also I used this, but its a copy of the collection so I think thats alright
@sour dock Can you name a plugin that can do it for me?
Is scheduling tasks per say laggy?
I have a async position monitor that updates every 5 ticks, and everything it calls is part of my own API, which uses concurrent collections, except for the last line, in which I need to get a player's location.I run this like
Bukkit.getScheduler().runTask(instance, Runnable { fPlayer.lastLocation = player.location })Is this alright to do?
@storm tulip use lambda :p
@storm tulip if its async it wont cause lag to the server directly, but depending on the size of the task the machine itself may end up suffering. But i think for what youre doing youll be fine
but as per the API
you should never access bukkit api within async tasks
you should run it in sync, you shouldnt have to worry about it if youre updating locations
Yeah thatβs what I am thinking I donβt know if itβll hurt to schedule so many tasks
Iβm asking about the overhead of running a task it self
Like itβs async to not cause direct lag but I know I gotta be careful
i would recommend creating an event
can call that event with a task
that runs every 5 ticks from startup
and then use a listener
Okay and this would all be sync
yes
otherwise you risk running into problem
async tasks are meant for big processes that would stall main server threads
using the bukkit api wont be an issue with sync
Yeah I mean Iβm not doing anything extremely intensive per say but I wanted to make sure I donβt process 300 players locations and other stuff 4 time a second
it sounds a lot worse than it actually is
And I know computers are fast so it technically wonβt stall a thread to do what I wanna do but I just fear for large player counts
i recommend against scheduling a new task per player, which is why i said to make one task that runs every 5 ticks on startup and create an event for it
Yeah makes sense
well its less about the server and more about the machine you run it on
I could do that or hold all the players and update it once theyβre all processed
i would assume you upgrade the machine when needed
So I schedule one task
Itβs gonna be a public plugin
So I actually need to account for those shared hosted servers but I can also safely assume they have lower playercounts due to their lower budget
if you think about all the other plugins out there
and all the big servers
and stuff like cheat prevention
idk grabbing locations isnt intensive at all
Yeah and thatβs basically all Iβm doing from bukkit api other than online players
The rest is grabbing data and comparing it from my own collections
Itβs basically a task to update every time a player moves to a new chunk
PlayerMoveEvent fires when you literally move your head
So I did this repeating task to check locations instead
I ran this task sync versus playermoveevent and playermoveevent is a lot more expensive due to it firing so much
Yes but every time someone moves their head
It checks
and thats ok
once again its not that intensive
as long as you dont run the entire portion of code every time the event fires you'll be ok
Thatβs how FUUID and SavageFactions did it and it deffo would hit timings which is why Iβm trying a diff approach.
Imma move back to playermoveevent and test around I guess
Yeah thatβs what we used to do
ah
yeah idk
Im kinda comparing moving heads of 300 ppl firing events to checking them manually 4 times a second
with factions a lot of players are AFK as well, so playermoveevent wont fire for them, which is something else to consider I guess
Hi! Quick query, server version 1.12.
Got a plugin that dispatches commands on certain events, want it to set 2x blocks at a time.
Anyone know if minecraft's /setblock is laggy or if it'll handle okay?
weight.405 in a permission of a group what is?
@rocky knot you say more than 2 levels of inheritance and you're doing something wrong
I present this beauty
the sad part is this is not a joke
for commands just use https://github.com/aikar/commands
bukkit command api is pretty retarded
That looks... horrendous
Is there a lib or something that translate spigot 1.12.2 enchantments names to those of minecraft ?
yes
great thanks
How does one create a local build tool reposity for maven? π€
maven does that automatically
I need nms
That's the ~/.m2/repository thing
Oh hmm
You'd just run buildtools locally and then spigot will be in the local repo
does anyone know a spigot world edit plugin?
Using SpigotAPI 1.15.2, how is it possible to check if an OfflinePlayer, that I got via Bukkit.getOfflinePlayer(name), is a real player and not just any String?
I hope it is somewhat understandable what I mean lol
I'm looking for a plug-in that allow me to imitate mob spawns with blocks instead of the mob spawner
Anything like that aviable?
because I can't find anything
Is it possible to create my own custom block that is tickable? So that it ticks along with Minecraft? Without using schedules or anything
Darn, because I've heard from someone you could register your own block with NMS and use ITickable
Hey guys, is my code good? https://github.com/Phaze209/spotlights/tree/master/src
Util should be public final class Util
*public final class
Phaze, I wouldn't even use Optional. It bloats code imo. I'd just have a traditional null check.
Do I keep the private constructor if I make the class final?
yes
Also, here:
Entity ent = cLoc.getWorld().getEntities().stream() .filter(e -> e.getName().equals(id) && e instanceof EnderCrystal).findFirst().orElse(null);
this is contradictory to what an Optional is used for. Either use Optional::isPresent or Optional::ifPresent. No point in returning null if your choice is to use an Optional.
a Utility class should be
public final class <Class Name>{
private <Class Name>{
}
//public static methods
}
I've probably fucked that up somehow
point is there
Do I do too much logic in the Spotlight class?
in SpotlightManager instead of setting spotlights field on constructor you should just do private Set<Spotlight> spotlights = new HashSet<>(); it makes easier for others to understand your code.
For your spotlight manager, I'd suggest using a Map. The key being the ID, and the value being the object. This eliminates the need for having to loop over the collection each time and provides you an O(1) lookup time.
ok
@frigid ember why does this method have a non-void return type if you always return null
I meant to return the crystal
Is there no API for EnderCrystal#setInvisible()? It's mapped so it has to be used somewhere
I didn't know you could make endercrystals invisible, I was trying for ages to set one but I couldn't find the answer in spigot forums
@rocky knot I'd like to use aikars commands system but I don't think it lets you determine command names/aliases at runtime
since it is set using annotations
I wonder where that method is used then. We only map methods if they're used by CraftBukkit
@pastel basin I'm not sure if it works, I haven't tried it yet
Is there an event I'm missing that is the dragon breath capturing into a bottle?
@wind swan PlayerInteractEvent?
looks like only armorstand has setVisible
ACF has variables for letting you pull aliases/command names, etc, out of configs for the commands, the wiki goes over a lot of that
Is it possible to inject custom block data into a block?
with the API? no
Is it possible to inject custom block data into a block?
@fleet burrow
do you mean persistent data?
@pastel basin I was hoping for something more specific to the bottle capturing. I've tried the interactevent, but I'm uncertain of how to get the exact situation where a bottle can be captured (I've tried going down the getNearbyEntities route and checking for ones with their particle matching DRAGON_BREATH), but could never get the positioning correct to match 100%
Reason I ask is for an items stacking plugin, so I need only the events that would give the player a bottle
you just wanna check if they're interacting with specific blocks?
wait, are particles entities? i didn't know that
You talking to me? Because yeah lmao
Here's some of what I had:
World world = player.getWorld();
Collection<Entity> entities = world.getNearbyEntities(player.getLocation(), 20, 10, 20, (e) -> e.getType() == EntityType.AREA_EFFECT_CLOUD);
boolean found = false;
for (Entity entity : entities) {
AreaEffectCloud cloud = (AreaEffectCloud) entity;
if (cloud.getParticle() == Particle.DRAGON_BREATH) {
But then you have to determine if the player can capture from that somehow
unless I'm missing something
@fleet burrow idk what kind of data you mean, if you want to store stuff on blocks you can use a PersistentDataContainer which is available for every kind of block
Pretty sure it's only available for blocks that extend TileState
@Nullable
public Spotlight getSpotlight(String id) {
return spotlights.getOrDefault(id, null);
}
Is this correct usage or can I not use null here either
It's fine, just redundant. get() will return null if not found anyways
return spotlights.get(id) will achieve the same goal
alright thanks
But I have been told there is a way to inject data into blockdata
Does anybody understand how resourcepacks are made?
I have defined a custom texture as
{
"parent": "item/handheld",
"textures": {
"layer0": "item/cobblestone"
},
"overrides": [
{ "predicate": {"custom_model_data":1500}, "model": "item/gui/skilltree_horizontal"}
]
}
My custom texture works, but at the same time it somehow makes minecraft not to render default texture for cobblestone block.
@fleet burrow That would be so damn complicated, I already did it with a custom spawner plugin before PersistentDataContainers. What I did was, checking for when the player places the block on the ground and saving the data manually on a configuration with the coordinates and world, then checking for when the player breaks and deleting the config and adding my data to the lore of the itemstack that dropped from that block
Why tf is LivingEntity#addPotionEffect so heavy
@fleet burrow That would be so damn complicated, I already did it with a custom spawner plugin before PersistentDataContainers. What I did was, checking for when the player places the block on the ground and saving the data manually on a configuration with the coordinates and world, then checking for when the player breaks and deleting the config and adding my data to the lore of the itemstack that dropped from that block
but there is a lot of flaws by using this, like if the block was moved by a piston or broke by an explosion
Both adding and removing potion effect affecting server performance
Hit the gym, my dude
Well, I hate to tell ya, those aren't terribly performance heavy:
@Override
public boolean addPotionEffect(PotionEffect effect, boolean force) {
getHandle().addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()), EntityPotionEffectEvent.Cause.PLUGIN);
return true;
}
...
@Override
public void removePotionEffect(PotionEffectType type) {
getHandle().removeEffect(MobEffectList.fromId(type.getId()), EntityPotionEffectEvent.Cause.PLUGIN);
}```
That's literally it
So I would blame it on the plugin using them being stupid
i.e. throwing away instances of PotionEffect instead of using constants. Or doing so while calling those methods frequently (such as every tick)
Also, interestingly enough, force doesn't seem to be used?
Ah, was as a result of changes made in a previous commit to allow for concurrent potion effects. Force is unnecessary
yea and why is this a boolean if it will return true every time
It did return false before the recent change
It's in preparation for 1.16 where you can stack potion effects of the same type
deprecate this and create a new method with void return type and no force argument?
Unnecessary, though there is one already that has no force argument
oh yeah you can't do that then
If it remains like that in 1.16 (which it likely will), then yes it should be deprecated
this class doesn't make sense to me, any reason why it uses getType() instead of this?
(this is org.bukkit.potion.PotionEffectTypeWrapper)
hm, now I am even more confused as to why this wrapper even exists at all
enum would seem to be a better choice
Using SpigotAPI 1.15.2, how is it possible to check if an OfflinePlayer, that I got via Bukkit.getOfflinePlayer(name), is a real player and not just any String? I hope it is somewhat understandable what I mean lol
You use a UUID to get an offlinePlayer
Should it be possible to add a recipe with no datapacks enabled that contain recipes?
Is there a performance difference between using a single listener for every thing that you want to work with that event and setting a listener for every instance of my class?
E.g:
public class OnPlayerToggleSneak implements Listener {
public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
MyClass.someData...
}
}
public class MyClass {
public static HashSet<Data> someData = new HashSet<>();
public MyClass(Data data) {
someData.add(data);
}
}
and
public class MyClass implements Listener {
private HashSet<Data> someData = new HashSet<>();
public MyClass(Data data) {
Bukkit.getPluginManager().registerEvents(main, this);
someData.add(data);
}
public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
check some data...
}
}
Running into an issue due to a user disabling the vanilla datapack and my recipe plugin fails to add recipes
Imagine not being verified
i have no dms
I did the command, I checked my inbox, nothing
ok deep breaths, where exactly are the PMs? I checked "Conversations" and it is totally empty
T_T
I just want to know why the DataWatcher in the legacy api is telling me boolean is not a valid type, and I would post some logs and relevant info except the bot keeps blocking it and I can't get verified because the OTHER bot won't PM me
did you check if your dms are enabled?
π€
Ok, on the entity metadata format protocol for entity base class, it says that index 3 is a type of "Boolean" for "Is custom name visible"
so I do DataWatcher.a(3, true) to set it
and it says Unknown data type: Boolean
@fleet burrow playerinteractevent is cancelled by default because of some minecraft stuff
I read about it somewhere
idk exactly why
but it was always cancelled
okay after observing the spigot source... Boolean is not a data type
so... what am I supposed to do?
am I just supposed to like cast true to a byte or something?
looking into..
wh-
this bot thinks code is URLs
why
-_-
and my messages on the forums are still empty :)
So how would I got about cancelling a player right clicking on say, a command block?
as setCancelled doesn't seem to work
i think its setAction or something
I've manually registered a Command subclass using the register method in CommandMap, now how do I unregister? I've tried removing the command from the knownCommands hashmap and the command indeed doesn't work afterwards, but it still shows up in tab completion and bukkit still seems to keep the command instance around somewhere
but i use setCancelled and its not Deprecated and works fine
I got a hold of the guy who says he knows how to store custom block data in a block
Odd
I'll update you if it works
Maybe you'll use it
only isCancelled is deprecated
idk either
lol
@valid timber I couldn't find DataWatcher.a(3, true) on DataWatcher class
sorry, all my original posts said that
but they all got deleted by the bot for links :) without any links
He sent me this piece of code
final Set<Long> locations = new HashSet<>(); //Eventually replace with custom set type.
void save(file: Path) {
try (final WritableByteChannel out = Files.newBufferedChannel(file)) {
final ByteBuffer buffer = ByteBuffer.allocate(locations.size() * 8);
locations.forEach(buffer::putLong); //Eventually replace with direct memory access.
buffer.flip()
while (buffer.hasRemaining()) out.write(buffer);
}
}```
I'll ask him what the file parameter is π€·ββοΈ
but that code stores only the locations, not the custom data of the block
a yaml is much more simpler, i would suggest saving the location with BukkitObjectOutputStream, converting it to base64 and saving it into a single key in the yaml
and then add your custom data to the file
My screen gets stuck like this when I do p.setResourcePack
is the link to the resourcepack a directlink?
@frigid ember The way I got this to work was by using Player#setResourcePack(String) on a 20 ticks delayed BukkitRunnable.
Are you sure the link is working correctly? I use it like this on PlayerJoinEvent and it works fine
(BukkitRunnable) () -> {
p.setResourcePack(config.getString("Resource Packs.URL"));
}.runTaskLater(PlayMoreSounds.getPlugin(), 20);
When starting the spigot server will it overlap with the local server I made beforr using spigot?
!verify syrusxd
A private message has been sent to your SpigotMC.org account for verification!
only if you donate 10 dollars i think
^ You have to donate to change your spigot name
Does anyone know how to silence the org.mongodb driver logging?
unverify your discord account from spigot by changing your nick, then verify again
?
wqsaaaaaaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
@pastel basin could you explain what you mean
Change your nick here so you get unverified, then verify again
!verify syrusxd
@orchid garden
but your nick seems like already changed?
oh sry about that
my cat walked over my keyboard
layed on my keyboard
without consent
Will the new minecraft eula effect on plugin developer rights of selling their plugins for hard currency?
I see updated date, yea. Did they announce anything or is there a diff?
So I'm trying to get my plugin to support both Vault and Reserve (another economy api.) For some reason vault doesn't throw any classnotfoundexceptions when I try to search for it, but reserve does, even though my enabling of their providers is the exact same. (IN this instance, neither are on the server) What's up with that? Is vault just magic?
vault = new ShopEconomyVault(plugin);
if(vault.enabled)
{
api = API.VAULT;
return true;
}
if(Bukkit.getPluginManager().getPlugin("Reserve") != null)
{
reserve = new ShopEconomyReserve(plugin);
if(reserve.enabled)
{
api = API.RESERVE;
return true;
}
}
is what I had to do to get around it. With Reserve I need to check if it's there, but vault is fine w/o it.
For capes its over already, just asking about plugins
No selling for hard currency aka real money
Thatβs always been the case though
For in-game, non-tangible products for an advantage
All plugins given for free its allowed
But for hard currency such as real money not allowed
Hard currency is real money or anything that can be converted into real money, including, but not limited to, Bitcoins. Soft currency is available in-game only and has no real-world value. You may not sell soft currency for hard currency, neither separately or along with ranks as a single or recurring payout. This is regardless of what you can use the soft currency for.
This all seems to apply to how users monetize their plugin use, not the plugins themselves
Thatβs a description for high currency only
Check t he whole post of commercial use
The*
Also i think you are correct too
Capes are pretty much dead ;v
Can anyone explain me how to use spleef plugin?
like can anyone help me set it up
Hey guys, I have this code but the texture pack freezes my game, 1.15.2
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
if (!textureEnabled) {
p.sendMessage(Util.color(textureDisabledMessage));
return;
}
new BukkitRunnable() {
@Override
public void run() {
p.setResourcePack("https://srv-file9.gofile.io/download/2Rh0Tw/texturessssz.zip");
}
}.runTaskLater(main, 20L);
}
@pastel basin
is there a plugin that respawns you to the last place you were in a certain world after leaving and rejoining?
does anyone know if i can make proguard export me jars directly obfuscated?