#help-archived
1 messages · Page 37 of 1
We can't help you block something if you don't tell us how to do it lol
the wurst client thing only works if you have a cracked server with bad passwords or if you have no firewall protecting your bungeecord install
Op-sign
errr
well it worked on my premium server
they use a wurst hack to get the command /op ThereName and they are op
Why would you have such a plugin enabled in production?
nono, it's part of the hacked client lol
My apologies
the op sign thing also only works on vanilla mc it doesn't work on spigot
"only works on servers running Minecraft 1.8 - 1.8.5 without Spigot"
But yeah, I thought that worldedit thing got fixed...
it was a massive thing back in 2016
yeah i'd be surprised if it wasn't fixed already but i have all the filters for it in place still from when it was a thing
the PEX bug was funny as well you could just type /pex and hit tab and the server would die
when pex was a thing
lmao i didnt hear about that one i've just been using chatcontrol rules for everything
Yeah, someone got like a stupid amount of downloads for it bc no one could be bothered to fix it at first xD
@radiant hollow do you use acf in plotsquared?
use FAWE to stop the calc thing
so how can hackers possibly get op on my server if it is bukkit/spigot premium and i'm the only op
because op people are literally clicking on the signs which run a command
so how can i block signs from being used ?
have people actually gotten op on your server or are you just worried that it could happen
because if your server is premium then there isn't a way
i have got 3 person which got op in the night
do you use bungeecord
how do i know ?
if you don't know then you don't use it
i recommend looking in your servers log files
i did
search for the people who got op, see what commands they've been running
you can run the //eval and //calc stuff without being OP
did they actually show up in your OPs file or did they just say they have it
still plugin no work
it prints out true for launch being null
checking
FatalPacket says FAWE solves the calc issue so put this plugin on your server and get someone to run the //calc command and see if it crashes https://www.spigotmc.org/resources/fast-async-worldedit-voxelsniper.13932/
package com.lonnonjamesd.Launch;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
// startup, reloads, plugin reloads
System.out.println((this.getCommand("Launch") ==null));
this.getCommand("Launch").setExecutor(new Launch());
}
@Override
public void onDisable() {
// shutdown, reloads, plugin reloads
}
}
do you loose op when u get banned ? They are not op on the file
package com.lonnonjamesd.Launch;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Launch implements CommandExecutor {
// Launch command!
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
// /launch
if (player.hasPermission("launch.use") || player.hasPermission("launch.*")) {
if (args.length == 0) {
// launch normally
player.sendMessage(ChatColor.LIGHT_PURPLE + "Zoom boy");
player.setVelocity(player.getLocation().getDirection().multiply(2).setY(2));
return true;
// launch [number]
} else {
// launch with the arg they sent
player.sendMessage(ChatColor.DARK_PURPLE + "Zoom boy");
player.setVelocity(player.getLocation().getDirection().multiply(Integer.parseInt(args[0])).setY(2));
return true;
}
} else {
player.sendMessage(ChatColor.DARK_RED + "You don't have access to that boy!");
}
} else {
Player player = (Player) sender;
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&oConsole Goes Flying!"));
}
return false;
}
}
main: com.lonnonjamesd.Launch.Main
name: LaunchPlugin
version: 0.1
author: LonnonjamesD
api-version: 1.15
Commands:
Launch:
aliases: lch
usage: "/launch <number>"```
it does not launch
no you don't lose op when you get banned, if they arent in your ops file it is likely they were never op
it's highly liekly they just did the worldedit crash exploit thing and pretended to be op and your mods got freaked out lol
there isn't a way to give yourself OP on a premium spigot server
unless you use like mcmyadmin and login to the default rcon password
ye but i doubt thats the case here
it ismt, but its fun xd
small thing: this kind of comment // /launch is unnecessary
did you add the command in plugin.yml as well
whats on line 11? @stark lodge
Hi guys, i have a question, i'm not an expert, but can i create a database on my vps where im hosting my servers too? I want to sync authme, skinsrestorer, fastlogin etc.. in the database.
I don't know if it's possible
yes @wind peak you definitely can
Umh.. could you explain me how? D: @arctic cloud
I restarted and still same error
Is it a Linux VPS?
Yes
well just install mysql
by apt or yum or if its different y the fuc did u choose it
Yeah I was looking for that digitalocean post
do note that a lot of stuff doesn't support MySQL 8.x so you might need 5.x I'd check with the plugins first
@stark lodge whats this for? System.out.println((this.getCommand("Launch") ==null)); was this for debugging?
yes
what is it printing
Uh ok, btw i can follow this guide, ty
true
np
@wind peak which Linux distro do you use btw?
CentOS 8 64bit
Commands: in your plugin yml change it to commands:
yaml is case sensitive
@stark lodge
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-8
@arctic cloud Ah ok, but i still have to check if plugins supports it, right?
To be honest I’m using the newest mysql build and I haven’t ran into any plugin incompatibilities
To be honest I’m using the newest mysql build and I haven’t ran into any plugin incompatibilities
@hollow rivet Okay, thanks to both😄
np
Ah ok, but i still have to check if plugins supports it, right?
@wind peak I don't think the syntax changed
is Bukkit.getofflineplayer ever returning null?
if there is no player with this uuid in the mojang auth
oh no it doesn't, then it just won't fetch the other data
I mean
both MyBB & Pterodactyl Panel don't support it which are pretty big softwares so I wouldn't be surprised if some plugin made by joethecoder42069 doesn't support both
I think wiki.vg is outdated
I think I had to create a custom version
Aka clone 1.15 and Change the log4j config in the version.json or smth
Forgot how the launcher format works
{"argument": "-Dlog4j.configurationFile=${path}", "file": {"id": "client-1.12.xml", in 1.15.2.json
smh
is there a way to disable commands from being sent to console:
how can i get all persistent data values from the minecraft namespace?
yes^^
i want to save all values from spawners, ...
to save it in the config
with the blockdata
get metadata save metadata?
how?
hmm
i need it for the whole block
okay, it seems I can change the default .xml files - however, upon modifying them they like to change themselves back
I'll try removing that argument from the json
and see if it lets me use my own then
noope lol
does not like it being changed
i wonder what it's checking against - there is no JSON file even there now
Just completely ignoring the json 😅
Can confirm that changing the sha1 checksum & the filesize still does not let me just change the logging config
Hey, i've a problem : He tells me my task is still in progress while I cancel it :x
Show code?
I think you're starting them too close to each other
Try setting a 1 or 2 tick delay on starting again
I'm going to try this
.-. I give up with logging
yeah it's a mess in Spigot
AvroVulcan i've the same problem
can you show the start code
just show the whole startingTask object class if possible
I think you need to create a new instance of the runnable
and run it
every time you stop it
I don't think you can register / unregister over and over
keywords: I think
yes
This scheduler stuff confuses me, I'm just running normal Threads and synchronize them
uhm language
What?
What are you doing? In which language you are working
donc work avrovulcan
Spigot?
I mean
Im doing this
if (label.equalsIgnoreCase("Play"))
{
if (sender instanceof Player)
{
//player
Player player = (Player) sender;
if (player.hasPermission("play.use") == true)
{
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user " + player + " parent add player");
player.sendMessage(ChatColor.BLUE + "You have been granted access to play the game.");
return true;
}
player.sendMessage("You do not have access to this command.");
return true;
}else {
//console
sender.sendMessage("ERROR: You are using the console for this command. It is only usable by players.");
return true;
}
}```
And want the player to be _Novato
Not the thing it is now
So it can be used to type a command into console
player.getName()
thanks
Anyone have any idea why I get kicked for this? I'd assume a plugin is doing something naughty 🕵️♂️ https://pastebin.com/raw/QGPYGzUx
looks like your scoreboard plugin is broken potentially
you should be good to delete your scoreboard.dat from your world and it will reset the teams that have been generated by it
@ocean prism sorry to @ but i love that color scheme looks nice 😍
@inland meteor is it possible to see my scoreboards? I'd assume its a plugin that fires every so often causing it? I Only get kicked once an hour?
Also, If i delete the file, Is there anything saved important in the scoreboard.dat?
I Had a quick look inside the file and it just seems to be 1000s of mythicmobs crap in it.. https://i.gyazo.com/1575bb87f34245543a59ae1b54b563d5.gif
So it's safe to delete and nothing will be lost?
How do you update scoreboards? Whenever I set the score again it just duplicated on the scoreboard
You'd need to remove the old score
Hey guys i really need help!
I am trying to open a spigot server so me and my friends can play on it.
but they can't join the server and when i checked in port checker it say's the port is closed.
I did portforward for minecraft with my ipv4 and checked if my friends can join with my external ip which didn't work so
I allowed all the java apps to communicate through windows firewall.
i added the rules of the ports to the inbound rules and outbound rules for tcp and udp for the minecraft port 25565.
and it still didn't work
so i called my internet provider and asked them what is the problem they went through all of my config for the port and if i messed up something there but they told me everything is okay and there isn't any problem in the config, i heard that sometimes the internet provider doesn't allow ports to go through but they said it isn't the case.
and so here i am with absolutely no idea what to do.
I would appreciate if someone can help me!
otherwise you're just adding new entries into the scoreboard
Now, the "no flicker" scoreboards, actually just abuse the prefix/suffix for the team and send a single update for it, vs a remove + add
Hm, I set the player's scoreboard to a blank scoreboard, set the scores and then set their scoreboard back to the normal one.
player.setScoreboard(blankBoard);
Score balance = o.getScore(Formatting.colorize("&2 &aBalance: &7£" + String.valueOf(MineTropical.playerEconomy.getConfig().getInt(player.getUniqueId() + ".econBalance"))));
balance.setScore(12);
Score rank = o.getScore(Formatting.colorize("&2 &aRank: &7" + VaultAPI.chat.getGroupPrefix(player.getWorld().getName(), VaultAPI.permission.getPrimaryGroup(player))));
rank.setScore(13);
Score nickname = o.getScore(Formatting.colorize("&2 &aNickname: &7" + player.getDisplayName()));
nickname.setScore(14);
player.setScoreboard(board);
@wanton juniper are you hosting from home?
yes
and you are using a Router, correct?
correct
Did you forward ports on your router?
yes
okay thanks
So, I'm removing the scoreboard, changing the scores and then setting the scoreboard again but it duplicates
No worries, fixed it
i got a problem with my spigot server, it says i need to active ip fowarding, i put true but it continues saying that
do you have the repository added
yes
Why not 7?
Reeeee
looks fine, but I don't think WG 7.0 is on 1.8
okay, so the groupId is com.sk89q
artifact id is worldguard
and version is 6.1
(i think)
Still red, maybe it's the repo?
it can't be, since you can literally view everything
@ashen stirrup IntelliJ?
Yeah
Right click the project in the top left, go to maven, and go to reimport
someone ps
@finite belfry be patient lol
Rayvel, is that a crash log or the latest log?
@finite belfry:
[13:46:05] [Server thread/ERROR]: [Multiverse-Core] The world 'skywars' could NOT be loaded because it contains errors and is probably corrupt!
[13:46:05] [Server thread/ERROR]: [Multiverse-Core] Try using Minecraft Region Fixer to repair your world! 'skywars'
[13:46:05] [Server thread/ERROR]: [Multiverse-Core] https://github.com/Fenixin/Minecraft-Region-Fixer
Cheers @inland meteor , worked!
Yeah, but I'm saying if it crashed and he's relying on that world, that could be why
Cheers @inland meteor , worked!
@ashen stirrup No worries 🙂 IntelliJ with maven has been stupidly glitchy recently for some reason recently (at least for me)
Someone here that has a good price list for minecraft 1.15.2 signshops ?
be patient
Hello is there a plugin that allows you to change the loot from lapis ore to random ore (diamond, gold, iron, ...)
Can do with a datapack
yes
how to get the block name the user clicked with an event
so how do i solve this
Can't keep up! Is the server overloaded? Running 8377ms or 167 ticks behind
How much ram have you got on your server and what version are you running @finite belfry
You don't need to @ me right after you send, I'm just looking into stuff
ok
do event listeners need something in a plugin.yml
no
you just gotta register them in your main class
how to get the block name the user clicked with an event
@stark lodgePlayerInteractEvent>event.getClickedBlock().getType().toString()
should work
Hello is there a plugin that allows you to change the loot from lapis ore to random ore (diamond, gold, iron, ...)
@frigid ember https://www.spigotmc.org/resources/dropedit-2-advanced-drop-editor.60331/ this might work for what you want?
so this is my console rn
@finite belfry "SuperLobby" is causing those errors
ok
@inland meteor Thank you !!!! 😄
@inland meteor Thank you !!!! 😄
@frigid ember No problem 🙂
is spigot expensive as I am thinking of opening a server
Alrighty, so in my minigame framework, I am supporting multiple signs per arena. In my ArenaSign class, I could have multiple instances of the ArenaClass where everything is the same for signs with the same arena just a different location, or I could have a Set of Location instances and update those locations instead of querying multiple times in my ArenaSignHandler class. What would you lot suggest for the sake of readability? Multiple locations per ArenaSign instance? Or multiple ArenaSign instances for each new location?
I'm just on the fence, because of efficiency and readability -_-
is spigot expensive as I am thinking of opening a server
@proud lynx Spigot itself is free
Because you need hosting to go along with it
Hosting is cheap, depending on what you're after. To make a booming server with plenty of players, that isn't cheap. Takes much time and money to maintain it.
So you buy server space from a host, to run the spigot server on
Either finding/hiring builders, hire artists unless you have talent and can do it yourself, developers unless you're a Java developer and have the time to do it all yourself
Like major said
@EventHandler
public void PlayerInteract(PlayerInteractEvent event) {
System.out.println(event.getClickedBlock().getType().toString());
}``` how to make it so this doesn't give me errors when it's air
if(event.getClickedBlock() != null && event.getClickedBlock().getType() != Material.AIR)
Pretty sure there's a cleaner way, lemme see
oh wait
yeah
fuck
if(event.getAction() == Action.RIGHT_CLICK_BLOCK)
same with left click
Yeah, that's the one
@stark lodge:
@EventHandler
public void PlayerInteract(PlayerInteractEvent event) {
if(event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
System.out.println(event.getClickedBlock().getType().toString());
}
}
welp i dont know how to setup the spigot app
event.getClickedBlock() != null is this possible
Or if you only want it to count if you punch or right click only, change accordingly.
Yes trapped, but Air still counts as not null I believe
Apparently it is null, otherwise getType().toString() would just return AIR
ahh
is there a way to hide the NeutralPlasma issued server command: /login 123 from console?
I can never remember
getType().name()
Well, for the sake of chunk loading/only updating signs that are loaded I'll go new ArenaSign instance per location
is there a way to hide the
NeutralPlasma issued server command: /login 123from console?
@frigid ember spigot.yml > Commands > log: false
thanks benh
how to make it so the plugin looks for chests with a certain item in them
What do you mean looks for chests
so you want it to check every chest?
then it turns that chest into a diamond block
or just when you place the item in
does anyone know how to set up viaversions 1.15 so 1.8 + can join
You'll need an Inventory history per location.
If you want to support hoppers, furances etc as well.
when I place the item in
does anyone know how to set up viaversions 1.15 so 1.8 + can join
@sturdy inlet ViaVersion-Abstraction + ViaBackwards-Abstraction
Didn't realize Abstraction was a thing tbh
lol
so i just get those and shoudl work
should do yeah 🙂
so how would I detect if someone put a certain item in a chest
https://www.spigotmc.org/resources/ultimatebossbar-the-best-boss-bar-plugin-out-there-now-supports-all-versions.19303/ how do i copy the config file
@stark lodge i love ur pfp
ty
InventoryClickEvent, check if the inventory is a 27 or 54 slots, but then you have the issue of custom inventories I suppose, you'd have to check the inventory name as well
But I suppose you need the Location as well
InventoryClickEvent, PlayerMoveItemEvent
can I get an explaination of what I do
anybody help me how to copy of this config file? https://www.spigotmc.org/resources/ultimatebossbar-the-best-boss-bar-plugin-out-there-now-supports-all-versions.19303/
What do you mean lopi?
When you first launch the server with this plugin, the config should load up
InventoryHistory.java, store Map<Location, Inventory>, store in a config file, only load it when needed, don't immediately load into memory or that'll be too resource consuming
Fetch/store inventories when someone interacts with a chest (check with PlayerInteractEvent)
for me?
Then you can grab the inventory by location whenever needed
Yes
I feel like there's an easier way to do this with world files though idk
I just want to put shears in a chest and it will do something
this is complicated
is there no way you can just listen to the chests the players are near
Oh, I thought you just wanted to have a backup of the inventory for when your plugin turns it into something
So let me get this straight, you want it so whenever someone puts a particular item in a chest, that chest will change into another type of block?
or it will do something else like deleting the item in the chest or something, but yes
did you get an error in the server log?
no
Is there any simple way of recording the number of blockx broken
the plugin doesnt even appear when i do /plugins
that means it didn't load
Okay, @stark lodge search for PlayerInteractEvent, listen for Action.RIGHT_CLICK_BLOCK
where is the jar file
in plugins
and there's no errors in your console?
Make sure the block is a chest, cast it as a chest and grab the inventory, store the inventory instance within the class and in another class, listen for InventoryClickEvent, make sure the inventory viewers match.
Is there any simple way of recording the number of blockx broken
@blissful verge in code or with a pre-made plugin
how do you do that
@inland meteor let me check
cast it
Upon InventoryCloseEvent, you no longer need the instance and can remove it.
jesus that still is complicated
Yeah but like how do I make it lol
I mean, it's easy to get the inventory of a chest, but you'll need an event like InventoryClickEvent for whatever you're trying to do.
have a hashmap in your main class of <Player, int> then onblockbreak add one to their hashmap value, then ondisable save it in a .yml
Player and int?
Wouldnt it be better to use UUID and int?
hashmap?
I guess so @dusky herald, i was just trying to make it as easy as possible to write the base code lol
UUID and you can't use primitives as a generic type
True UUID and Integer
Yeah that's what i meant lmao, I just wanted to give them a rough idea of how to do it
Then you'll want to create a List<Inventory>, store the inventories of chests players have interacted with from PlayerInteractEvent in there then on InventoryCloseEvent, go through all of the inventories in the List and check if the viewers match, if they do remove the instance from the list.
tf is a hashmap?
Then on InventoryClickEvent, search the List of Inventories for the viewers that match the clicked inventory (to confirm it is a chest), actually you'd need the location I suppose so maybe a HashMap will do you better (HashMap<Location, Inventory>)
Also, using a HashMap to add ints seems bad, if you need to add more than one int, you could do something like
ok new plan
HashMap<UUID, List<Integer>>
@dusky herald it's just to track one number against a uuid
how do you get the nbt data of a block
they wanna track how many blocks broken
Just one number? Okay then
All NBT is hidden behind BlockState, Lonnon
@stark lodge you want to listen for when a player puts something inside a chest, so you can turn that chest into another block, right?
They might want to track more data later, possibly so
They could create a custom PlayerData class, for example
Major, I'm doing this for fun, so that more complex than I need
Yeah, I was just going off what they wanted from the original question that's all
And add a field called blocksBroken (int)
Then refer to HashMap<UUID, PlayerData>
I do agree black, I was just trying to make it as simple as possible for them 🙂
I understand, I just think possibly the best or more efficient approach is good to try to instill into them as well.
how to decode block state
try
It's not too overwhelming anyways, unless they dont know Java.
What are you doing, Lonnon
getting the blockstate of a block
The only concern was that they hadn't heard of HashMaps, that's why I tried to keep it as simple as possible
Block.getState()
Yes. It would have given you a BlockState
how do I grab the nbt data out of that
Remove the concept of NBT from your mind. You're not interacting with NBT
It's all hidden behind the BlockState API
What is it you want to get?
hey i have viaversion and viarewind and it wont let me join with 1.8 i have a 1.15 server and i am trying to enable 1.8 to join
I'll try make it simple. In a class ChestListener, create Map<Location, Inventory>, on PlayerInteractEvent, use event.getAction() make sure it == RIGHT_CLICK_BLOCK, get the block that was interacted with (event.getBlock() or whatever it is), then check if that is a Chest, if it is, cast (Chest) to the block state as per that link I gave you, then put the Chest's Location and use chest.getBlockInventory() and put that in as the value. Then on InventoryClickEvent, use entry set and listen for one of the entry's values inventories, get their viewers and find which one matches with the clicked inventory, (then you can assume it's a chest, and you have its location already), so if the particular item you are listening for is placed in the chest, you can set the block at the location as whatever. Then so you aren't flooded with instances in that map, use InventoryCloseEvent, loop through the values again and check if the inventory's viewers match, then remove it from the map.
That's as simple as I can put it.
Doesnt viaversion have a configuration guide?
I want to get the tag of the block to see if it has a tag noob with a value of 0
much grammar
So you want custom NBT. So instead of BlockState, you want its PersistentDataContainer
huh
He just said what u need
all these routes lead me down to hell
Get the block state, cast it to TileState (assuming it's a tile entity - because that's the only type of blocks that hold NBT)
Call that method and you may add or retrieve custom NBT values under the Bukkit namespace
/give @p dirt{BlockEntityTag:{Epic:0}} what is this called, bc it ain't a tilestate
That's not possible
@sturdy inlet did you get ViaVersion Abstraction?
Dirt has no tile entity
They got both Abstractions major
oh
Sure. Chests are tile entities, they hold NBT
ok how do I put nbt data on it
Using the method I described above
@inland meteor
You know a plugin for auto farm mobs a block that kills them automatically when they pass over them ?
Well, make sure you have both https://www.spigotmc.org/resources/viabackwards.27448/ and https://www.spigotmc.org/resources/viarewind.52109/
Get the block state, cast it to TileState (assuming it's a tile entity - because that's the only type of blocks that hold NBT)
Call that method and you may add or retrieve custom NBT values under the Bukkit namespace
TileState state = (TileState) block.getState(); // Again, this assumes it's a tile entity. Check first
PersistentDataContainer container = state.getPersistentDataContainer();
container.set(new NamespacedKey(yourPlugin, "YourTagKey"), PersistentDataType.INT, 0); // Setting it to 0
state.update();```
getClickedBlock already returns a block, so you shouldn't need to cast it
ok
The cast is unnecessary but yes
what is the yourplugin, yourtag key thing
Oh already mentioned that lol
the your plugin is an instance of your main class
yourPlugin is an instance of your plugin's main class. The one that extends JavaPlugin
The key is... well... the key
wdym
I was about to type about the key, but I have no clue how else to phrase it
You have a class that extends JavaPlugin. That is your "main" class
yes
It should be an instance of that class
so put this event in main class
Ehm, well, yea that would work. Or you can pass your plugin's instance through the constructor of your listener class
new Main()?
Nono
You can't instantiate your main class. The classpath prevents you from doing that
You can pass your instance using this. This is basic Java you should seriously understand before making plugins
A Bot for notify new Resources exist?
my brain is melted
No God no. That would be spammy as hell lol
I think you're underestimating how many new resources are created on any given day
it gives error for this
this.main
Yes, add the Bot to my server and notify when I upload or update resources
To add to your server blu?
@inland meteor
it gives me an error saying this is illegal in this case
Hi, I need a little help, how can I change the version of the spigot in multicraft?
Use a different spigot jar
where can i download it
I asked in here yesterday, about controlling the dragon in the normal world. It seems that a bit of a challenge. But what about sending people to The End and resetting the battle when a new group enters, is that doable?
I read this doc I don't understnad
If you’re doing new main(); you are creating another instance of Plugin
Which is not allowed
And will throw an illegal exception
Instead you can use JavaPlugin.get(main.class); (not sure if it was JavaPlugin or just Plugin)
But, you shouldn’t name your main class main, and for classes you should be using UpperCamelCase
@stark lodge
@naive stratus that seems like a pretty simple task to do with a custom plugin
@acoustic falcon
I already changed the spigot.jar
clearly you haven't
Is it in the correct directory?
how tf do I get plugin
Wait are you trying to get a plug-in instance from the main class?
yes
I did
Yes i am
and it says no
Send me a snippet of the code
🥺
@keen sky send me the script that’s starts the server up
@stark lodge is that in your main class?
no
This refers to the current class you are in
So you have to get an instance of main by saying
this code is in TestListeners
getPlugin is undefined
still undefined
It should be JavaPlugin.getPlugin();
that fucks up my main calss
Anyone has this problem?
Disconnecting com.mojang.authlib.GameProfile@4323dcb[id=5,name=f1r,properties={},legacy=false] (): Failed to verify username!
[17:54:45 WARN]: Exception verifying f1
java.lang.IllegalArgumentException: Name and ID cannot both be blank
Any workaround?
I restarted the server multiple times
@keen sky is there some setting in multi craft to select the jar
@stark lodge how would that mess up your main class? It gets an instance of your main class
cannot innieiate thing
have to be careful where you use that
You can also use dependency injection
how
tryna shove that in your own main class or something pulled up before the plugins class is actually fully initialized will cause issues
I replace the spigot file for the new, But it won't let me select the new file, it's like it doesn't exist
what was I even doing
Dependency injection is when you pass an instance of your main through a constructor
@keen sky unfortunately, I am not super expirenced with multi craft. I’m not sure if there is an extra step
So i was wondering can i edit the displayname of EntityPlayers (Above there head?)
in a different way then editing there gameprofile name
because that is only 16 chars long
I want to make a placeholder in PAPI, how do I do that?
**Hey everyone. **
Looking for a developer who had custom code/develop my own practice server. Any dev experience/practice server experience wanted.
Money to be made.
Message me.
Thanks,
George
This is not what this channel is for
also, why do you seperate each line like that
🤢
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
@frigid ember
Apologies, was hoping to find someone on here but no worries
Could not pass event PlayerInteractEvent to GuiTestPlugin v0.1 org.bukkit.event.EventException: null how to make it give this error when I open the chest
@EventHandler
public void PlayerInteract(PlayerInteractEvent event) {
System.out.println("Ran");
if(event.getClickedBlock() != null) {
System.out.println(event.getClickedBlock().getType().toString());
Block block = event.getClickedBlock();
Chest chest = (Chest) block;
Player player = event.getPlayer();
if (block.getType() == Material.CHEST) {
if (chest.getCustomName() == "Epic") {
player.sendMessage("end");
}
}
}
}```
Do "Epic".equalsIgnoreCase(chest.getCustomName()) and it will be null safe
But, yea, can't use == for stuff like that, also, don't really see where that could NPE
getCustomName() is nullable
The code running in your server is probably outdated
null == "String" would not result in an NPE
Yea but it also just wouldn't work lol
"Epic".equalsIgnoreCase(chest.getCustomName()) I never thought to do it this way ... :oo idk why
oh
that logic just didn't hit into my mind lmaoooo
You misread what I saw saying
I forgot that would be nullsafe
I was saying that I don't see where that block of code would NPE
I don't personally like that look of it but it's null safe because you're operating on a literal
Yeah
Good catch ;P
btw it still gives me an error
That will cause a CCE
You can't cast a Block to a Chest, etc
how fix
you need to cast its data
anyone knows any good wildtp/rtp plugin for 1.15?
I give up for today
Any way to keep data (without external files) across server reboots?
How do you expect that data to remain persistent without writing it to file?
Yeaaaa... you can inform them that it most definitely isn't ;P
That being said, there are some forms of data you can sneak into Minecraft's files
i.e. the persistent data containers are written to NBT
I need to store a player with a number value
If you're on modern versions, NBT might be useful for that
If not, then yea you're going to need to write to file
nop, 1.8
Files it is!
im just gonna use arraylist and have it clear on reboot
can arraylist store a player and an associated integer?
Map would be better here. Map<UUID, Integer>
You'd want a map
Also chest names can be changed in an anvil 😉 so i can just rename a chest to Epic and get access to whatever effects i want anywhere
nbt
Is there a way to increase max enchant level?
what would you mean by increasing it
how it looks in an enchant table?
or just applying efficiency 999 on your pick
Why does map create so much fucking code?
????
@mossy crane what
How would I create an async https request to https://docs.tebex.io/plugin/endpoints/player-lookup
use the HashMap not the Map interface
Yeah, Map is an interface.
@mossy crane
All I want to do Is store a player and an integer
@mossy crane Map<UUID, Integer> mymap = new HashMap<>();
^
ah
Map is an interface, so you can't use it with new
i see what the issue was xD trying to make an instance of an interface
or Map<Player, Integer>, but then it's not serializable any more
It makes no difference whether you use UUIDs or players, as long as you remember to clean them up when the player leaves
Disagree, it depends if you want to use more memory or more CPU
UUID's are almost always better to use
You aren't storing more data by storing the player as a key
You're storing the reference
Same goes for UUIDs
oh shit we are in Java, my fault
D:
Yeah, but that goes for any issue when it comes to back code or forgetting to do things in code
If you're calling .getUniqueId() just to store the user and remove the user, then you might as well just use the Player as a key
Less calls to other methods and less overhead when it comes to reading the code
I think it should not make any difference
beside the player reference updates more often
That doesn't make a difference again
You're still only storing the reference to the player object
So if it changes, the reference is still the same
The player object can change all it wants but the reference doesn't.
It all just depends on if you need a UUID for working with files, database, etc more or if you actually need a Player object to work with.
Exactly that
But at times where you just need to interact with the player, I'd be using the player object
Could I get some help on how to create an async https request to an api such as https://docs.tebex.io/plugin/endpoints/player-lookup ? ty
guys, i just downloaded worldedit from this site https://dev.bukkit.org/projects/worldedit/files latest version but it says that it is too big
when i put it in multicraft
uhmmm
ya?
What's wrong here:
{
if (Block.getType() == Material.COBBLESTONE)
{
int value = map.get(e.getPlayer());
map.replace(e.getPlayer(), value + 1);
}
}```
Whole code (HashMaps):
import java.util.HashMap;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class HashMaps extends JavaPlugin implements Listener {
public HashMap<Player, Integer> map = new HashMap<>();
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
public void onJoin(PlayerJoinEvent e) {
map.put(e.getPlayer(), 0);
}
public void BBE(BlockBreakEvent e)
{
if (Block.getType() == Material.COBBLESTONE)
{
int value = map.get(e.getPlayer());
map.replace(e.getPlayer(), value + 1);
}
}
}```
@blissful verge Your issue is with Block.getType()
You need e.getBlock().getType() to get the type of block that was broken...
Wait no
thx
BUTT
How can I show these values lets say in the console and save these values?
im having an issue can anyone help me solve i finally have players on my server but now that players are in sleep cycles are acting up going into a bed wont reset to day
??
@blissful verge Bukkit.getLogger().info("message") for console message. If you want to save the values and keep the values after the server restarts, you need to use files. There's plenty of tutorials for YAML files for data storage.
@radiant pollen would you have any info on my question sorry to bother you ?
its only 4mb
@tawny crypt One of the plugins you've installed is messing with the day cycle.
Check the configs for your plugins
it works when im solo thats the weird part
So people are in the bed but it won't switch to day?
correct the light dims like its about too but then just stays night
and opens chat menu
Is everyone in a bed?
How do I get the killer when someone dies?
@mossy crane There's an event that let's you get killer.
no just me sleeping i have it where the whole server turns to day if 1 goes to sleep
What event is it?
@tawny crypt Then the plugin you're using to do that isn't setup right.
@mossy crane Learn to use the docs.
the docs are shit and you know it
Haha no.
@mossy crane EntityDamageByEntityEvent
Oh this shit complicated
Check if final damage is greater than entity's health, if it is, damager is the killer.
I aint doing this complicated of shit
thanks
Pterodactyl gang anyone?
@blissful verge huh
Pterodactyl gang anyone?
@obtuse rose Yup, I'm a sysadmin
yay xD
I just wish it had a better theme by default rofl
How to add files above 2mb in Multicraft?
It says
The maximum size of one file is restricted by net2ftp to 2 MB and by PHP to 8 MB
@neat orbit it's hosting company's multicraft or your own?
wait... so can you upload via FTP?
@neat orbit You'll need to connect with an FTP program
whats that then?
like WinSCP
FileZilla
FileZilla
Your host will provide you with the information to connect to the server
@neat orbit your host should provide you FTP credential
No, you can connect with any FTP client, but the information to connect is given by your host.
^
okay
what is it called by a host? @radiant pollen @obtuse rose
like whats the formal name for it
@radiant pollen Can I just check if the final HP was equal to 0?
It's only for players
@mossy crane No, the entity's current HP is the health before the damage. You need to check if their current health is less than the getFinalDamage()
@neat orbit Your host should have given you some information called FTP credentials
hp - getFinalDamage() <= 0
hp - getFinalDamage() <= 0
@obtuse rose what
Hey guys. As i never used protcollib, i have a question. I would like to modify an item in player inventory (just want to change the current items model data). So i what is know: "PacketContainer setSlot = new PacketContainer(PacketType.Play.Server.SET_SLOT);" i have to send this. but i dont know any parameters. Anyone can help me with this?
I want to see if they're dead
@mossy crane yes that's what that does
OHHHHH
That will return true if the damage that they're being dealt will kill them.
ok
@neat orbit
If they're hp - the damage they took is less than 0 they're definitely dead
less than or equal*
whatever lol
yea, I want that
You'll have to check if it's a player.
if(e.getEntity() instanceof Player)
thanks
or do e.getEntityType() pretty sure that's a thing
It is and if you're comparing to a Player, you should
It's the last entity in its hierarchy
?
That being said, an instanceof check is a lot more standard and likely a bit safer in the case of modded software
instanceof is the official way to check before casting
ah, he casting it?
How do I make a map accessable in all methods?
@mossy crane public static
public static and not final is discouraged (to Zaxarner)
if its all methods, you're better off putting it to private static and then having a method that returns it
Will this work:
package tech.sshdoes.wantedlevel;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.*;
public final class WantedLevel extends JavaPlugin {
@Override
public void onEnable() {
getServer().getConsoleSender().sendMessage(ChatColor.DARK_AQUA + "WantedLevel hast started - Made by SSH#4388");
// Plugin startup logic
}
public static Map<UUID, Integer> mymap = new HashMap<>();
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
mymap.put(p.getUniqueId(), 0);
}
@EventHandler
public void onKill(EntityDamageByEntityEvent e){
if(e.getEntity() instanceof Player) {
Player p = (Player) e.getEntity();
if (e.getFinalDamage() >= p.getHealth()){
Integer currentLevel = mymap.get(p.getUniqueId());
mymap.put(p.getUniqueId(), currentLevel+1 );
}
}
}
}
why is everybody making their types final
Why wouldn't you?
.. ^
imma make it available in papi so I'll see
Plugin being final makes sense, listeners being final makes sense, commands being final makes sense
That Map should also be final by the way lol
lol
yes it should, or private
what's the difference?
Also,
Integer currentLevel = mymap.get(p.getUniqueId()); mymap.put(p.getUniqueId(), currentLevel+1 );
No, this won't work
final vars cannot be changed
NullPointerException waiting to happen
Oh just saw that listener 😛
can someone change my nick to qbasty because I also changed it on spigot (i donated)
move the class variables to the top of your class
Though to be honest, I'd remove that join listener and change those two calls to mymap.merge(p.getUniqueId(), 1, Integer::add);
Though to be honest, I'd remove that join listener and change those two calls to
mymap.merge(p.getUniqueId(), 1, Integer::add);
@subtle blade I am very confused
THat code confuses me
move the class variables to the top of your class
@vale slate no
merge will map the player's UUID to 1, or, if the key already exists, get the existing value and apply the supplied function. In this case, it will add one to the existing value
So, add one to existing values or set to 1 if nonexistent
@vale slate no
@mossy crane why
That way you're also not holding data for every single player when they join, only when you call upon it
Though to be honest, I'd remove that join listener and change those two calls to
mymap.merge(p.getUniqueId(), 1, Integer::add);
this line of code is beautiful - and I don't know why
So, when they join, it'll give them 0 stars
Java 8 is great 😄
Hi, I have a little problem, my timer here won't start, I've been at it since this morning.
maybe it's because you cancelled it?
^
🤔
He not cancelled it
.cancel() would say otherwise
it says cancel right there
.cancel();
🤔 🤔
hahah
https://www.minecraftforum.net/forums/support/server-support-and/3016964-no-one-can-join-my-minecraft-server
would appreciate it if you guys can take a look
but the .cancel isn't work
sounds like it's working to me
But your problem is that it doesn't start?
very confused lol
Yes sorry i've a very bad english x)
It's okay
When I .cancel() I didn't have error on the console
But when I start a new Bukkit runnable after cancel, i've a IllegalStateException on the console
BukkitRunnable
check :
Though to be honest, I'd remove that join listener and change those two calls to
mymap.merge(p.getUniqueId(), 1, Integer::add);
@subtle blade Doesn't work
My IDE says there's an error
What'cha got?
I can't stop my task, if I Bukkit.getServer().getScheduler().cancelTask(taskID); doesn't work, this.cancel() too, but I don't know why
Might not be using Java 8 (which you should)
So, this code adds one to the killers wanted level every time he kills someone? ```java
@EventHandler
public void onKill(EntityDamageByEntityEvent e){
if(e.getEntity() instanceof Player) {
Player p = (Player) e.getEntity();
if (e.getFinalDamage() >= p.getHealth()){
Integer currentLevel = mymap.get(p.getUniqueId());
mymap.merge(p.getUniqueId(), 1, Integer::sum);
}
}
}
No need for that currentLevel variable there anymore
Just the call to merge will do
You could remove the join listener as well
(I guess, unless you're using that value elsewhere)
?
if (e.getFinalDamage() >= p.getHealth()){
mymap.merge(p.getUniqueId(), 1, Integer::sum);
}```
That's it
yup
oke
so, I want to set stuff like this:
0 Stars ✩✩✩✩✩
1 star ✯✩✩✩✩
2 star ✯✯✩✩✩
3 star ✯✯✯✩✩
4 star ✯✯✯✯✩
5 star ✯✯✯✯✯
And throw it to papi
I'm confused on how this works
@radiant pollen I have configured everything and added my server credentials, created a new site and I am about to connect when I receive the message saying that: this server does not support ftp over tls
what is the reason?
anybody can help me in general; i'm using filezilla.
it means they don't support encryption
how can i fix it then? @keen compass
if you have a host where they give you limited access, then its on your host to fix it
otherwise if you have full access, then you just need to change your configurations on the ftp server
but ftp is still usable even without encryption
how do i change my config exactly?
depends which server software you are using to provide ftp, but if you have full access I would recommend using sftp instead
Hi I'm looking for a plugin that gives an anti-fall potion effect in the form of a consumable item or an orb
1.8
good luck, 1.8 isn't supported anymore
should definitely upgrade since it is years old XD
and riddled with bugs
I saw a server having an anti fall orb
as soon as it is in the inventory the player does not take fall damage
@keen compass my host is hostinger.com and i use multicraft
How would I get the number associated with a player UUID in a map I made in another class?
got it
then I doubt you are going to be able to do anything about it @neat orbit
@keen compass i guess i'll ask my host
either complain to your hosting provider, accept you can't use encryption for ftp or change hosts
- why are you using multicraft
- why are you using hostinger
in clear over the internet
in the clear yes
for mc, yes
: ( cant change it now
it means if someone was sniffing your traffic, which is a man in the middle attack, they could see your credentials
@radiant pollen so i figured my issue out with the sleep thing its working great for everyone else but when it comes to me i cant sleep and switch day / ihave op so not sure if that could be it or not
Yeah, probably a permissions problem.
Check the plugin you're using to see if there's a bypass permission or something similar.
do you possibly know what plugin would have this permission im using essentials but only thing i see in config is if players are afk
I know Essentials has a essentials.sleepingignored and a essentials.home.bed
I don't know if either of those would fix your issue.
hey! Im trying to make a thing where i need the plugin to know if the player got kicked by a player or console, or if the player got kicked from server closing
Is there a specific reason that signifies the player got kicked from server closing
im basically trying to make it so if a server shuts down it automatically transfers the player to another lobby
sysout("here3");
Check check = gson.fromJson(content, Check.class);
System.out.println("here4");
gets to 3, but not to 4 - why is fromJson freezing me 😄
content is a string:
[{"minecraft.net":"red"},{"session.minecraft.net":"green"},{"account.mojang.com":"green"},{"authserver.mojang.com":"green"},{"sessionserver.mojang.com":"red"},{"api.mojang.com":"green"},{"textures.minecraft.net":"green"},{"mojang.com":"red"}]
Its a json array?
yeah
querying mojang api
public class Check implements MojangAPIResponse {
private List<Map<String, String>> status;
}
Can i use .sk plugins?? how do they work?
Check check = new Check();
check.status = gson.fromJson(content, List.class)
Idk lol, i didnt even see status field in your json response
@cosmic ridge yes it does?
@paper compass I would look into using a separate file instead of a config file for the player's info. I can't tell if you're already doing that with the code you provided, but yeah. You could also look into SQLite.
I don't think that would work in a server crash rn
He has a save interval.
Mentioned this in #general but you moved here, so:
Recommend doing things through Vault
But yes you should just call saveAll when the server stops.
vault support multiple economy?
does anyone know if there is a way to call a PacketEvent?
yes, send packet
figures. lol
yes i know
i know
Is there public 1.16 spigot jar?
no
no md_5 is hoarding it in a pile of spiders
there are no public spigot jars, actually
alright so heres my next questino
say i want to remove the glowing affect from a player that i added with a packet
anyone know how i would go about doing that>
why i cant pvp in the skywars game
(ProSkywars plugin)