#help-archived
1 messages · Page 212 of 1
I wish all players would have <50ms ping and server always 20tps
then good luck
But no some people like to join american servers from africa
start at germany
start with italy internet
we have one of the worst internet worldwide lol
just because the politic guys dont want to stay on their promise)
what's your speed?
but hey, german politics... could tell romans about that
16mbps download, but i really have one of the worst possible
or just stability
woa
lol
300 up?
i pay even 20€ for my mobile 5gb, idk whats your prices for mobile internet
then good on you 👀
so viper, what was the mistake for my generator now
i dont get it... how can the int even become -255 WTF
int can be -2^31-1 actually
no i mean
how can a random int with bound 100 get -255
whats wrong with my code
just tell me lol
aren't the wiki tutorials working in most case? lol
dont think thats an 1.16 problem
what's your code?
Hi there, I'm trying to change the skin of an NPC, but for some reason they still appear as Alex of Steve skins. What am I doing wrong?
Code: https://paste.md-5.net/aberasexer.java
Both value and signature strings seem to be correct (I've printed them out), so I assume my error must be at line 51, but I don't see what I'm doing wrong...
its saying, that x and z are out of range, its giving about -255 to 255... idk why
at line 22
@hollow root Using .spigot gives me a stringified/serialised version of the textconponent object
It's bizzare
let me check one of my plugins, 1 min
@gilded compass this is how I did it for a clickable link:
TextComponent text = new TextComponent("");
TextComponent tc = new TextComponent("[X] ");
tc.setBold(true);
// TODO: Make color configurable
tc.setColor(net.md_5.bungee.api.ChatColor.DARK_RED);
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/besttools blacklist remove "+mat.name()));
TextComponent link = tc;
TextComponent name = new TextComponent(mat.name());
name.setColor(net.md_5.bungee.api.ChatColor.GRAY);
text.addExtra(link);
text.addExtra(name);
p.spigot().sendMessage(text);
the "[X] " is the clickable link
it's quite messy because I also had some troubles with the link not being clickable at all, so I just left this how it is right now. actually it was also split up into two methods but I combined them to send it here
maybe it's easier to open a thread at the spigot forum, the messages kinda get lost here
I have a problem
With spigot servers
i get ths error when im tring to run.bat
operable program or batch file.
Press any key to continue . . .```
Does anyone know how to fix?
whats in your bat file
run.bat
see what java help tells you
maybe you don't have it on your path
but probabily you messed up the init line
Hi there, does anyone know why buildtools always makes me add the -Xmx1024M argument?
Because it needs at least 1gb assigned in order to run successfully
It says that this can happen if I'm on a 32-bit system or low ram. I've got 64-bit windows and 16 gigs of ram
Prob you installed 32bits java instead of 64bits
Will try that. thanks
np
Is it possible to make a fully working match making system (like Hypixel BedWars for example) using a BungeeCord network, with a Spigot Plugin?
Its possible?
why not
well i guess it depends how complex you want that match making to be
if you also keep count of elo,who joined first,who has priority and shit
bungee messaging
Nope ill be checking for required players in the queue and thats it
Its 2v2 so i need 4 playera
S
what like starting from the player 'rank score' then expanding based with time to wait?
Nope. Nothing
then that's not matchmaking
I want it to work like this: you click on an npc, you get added to a queue, once there are 4 players, no matter the level or rank, they are sent to a server
is something wrong??
I have never worked on something like a queue so im kind of scared to start coding
Especially cuz its my first time working with Bungee
I DIDIDID
'java' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
This eroror
You need to make sure your PATH has an entry for Java.
yeah, either adjust your path or provide the full path to your java executable
Install java
e.g. instead of java use C:\Program Files\Java\jdk-13.0.1\bin\javaw.exe
(or where ever your java executable is living)
Install java
@bold anchor
I DIDIDID
@frigid ember
read what I wrote ProMaxxed...
Ik
adjust your PATH environment variable or provide the full path to the java executable
how
where did you install java?
In my program files x82 java jre1.8.0_261
Just set up Waterfall, got this error while trying to connect to another server https://pastebin.com/SZFHKJxW
The usual shenanigans
Hi there, I'm trying to change the skin of an NPC, but for some reason they still appear as Alex of Steve skins. What am I doing wrong?
Code: https://paste.md-5.net/aberasexer.java
Both value and signature strings seem to be correct (I've printed them out), so I assume my error must be at line 51, but I don't see what I'm doing wrong...
@river cradle https://www.youtube.com/watch?v=E3eqSZQx5GY
Yep, I followed that tutorial but it doesn't work and I can't spot my error
join his discord
Well I guess I did something different, I used another API to convert a skin PNG to a value and signature string
Well I just did, but I don't see why they could help me more than you guys could haha
I mean it's very much a Spigot question
dude i cant code more then a print command
Haha we all were there once
i mean the only problem i can see is using the different api. maybe its outdated or something. make sure everything is your version
Ok
i mean the only problem i can see is using the different api. maybe its outdated or something. make sure everything is your version
@vapid laurel I don't think that's the problem, as the value and signature returned seem valid... I think it has to do with the way I'm applying it but I don't see the error
@jagged torrent I have recently made a account under the wrong email for the forums. Is there anyway you can reset it?
@noble patrol try sending an email to tmp-support@spigotmc.org with your issue
with the tmp
Ok.
[20:39:18 ERROR]: [PlaceholderAPI] LeonCat is currently using a deprecated method to hook into PlaceholderAPI. Placeholders for that plugin no longer work. Please consult [Marcelektro] and urge them to update it ASAP.
why
:(
I used EZPlaceholderHook
Tank you
hey i need 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.
I went more than 6000 blocks in end dimension and didnt find any end city.
I'm playing on server
and I am unable to use ender pearl on endcity gateway
dumb server then
is this related to minecraft or server setup?
@visual kiln so do you know what's the issue?
If I own a premium resource, can I manually give people access to it?
Oh cool, is it by username?
however you have no control over them after
was about to ask a question here then i just forgot to add a single symbol at the end of the line ;
you can't remove them
Ah that's fine
god damn it java
not when you're chargebacked by one
Someone know how create custom entity in 1.16.1 ?
hey guys, weird bug - I am attacking a friendly player in my testing
I expect to see the entityattackentityevent to be thrown, but instead the playerinteractevent is being thrown
Does anybody know why this happens?>
is there a plugin for using an item to execute a command?
Hi there, can anyone help tell me what is causing the error to be thrown? It's whenever a player joins https://pastebin.com/PSJnbkcg Any help is appreciated. Thanks
It's an error in a plugin called FogusCore
So im just starting a basic survival server for 1.16 with maybe 20 plugins or less and maybe 10 players or so, I'm wondering how much ram I would need for it
hey guys, so for some reason, even though I set tab-complete to -1 in spigot.yml, people in 1.15.2 can still tab complete. any fix?
Mojang hates making stuff lag less it seems and spigot currently have other focuses
yeah, im doing a survival one, my minigames and stuff will be 1.8 or 1.12
er
I wont fix nothing with no corresponding JIRA ticket
What is max ram for minecraft server?
i don't think there is a max limit for minecraft
Is anyone here good at custom nms entities? If so, could you tell me a method for removing all the original pathfinder goals for the entity?
Maybe a dumb question but can you add @EventHandlers to abstract methods?
I tried some sort of reflection method from an old spigot post but it didn't work.
depends gizmo
do you have a custom entity class extending the og?
or just trying to modify it from the outside
there is this:
EntityInsentient creature = (EntityInsentient) e.getHandle(); creature.goalSelector = new PathfinderGoalSelector(((CraftWorld)en.getWorld()).getHandle().getMethodProfiler()); creature.targetSelector = new PathfinderGoalSelector(((CraftWorld) en.getWorld()).getHandle().getMethodProfiler());
It extends a entityVillager
but complex entities like villagers have other stuff that still gives them some sort of ai
oh
then you also need
Field field = EntityLiving.class.getDeclaredField("bo"); field.setAccessible(true); field.set(creature, new BehaviorController(ImmutableList.of(), ImmutableList.of(), new Dynamic(DynamicOpsNBT.a, new NBTTagCompound())));
this is for 1.15
it keeps changing each version quiet a lot which is annoying
Is this supposed to work out of the box? I threw it in a try catch and it's giving me red lines.
I think I'm in over my head here, god I wish I could see the source for what I'm messing with here
ye
Well I tried out that deobfuscator software I saw on spigot
mcdeob or something
I ran the process but never opened it
no for nms I believe.
well
you just gotta mess with it as it
or use the minidigger library
🤔
he did one
but i never found it usefull since i can just look
disciple
wdym
if u right click a class click find usages
and it'll tell u how to call it
i think he means that the nms has weird names from obfuscation and he is trying to get rid of them
No no
I just haven't really looked at the source code
decompiled minecraft server jar
How do I get @prisma viper bot for my own server? (if at all)
thank you
Hi, I made a plugin that drops the player's head when they die, but when the player changes their skin and place down their head it changes to their previous skin, why?
And it's the a new head when they die, not the old one
no, looks like an ASCII snowflake, asterisk is small. https://i.imgur.com/MRoUKqg.png
umm why i don't have the getType() thing?
but when i do e.getBlock() then getType() it works
anyone know the problem
?paste
delete that and post it in the haste bin
is that your plugin or someone else’s? I mean if you read the error it says right there onDisable there is a null pointer exception.
someone else
talk to the developer
lmao ok
umm why i don't have the getType() thing?
Wrong import
https://i.imgur.com/18dQFly.png
@tough crown why are you casting to player and block? You don’t need to do that
found it i need to specify like this
probably IntelliJ imported the wrong thing for me
just do Block block = e.getBlock();
declaration: package: org.bukkit.block, interface: Block
If you don’t prefer reading the docs go to your search engine and search. I copied and pasted your question and clicked on the first link, https://www.spigotmc.org/threads/how-to-get-name-of-block.181769/
Blocks don't have names unless they're Tile Entities
Does IntelliJ not complain about unnecessary casts
IntelliJ will just turn it gray and say it’s redundant
why this doesn't work
what
Don’t tell us it doesn’t work tell us why it doesn’t work
What are you even trying to do?
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
i am trying to detect block placing
found why it's not working because i missed a "S" after registerEvent
yo do you guys know why in my main class
package me.athlete.score;
import org.bukkit.plugin.java.JavaPlugin;
public class SCore extends JavaPlugin {
}```
it says class Score never used?
my advice don’t name classes after already existing Bukkit/Spigot API classes. You’ll also need to provide more information than that.
Possibly conflicting with this class, https://i.imgur.com/0GCo64H.png
btw if itemOnHand is deprecated what should i use
you should get the player inventory and then from that get itemOnMainHand
Any good Plugin Managers?
plugman
no
no
it's good when you're testing plugin and you're too lazy to keep restarting the server
you just do /plugman reload (plugin name)
Plugman isn't that good
and then get a bunch of memory leaks 😬
Verified can 😉
smh
but yeh the name is basically dark gray in intellij, and when you hover over it, it says Class ServerCore is never used
btw if itemOnHand is deprecated what should i use
the javadocs always tell you what to use
read them 😐
md_5, why do you expect people to read the javadocs 😐
How would you make an async response for placeholder API?
now separated to mainHand and offHand
I need to fetch the placeholder from a database - is there a way to do that without freezing
CompletableFuture
papi expansions return a string
oh
Fetching stuff from databases have to be async
CompletableFuture can be async and return stuff
yup im aware
is this custom placeholders
How can I get the attack damage (Ex: Diamond sword has 7 attack damage) of an item?
ok
Usually I would just get the generic attack damage attribute of the player that is holding it but i cant do that rn
Is there a list somewhere of all items which cannot be dropped using dropItem on a world? I know that the air types cannot be dropped using this method, but are there more?
declaration: package: org.bukkit, enum: Material
getPlayer().getVelocity().multiply(0.4)
does this work?
or do i have to make a new vector and do setvelocity
so like this getPlayer().setVelocity(getPlayer().getVelocity().multiply(0.4));
Yes
you guys know of any good way to crash my own server so I can test auto restart?
I was thinking tnt but last time I exploded over 20k and it seemed like it handled it like a champ tbh
Make an infinite loop or something
yo is it possible to list all the plugins in alphabetical order, when you do /pl?
Look at the current implementation
you guys know of any good way to crash my own server so I can test auto restart?
Thread.sleep(Integer.MAX_VALUE)😏
And you’ll probably just need to copy it with a list.sort
what do u mean by an infinite loop?
A loop that never exits?
Integer.MAX_VALUE loop
i mean yeah but like a loop of what
or... Double.MAX_VALUE >:)
and how
hmm alright will do
while (true) {
}
Just be like Slimefun and use nested BukkitRunnables
fucking slimefun
does anyone know a plugin where you can have luckperms roles above a players head (other than tab)?
yo how do you get if the player has max health & max food level
I see getmaxhealth not hunger
whats some good free and paid anti cheats?
Warden
I'm having trouble checking if a tree was bonemealed by a dispenser rather than a player in the StructureGrowEvent but e.isFromBoneMeal() returns false when a dispenser grows the tree. Are there any easy fixes?
@EventHandler
public void treeGrowEvent(StructureGrowEvent e) {if (e.getPlayer() != null) { Player p = e.getPlayer();// p.sendMessage(mainRef.pluginPrefix + ChatColor.GREEN + "You have just grown a " + e.getSpecies().name());
Object customTrees = mainRef.getConfig().get("players." + p.getUniqueId() + ".enabletrees"); if (customTrees == null) { customTrees = true; mainRef.getConfig().set("players." + p.getUniqueId() + ".enabletrees", customTrees); mainRef.getConfig().set("players." + p.getUniqueId() + ".name", p.getName()); mainRef.saveConfig(); } if ((boolean) customTrees) { // intervene and spawn a custom tree... spawnCustomTree(e, p); //event, player } else { // regular spawning do nothing } } else { // if its from bonemeal, then regular tree // otherwise grow a custom tree. if(!e.isFromBonemeal()) { spawnCustomTree(e, null); //event, no player to pass through } } }
How would I set the gamemode to what is specified in the config when an event is run?
I have
String gamemode = getConfig().getString("gamemode-on-death");
player.setGameMode(GameMode.gamemode);
well
you can start by learning java
but what you're probably looking for is the Enum#valueOf method
remember to try-catch and print an informative warn message in console if the string doesn't correspond to a game mode
🤦♂️ ok I seriously dont know how i forgot that, i have used to so many times before
.durability(3)
.owner("")
.name("§eClans online")
.lore("§7 Listar os clans online.")
.build());```
Is there any way to set a custom skull from the website "minecraft-heads.com" on there?
can you help me?
@frigid ember you can try where is says owner put the players name there to see if it will work
@fossil burrow help you with what ?
Ye, it works with players names, but i want to make it with custom heads from minecraft-heads.com, and as i know these heads do not have names
Or yes?
is that I connect a host to my bungee and when trying to enter it takes me out to the lobby
@fossil burrow help you with what ?
@atomic nova
Probably a common question, but I am referencing spigot-1.16.1.jar yet apparently CompassMeta is not in org.bukkit.inventory.meta, which is should be per the docs. (Can I safely paste my docs link?)
is there any way to make the server not load world, world_nether and world_the_end?
World nether and the end yes, but world i think no
You must have at least one world
@fossil burrow help you with what ?
@atomic nova "the server you were previously on went down, you have been connected to a fallback server"
nether & end you just disable them on bukkit.yml and spigot.yml
okay, thanks! :)
No problem 😉
@sharp cradle I would guess no for world, maybe mess with Bukkit.getWorlds()?
removing the option that brings the spigot.yml "bungee: false" lets me enter normal with the ip
Anybody know an open source plugin with a working nether compass?
.durability(3) .owner("") .name("§eClans online") .lore("§7 Listar os clans online.") .build());``` Is there any way to set a custom skull from the website "minecraft-heads.com" on there?
somebody knows?
SoyTermo, sounds like that would depend entirely on how those heads are used. It doesn't sound like a Mojang supported website.
How do you use one outside code?
does anyone know a plugin where you can have luckperms roles above a players head (other than tab)?
. And also is there a plugin other than Chat Manager that can do per world chat?\
for 1.16 ofc
well the normal Heads are easy as you would just put the player name in the Owner slot but the custom ones are generated code that i wouldnt know how to add
I want to set a head that is all green, its just a texture
But as i know, it does not have any name
I know that its possible to do that, but i don't know how :I
help :c > [01:53:47 INFO]: Mark_VR[/181.197.114.153:51602] logged in with entity id 420 at ([lobby]9.883297353712956, 108.5, 47.525309221546635)
[01:53:47 INFO]: Mark_VR lost connection: Internal Exception: java.io.IOException: Error while write(...): Connection reset by peer
[01:53:47 INFO]: ╥﹏╥ Mark_VR.
[01:53:49 WARN]: [VoidGenerator] Task #1474 for VoidGenerator v1.5.1 generated an exception
java.lang.NoSuchMethodError: org.bukkit.entity.Player$Spigot.sendMessage(Lnet/md_5/bungee/api/ChatMessageType;[Lnet/md_5/bungee/api/chat/BaseComponent;)V
at me.xtkq.voidgenerator.a.b$1.run(PlayerLoginListener.java:43) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) ~[server.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [server.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
outdated plugin or something
01:53:47 [SEVERE] [Mark_VR] <-> DownstreamBridge <-> [lobby] - encountered exception
java.lang.IllegalArgumentException: Team viaversion already exists in this scoreboard
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
at net.md_5.bungee.api.score.Scoreboard.addTeam(Scoreboard.java:73)
at net.md_5.bungee.connection.DownstreamBridge.handle(DownstreamBridge.java:210)
at net.md_5.bungee.protocol.packet.Team.handle(Team.java:124)
at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
duplicate teams
@frigid ember can you DM me a link to the head you want and i will see what i can find to make it easier
iirc skulls can hold texture blobs
you can write the texture to the skull yourself probably
@frigid ember from the FAQ on minecraft-heads.com
A custom head is a skull, linked to a texture stored on the servers of Mojang. In contrast to player heads, custom heads don't use playernames. Since the commands you use to get those heads neads NBT-Tags from Minecraft 1.8, you can't use them in earlier versions of the game. Since the skull is directly linked to files on the Mojang servers, the texture will never change.
@frigid ember from the FAQ on minecraft-heads.com
at 1.8.8 is possible to use them
But i don't know how to add it on my plugin
yea, but my point is that player skulls and custom skulls are very different. For example the URL for a custom skull looks like this
textures.minecraft.net/texture/4e1b585abdd6477f594bcfcef84771aa2d42ab85dd4c22a4cc40c27360508c8
Ahh, yes
I agree with u on that
Somebody told me to use HeadDB API, but i don't know how to add it on my plugin
@frigid ember can you DM me a link to the head you want and i will see what i can find to make it easier
Sent
There is a plugin (paid, 10 USD) named "Head Database" for those heads that is also linked on minecraft-heads.com: https://www.spigotmc.org/resources/head-database.14280/
That page links to a HeadDatabaseAPI.jar on mega.nz and also has some example code on how to use that API.
in survival mode, the reach of a player is 3 blocks, but in creative, it is 4 blocks. Is there a way that I can give a player the reach of a creative player? (Out of curiousity)
"Because of how lambda grabs context locally, (copy not reference), you can't use it for things where you need to change the state of the object you're including"
Is this true
and if so Im not sure how to fix it
I really do want to use lambda
lambda isn't meant to be used for everything
nor is it to replace the normal java conventions either
@keen compass I’m using functional interface to change stages in my animation and do it in much less code
and my statement still applies
it might be less code to read, but it doesn't mean the amount of things being done are any less either
all lambda does is basically hides methods or underlying mechanisms. But it still doesn't change the fact that lambda isn't meant to change java conventions or that it is designed to replace everything because it isn't
how can i cast ItemStack to CraftItemStack because i've noticed that when i use getItem in the InventoryClickEvent method getClickedInventory it provides me a CraftItemStack
Hello, for some reason whenever i download a custom dimension datapack, it works in vanilla 1.16 servers and singleplayer, but it doesn't work in spigot, whatsoever
@humble spoke why do you need to do that
@naive wyvern theyre not supported, this is stated in the release notes
im trying to compare two items, and for some reason it saved one items as ItemStack, and the ones that i get from the event are CraftItemStack
== wouldnt work even if they were both itemstack
only use == on numbers unless you know what youre doing
Could I possibly use like multiverse plugin to use custom dimensions?
ok thanks
@fleet crane sorry to bug but can you take a look at https://hub.spigotmc.org/jira/browse/SPIGOT-6038 i believe it to be quite critical but im not 100% sure during my debugging it seemed like something went wrong inside of magic numbers
how could i "refresh" an inventory, because when i set an item on the InventoryClick event, the item in the slot i want it to update wont appear unless i do another InventoryClick event to somehow "refresh" the inventory
Dont you have inventory.update?
doesnt seem so
nvm thought of something different
player.updateInventory is deprecated aswell
but i think grabbing a instance of the inventory involved
and calling set item should modify it
that's what i do, call setItem
unlessi gotta do it twice
and the item in question is null usually
How do I make pvp like 1.8 on a 1.16 server?
Is there any plot plugin that uses the y axis too?
oh ok
😦
I need help
java.lang.IllegalArgumentException: plugin source cannot be null
how do i fix this?
I think I made a mistake in this
public class command implements CommandExecutor {
public static String lobby = "lobby";
private Bungeecord warpTool = new Bungeecord();
private String noPermissions = "§cI'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.";
@Override
public boolean onCommand(CommandSender player, Command command, String s, String[] args) {
if (player instanceof Player){
Player playertmp = (Player) player;
if (command.getName().equalsIgnoreCase("lobby")){
playertmp.sendMessage("warping...");
Game plugin = Game.getInstance();
try{
warpTool.Connect((Player) player,"lobby");
}catch(Exception e){
player.sendMessage(e.toString());
}
}
}
return true;
}
}
anyone? help
HELP
?help
HELP?
anyone???
https://pastebin.com/RxbJHnW3 guys i tried running 1.11.2 server but it keeps crashing
and this is the crash-report i get
idk
Hello anyone able to help with command blocks on spigot. The command block does not detect a named item for being shifted around in my inventory on a spigot server but is able to do so a vanilla single player. The command block is only able to detect shifted items on spigot provided it is not named at all. The paste bin below is the item I am trying to test using the execute command in the command block on spigot
hmmm apparently not
does anyone knows a good minigame plugin?
thats very unspecific
Still not specific
then idk how to help
oof
java.lang.IllegalArgumentException: plugin source cannot be null
what could this mean
Hello anyone able to help with command blocks on spigot. The command block does not detect a named item for being shifted around in my inventory on a spigot server but is able to do so a vanilla single player. The command block is only able to detect shifted items on spigot provided it is not named at all. The paste bin below is the item I am trying to test using the execute command in the command block on spigot
@midnight lichen I already told you above, spigot changes the json slightly when you shift click it
look at what the new json is and change to using that
@strong lantern spamming won’t get you help.
And have you noticed how no one has gave you an answer?
How do I look at the new json @fleet crane
@wicked cape why, becuase nobody knows?
@wicked cape I only sent it twice and u call it spamming.
https://paste.md-5.net/usovovesup.java <- Main
https://paste.md-5.net/voxihonure.java <- Data class
I'm making a plugin which stores information about player deaths it should send all the deaths located in the HashMultimap maximum of 3, but it just sends the first information and nothing more than that
is hashmultimap even a thing lol
it is
oh lmao com.google.common.collect.HashMultimap;
can store multiple values for a key
but you have a object storing
why would you even need more values
for same key
oh lmao
so you have multiple
you store only 1 death inside just noticed
so how is this better than simply doing HashMap<UUID,List/Set<Data>> ?
I need to store 3 deaths and keep the information about those
until a fourth death of the player 'happends' and the last one is removed
thats how it should be at least
that didnt rly answer my last question though
regular hashmaps cant store info about last 3 deaths?
when you put the info in thee last info is removed
a hashmap can store a list or a set or pretty much everything
you simply make a set/list holding 3 datas
tbh never heard of it till now
oh actually not much difference i guess
@frigid ember you can also go bit longer and lazy way
have a hashmap holding a object that stores the 3 datas inside them
lol
nah I will make a set
but to put this in java dataMap.put(uuid, new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
how am I supposed to fit this in since its a set now? new Data(...)
well i would have a method for it as there are some conditions now
Set<Data> deaths = new HashSet<>();
deaths.add(new Data(location,death...);
dataMap.put(uuid,deaths);
}```
how do i make a spigot egg for my pterodactyl servers?
wut?
yes
a Set is basically a list of them
wich keeps count to never have same object
to avoid duplicates
ok ima try it ty
shouldnt be that hard to get into maps theyr rly usefull
you should use the computeIfAbsent method for Maps.
how do i check if the cursor is holding an item in an InventoryClick event?
@humble spoke https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryClickEvent.html#getCursor()
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
no, since im storing 3 values basically
@frigid ember I meant like this:
public class Main {
public static void main(String[] args) {
final Main main = new Main();
main.addObject("test", new Object());
main.addObject("test", new Object());
main.addObject("test", new Object());
System.out.println(main.objects.get("test")); // prints the 3 objects that were just added.
}
private final Map<String, List<Object>> objects = new HashMap<>();
public void addObject(String key, Object object) {
objects.computeIfAbsent(key, (unused) -> new ArrayList<>()).add(object);
}
}
yeah i know that method but
when i debugged and found out its simply an empty air itemstack and i tried to compare it to it with equals it just didnt work
With the above, it should function similar to that hashmultimap.
@humble spoke you can always check currentitem before checking cursor
to know if he clicked on a item
ah the thing is that inventoryclick for me runs before the item gets actually put into the thing
which is not preferred for me
its a bit wanky using the event i saw inconsistency
so i just make a new item array with the chest ,and the replace the clicked item slot with the item i nthe cursor so i get the updated chest
in some thing
interesting
can I have protocolib and viaversion on the same server
test it and find out
If stuff goes wron just remove the plug in
fine
i have a better ideea
simply do a local server lol
like everyone else testing stuff
if(!dataMap.containsKey(uuid)) {```
@vernal spruce
but I have to store multiple
and doing this in my event doesnt make sence?
basically its a simpler way to check if a set exists
if yes,take it and add it to the list
dataMap.get(uuid).add(new Data(stuff));
you can also simply do dataMap.get(uuid).size() to get the size of the set
so you can limit it to 3 as you wanted
and how do I remove oldest so 4th one when the player died 4 times
also are you saving them somewhere?
to get oldest its a bit tricky
you can loop through all entrys in the set and stop at first
as it should be the 3rd in the newest
Set<Data> deaths = dataMap.get(uuid);
for(Data death : deaths){
death.remove(death);
break;
}
any idea why do i get:The method sendMessage(BaseComponent) in the type CommandSender.Spigot is not applicable for the arguments (ChatMessageType, TextComponent)
i worked for me normally
and still works in other plugins
is it because its an entity and not a Player?
if(!dataMap.containsKey(uuid)) {
Set<Data> death = new HashSet<>();
death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
dataMap.put(uuid, death);
if(dataMap.containsKey(uuid)) {
Set<Data> deaths = dataMap.get(uuid);
for(Data deathts : deaths) {
death.remove(deathts);
break;
}
}
}```
it will always
but I still have to get the amount of times something is stored
trigger the 2nd if
return at the end of first condition
i already told you dataMap.get(uuid).size() will return how many "Data" objects is in that set
ojj yea
anyone anything on my problem please?
Set<Data> deaths = dataMap.get(uuid);
for(Data deathts : deaths) {
death.remove(deathts);
break;
}```
yep
and this will remove all info about the player?
as it goes in a row
0-1-2 so 0 will go first in the loop
then 1 becomes 0 and so on
if(dataMap.containsKey(uuid)) {
Integer uuidsize = dataMap.get(uuid).size();
if (uuidsize == 4) {
Set<Data> deaths = dataMap.get(uuid);
for(Data deathts : deaths) {
death.remove(deathts);
break;
}
}
}```
result
Hello i am coding a minecraft plugin and here is the code it is for 1.15 using java 1.8 ``` package me.EpicGamese.HelloWorld.Events;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
public class EventsClass implements Listener {
@EventHandler
public void onMove (PlayerMoveEvent event) {
System.out.print(1);
}
}
ok
and when i move it says can not find org.bukkit.event.Listener but it is there as u can see
if(dataMap.containsKey(uuid)) {
Integer uuidsize = dataMap.get(uuid).size();
if (uuidsize == 4) {
Set<Data> deaths = dataMap.get(uuid);
for(Data deathts : deaths) {
death.remove(deathts);
break;
}
}
}```
@frigid ember you can shorten it
Stellrow thx works perfectly now!:)
simply do if(dataMap.get(uuid).size()>=4{stuff}
is there like a post inventory click event that fires after the item gets put into the inventory or something like that?
@humble spoke normally it should also fire again
like puttin a item from a chest to inventory shouldbe 2 events
it doesnt seem to fire twice for me
yeah its bit inconsistent
maybe the inventory check is wrong?
i often forgot that once clicked in player inventory a inventorycheck above wont trigger
wdym
if(event.getclickedinventory.equals(specificinventory))
ah
well i only need to focus on the top inventory
so if that woulnt run i wouldnt be missing out too much
also yeah it doesnt seem to fire twice
the event
can i havse some help
ohh wait ima try somet
???
?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.
when i move the player it says it is unable to find org.bukkit.event.Listener; but here in the code it is there package me.EpicGamese.HelloWorld.Events;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
public class EventsClass implements Listener {
@EventHandler
public void onMove (PlayerMoveEvent event) {
System.out.print(1);
}
}
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
public class EventsClass implements Listener {
@EventHandler
public void onMove (PlayerMoveEvent event) {
System.out.print(1);
}
}
did you also registered the event?
yep here is the main.js file
import org.bukkit.plugin.java.JavaPlugin;
import me.EpicGamese.HelloWorld.Events.EventsClass;
import net.md_5.bungee.api.ChatColor;
public class Main extends JavaPlugin {
public void onEnable() {
getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "\n\nHelloWorld has been Enabled!\n\n");
getServer().getPluginManager().registerEvents(new EventsClass(), this);
}
public void onDisable() {
getServer().getConsoleSender().sendMessage(ChatColor.RED + "\n\nHelloWorld has been Disabled!\n\n");
}
}
yep
it doe find org.bukkit.event.Listener;
that is what it says in console
cant find import org.bukkit.event.Listener
post the console error
hmm looks like its typed in there ngl
its no but ok
Also why you want to work
with moveevent its the most delicate thing you can test on..
as it called a huge amount of times
i dont know i wanted to see if i could crash my server
well that might be why is it even stopping you
with my own plugin
ok well i will create somthing else with it and see if it comes up with the same error bye and thanks for the help
there isnt EntityMoveEvent but is there anything similar to that?
nope
if there is one is simply hidden
as tracking the movement of 50k entities will kill pretty much everything
you might be able to do a workaround though
what you trying to do
i only wanna stop hostiles so yeah that might make it less laggy
i mean you cant rly track entities that easly
you might even be able to do it async
I need help with voting plugin and get it 2 work, it dosen't give out rewards 20$ to whoever has the time today 2 help out.
StellRow
?
it only sends the first one
yeah i was afraid of that
time to simply change to list
as it has the methods ,get(index),remove(index),set(index)
so you can simply go to that entry
set sadly lacks
.get(uuid) will get the info
What are you trying to do?
post how you created the hashmap
good,also that final is not really needed
main
whats the papi for a date that doesnt have time?
@frigid ember switch the set to a list
My papi holds y/m/d 1:00 something and i want it to get rid of the time
have you checked papi wiki at least?
likely ArrayList
there you go a object wich does what you need
now simply make a HashMap<UUID,PlayerDeaths>
this should be loaded/created when a player joins the server
He can just use an ArrayListMultiMap
Hello, is there a way to find out from which direction a block is mined (so not just where the player is standing relative to it but what side of the block is attacked)?
@undone dome well you will have to make a connection between blockbreak and interactevent
as only interactevent holds the face clicked
thank you
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
no stellrow
I need the 3 newest entries
oldest can be removed
idc about those
when a newer one joins in the newdeath->0 0->1 1->2 3->removeddeath
And thats what i said,you need to know wich one is the oldest that its gonna be removed when the limit reaches
what is the bukkit name for hostile mobs?
instanceof Monster
@frigid ember yes,now you have acces to index numbers(entrys)
The list should fill up from 0 meaning 0 will always be the oldest
So when the size is more than 3 simply call .remove(0)
works now btw ty
field names should start with a lowercase
i know but if i do like 4 times it already makes the mobs able to move a bit
So i want to make it so if the player enters a command it asks the player if he's sure and the player needs to enter the command again. How do i do that?
@subtle bison that's not very good imo
instead of having the player type the command 2 times you could make them click the message to confirm
Ronsiv
@subtle bison you want every hostile mob to not be able to move?
yeah lmao
You can listen to creaturespawnevent and set the base movement speed to 0
ohhhh
if(!dataMap.containsKey(uuid)) {
List<Data> death = new ArrayList<>();
death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
dataMap.put(uuid, death);
if(dataMap.containsKey(uuid)) {
if (dataMap.get(uuid).size()>=4) {
List<Data> deaths = dataMap.get(uuid);
//for(Data deathts : deaths) {
deaths.remove(0);
//break;
//}
}
}
}```
Stellrow?
Return after first condition
return;?
try instead
how can i set the ClickEvent of a message to call a method?
or do i have to make a command?
List<Data> something = dataMap.get(uuid);
if (something != null && something.size >= 4) {
//do your thing
}
save performance 👀
and clean the code a bit
for (Data data : dataMap.get(uuid)) {
player.sendMessage(applyCC("&6World:&f " + data.getLocation().getWorld().getName()));
this.cooldown.put(player.getUniqueId(), now);
System.out.println("1");
return true;
}```
what do I do to print the info about the whole list instead
well
message
not print
TextComponent something = new TextComponent(yourString);
something.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "your command"));
(doesnt have to be RUN_COMMAND)
@dusky sigil
you will figure out how to add hover event etc.
stellrow did you mean it this way?
@subtle bisonLivingEntity liv = (LivingEntity)event.getEntity(); liv.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0);
No need for a runnable here
stellrow :p
okay didnt know that was a thing
collection of items
you want to set a drop?
which event
probably EntityDeathEvent
event?
and get its type
@vernal spruce How would I send info about the whole list to the player
instead of first thing stored
new ItemStack(event.getBlock().getDrops()., ThreadLocalRandom.current().nextInt(1000) what would i put after the getDrops(). ?
new ItemStack(event.getBlock().getDrops().toString(), ThreadLocalRandom.current().nextInt(1000)
may be your new line
thats my only idea its probably not gonna work tho
wait
why are you putting the getBlock()
i dont think that should be there
just event.getDrops()
if your event is BlockBreakEvent
My voting plugin does not work, it dosen't give me any rewards. Any help?
https://pastebin.com/TjsmHkKq
@frigid ember make a mehod inside the data class wich returns the full info "location death reason" the simply loop through all entrys in the list and send that info to the player
@subtle bison no you need to do get block it doesnt let me do event.getDrops()
yeah just tested it too
public Data(Location location, String reason, long time) {
this.location = location;
this.reason = reason;
this.time = time;
}```
so Data
@vernal spruce
how do u select an element in a collection then?
@blazing burrow you could get the block type and then get the drops of that block type
if you still wanna get the drops
so what do you need the list of drops for then
you can create a new itemstack if you want custom drops
Why is this not working? java dismessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/f disbandabcttyejs")); dismessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Click Here to disband").color(ChatColor.GRAY).italic(true).create())); p.spigot().sendMessage(dismessage); factionname = args[1]; and than: java if (label.equalsIgnoreCase("f disbandabcttyejs")) { cfgtotal.set("faction." + factionname, null); p.sendMessage(ChatColor.GREEN + "Your faction has been disbanded. So long!"); try { cfgtotal.save(filetotal); } catch (IOException e) { e.printStackTrace(); } }
also factionname is a public string
I click the message and nothing happenes
any errors?
nope
for (Data data : dataMap.get(uuid)) {``` I'm already looping through all info? @vernal spruce
is /f disbandabcttyejs the correct command?
player.sendMessage(ChatColor.GRAY + "World " + ChatColor.WHITE + worldName + ChatColor.GRAY +
" doesn't exist. Please specify and existing world.");
TextComponent worldOffer = new TextComponent("Click here if you would like to create a new world " + worldName);
worldOffer.setColor(net.md_5.bungee.api.ChatColor.GRAY);
worldOffer.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/newworld " + worldName));
worldOffer.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/newworld " + worldName));
worldOffer.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new ComponentBuilder("Click here to create a new world " + worldName).color(net.md_5.bungee.api.ChatColor.YELLOW).create()));
player.spigot().sendMessage(worldOffer);
return true;
this is my code
works fine
How do i kick a player if he sends an explicit message
@subtle bison the message gets sent, when i click nothing happens
@umbral dirge player.kickPlayer(playerName);
& when you hover?
yeah, works too
no what im trying to do is whenever a player breaks a block it drops a block and the drops are randomly from 0 to 1000
nvm
ItemStack drop = (ItemStack) event.getBlock().getDrops().iterator().next();
would this work
got it
Use blockDropItemEvent
why would you format it like that
@dusky sigil then the problem probably isnt with the clickable message but with your code
the code u use to disband a faction
idk man i looked online and thats what they suggest with java collections
i tried now
and
well
it kinda sudo's you lol
its prob a problem with my code hold on
yeah if you remove it its like player.chat
for (Data data : dataMap.get(uuid)) {``` I'm already looping through all info? @vernal spruce
@frigid ember but maybe this only gets the first info somehow?
maybe i cant set a config key to null?
@blazing burrow ItemStack is = new ItemStack(Material.DIAMOND, 64)
which would be weird
@dusky sigil yeah thats probably the problem
@subtle bison what
thats how you create an itemstack
yeah no i know that
what im trying to do is using an item stack cast to get the first element in the collection of items returned by getDrops()
dropItemNaturally(new ItemStack(e.getDrops()), e.getPlayer.getLocation());
You can probably to .toArray on the collection.
i told him and it probably dint work
dropItemNaturally(new ItemStack(e.getDrops()), e.getPlayer.getLocation());
No
ItemStack first = event.getDrops().toArray()[0]
Although I don't see a that practical use to it.
oh
no @frigid ember itemstack needs a type getdrops returnd a collection
.getType()
Is e.getDrops.get(0) not valid
if you can do that atleast
i tried my thing it works XD
get(int index) only exists on lists IIRC.
ItemStack drop = (ItemStack) event.getBlock().getDrops().iterator().next();
this made it work
Hello, what's the best way to look trough a folder to grab all the files and find the correct data thanks
Coll
It should exist in other collections I assume
Not HashSet though
Files.walk(Path path) works. There's also a list files method on a File IIRC.
@silver pewter i dont think its hard you can look it up
I need to send the player info about his last 3 deaths
https://paste.md-5.net/eyehakabam.cpp data class
but it isnt working
I've done this java for (File file : new File(plugin.getDataFolder().getAbsolutePath() + File.separator + "GuildsData").listFiles()) { YamlConfiguration conf = YamlConfiguration.loadConfiguration(file); return new ConfigManager(conf.getString("name") + ".yml", plugin.getDataFolder(), "GuildsData", plugin); } but It's returning null
it only sends info about the first storement
I’m surprised that works at all
;?
Ah wait no that makes sense
Files.walk(plugin.getDataFolder().toPath().resolve("GuildsData")) if you don't mind a stream
Remove the return true; from inside the loop that prints deaths
I don't mind a stream lol
I'm on mobile so lemme go screen some code rq.
Stupid GitHub says no coz you can't resize 😐
Haha thanks for this I've never got all the files before so It's something new
still only sends whats stored first @lone fog
okay guys i have a problem, now if i break grass blocks it drops dirt which is fine that was the problem i was trying solve earlier, but if i break spruce logs, it drops oak logs?
Are you in old version
1.16
1.16
Weird
I'm using 1.8.8
@blazing burrow try setting and api-version maybe
wait what
It works better if you code 1.8 then it works with 1.16
last thing didnt really work, but i have this config: ```yml
factions: ''
players:
- dfac08af-af88-42ff-8509-8f441bca858b
factionnames: - test
faction:
test:
leader: dfac08af-af88-42ff-8509-8f441bca858b
Members: 1
MemberNames:- dfac08af-af88-42ff-8509-8f441bca858b
and im doing this:cfgtotal.set("faction." + factionname, null);i looked it up and it SHOULD delete all of the test: making the config look like this:yml
factions: ''
players:
- dfac08af-af88-42ff-8509-8f441bca858b
- dfac08af-af88-42ff-8509-8f441bca858b
factionnames: - test
faction:
You aren’t adding to the list if it already exists
@dusky sigil can we see the code in which you are removing it?
ohh
you already saw it but sure java cfgtotal.set("faction." + factionname, null); p.sendMessage(ChatColor.GREEN + "Your faction has been disbanded. So long!"); try { cfgtotal.save(filetotal); } catch (IOException e) { e.printStackTrace(); } }
List<Data> deaths = dataMap.get(uuid);
if (deaths.size() >= 4) {
deaths.remove(0);
/*for(Data deathts : deaths) {
break;
}*/
}
}
}```
factionname should be correct
That part
I see :/
What's his issue?
if(dataMap.containsKey(uuid)) {
death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));
List<Data> deaths = dataMap.get(uuid);
if (deaths.size() >= 4) {
deaths.remove(0);```
so this should fix it
ima try
ok
And then map.put it again
I know this isnt coding but with the /server command, can you send other players? Like /server lobby glassykiller
yes
It has a separate command iirc, so I don't think it works with /server (might tho). /Send.
@subtle bison wdym setting and api version
Thank u
@blazing burrow in plugin.yml put
api-version: 1.13
@dusky sigil i think i see your problem
Im listening
name: RandomMC version: 1.0 author: AtinChing main: me.atin.rand.Second commands: random: aliases: [randomit]
so would it be before or after version or what @subtle bison
now it sends the first info twice
ok
@dusky sigil wait is it stored in config.yml?
Change the second if to an else if
of then im not sure
try to watch this it might help https://www.youtube.com/watch?v=-ZrIjYXOkn0
Custom config files! Woo, save that data!
P.S I always pronounce "parser" wrong :(
------ Links ------
Download Eclipse: https://www.eclipse.org/downloads/packages/release/2019-03/r/eclipse-ide-java-developers
Download Spigot: https://getbukkit.org/download/spigot
Build S...
ronsiv you just need to get into your filed and then do
.getStringList("faction").remove("test");