#help-archived
1 messages Β· Page 195 of 1
heh there's no get entity method in the Inventory Move Item Event
what will happen if I start server on new version without --forceUpgrade ?
{...} See what happens if you disable the firewall on the machine the servers being hosted on or make sure the IP address and port aren't in use on your network.
@frigid ember only I'm developing Minecraft servers and stuff in the family, so no port error. I don't understand firewall..
guys plz any one understand with domain names ????
no
@frigid ember can u come private ?
I literally do event#getNewPotion, and check if the type is poison
but it returns false
but the potion i gave is poison
Your friend maybe can help ye, Ender Gamer..
it says "Is not POISON, is: POISON"
that does not make sense to me
I'm applying poison, how can the type be != POISON
and if you want full code, which tbh i don't really thingk it has any use here it is
?paste
i am calling that event with EntityPotionEffectEvent listener, i just pass the "getNewPotion()" in the method
this is the full class code
I'm either being real dumb, or the getNewPotion() makes no sense for me
i can try, but enums can be compared with '==' and that worked in other 30 plugins i made
btw for anyone to replicate this, I'm on 1.16.1 latest build,
I do /effect give TheViperShow poison 20 1
@timber prairie my friend is a dog he dont want to tell me π π
@sturdy oar Are you using intellij? Run in through the debugger, that usually clarifies.
what is going on at least.
Anybody here know a horse ownership or horse tp plugin that isnβt MMOHorses?
For 1.16
is cancelling PlayerBucketFillEvent's not replacing liquids on the client side a known bug, has anyone else experienced this? (it seems to only not replace when there is no block being clicked and its just the liquid but replaces itself when the block by or beneath it is clicked)
[20:18:07 INFO]: TheViperShow issued server command: /effect give TheViperShow minecraft:poison 20 1 [20:18:07 INFO]: getLivingEntity() [20:18:07 INFO]: Is not POISON, is: POISON [20:18:07 INFO]: [TheViperShow: Applied effect Poison to TheViperShow]
I tried with .equals() still same results that doesn't make any sense to be honest.
I'll throw the debugger in...
cause reasons
im using 1_8_R3
Is there a way to keep up my Server for 24/7? or for more than 1 day with low memory usage?
ping me if you can help
is there any way I can stop it doing that without just not using spigot for the event?
buy a host lol
@frigid ember should i try printing hashcode?
they should be the same... since POISON is an enum
and go program in python or something
> effect give TheViperShow minecraft:poison 15 0 [20:28:41 INFO]: getLivingEntity() [20:28:41 INFO]: 19 - 19 [20:28:41 INFO]: org.bukkit.craftbukkit.v1_16_R1.potion.CraftPotionEffectType - org.bukkit.potion.PotionEffectTypeWrapper [20:28:41 INFO]: Is not POISON, is: POISON
left is value obtained with .get() right is enum constant
the hashCode is the same
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.
my users can not enter to the server, the server run
but i have this issue
.... [18:05:00 WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@1b34490[id=dfbd3bba-c640-31d3-82a9-c661d7e4363a,name=erichmauromatis,properties={},legacy=false]
How do i check if the player has 5 free slots in their inventory?
is a host problem?
online-mode=false
AdvancedEnchantments-7.11.5.jar 0.91MB 07/21/20 15:41:45
AuctionMaster.jar 349.57kB 07/17/20 21:29:00
ChatControl-Free-5.8.7.jar 196.98kB 07/17/20 21:29:01
CitizensCMD.jar 263.58kB 07/17/20 21:29:02
Citizens.jar 3.38MB 07/17/20 21:29:02
Clearlag.jar 192.13kB 07/17/20 21:29:03
CrazyCrates.v1.10.jar 779.29kB 07/17/20 21:29:03
DeluxeCombat v.1.17.5.jar 607.34kB 07/17/20 21:29:03
DeluxeMenus-1.13.2-Release.jar 134.53kB 07/17/20 21:29:04
Dungeons.jar 825.01kB 07/23/20 00:33:19
EpicCraftingsPlus-6.0.2-Cracked.jar 181.09kB 07/19/20 18:10:56
EssentialsX-2.17.2.0.jar 1.41MB 07/17/20 21:29:05
EssentialsXChat-2.17.2.0.jar 12.54kB 07/17/20 21:29:05
EssentialsXSpawn-2.17.2.0.jar 15.09kB 07/17/20 21:29:06
ExploitFixer.jar 88.72kB 07/17/20 21:29:06
GangsPlus-2.9.0.jar 409.73kB 07/17/20 21:29:06
HamsterAPI.jar 33.36kB 07/17/20 21:29:07
HolographicDisplays.jar 480.45kB 07/17/20 21:29:07
IllegalStack.jar 157.56kB hace 25 minutos
ipwhitelist-1.7-3.jar 12.25kB 07/17/20 21:29:08
Jobs4.15.11.jar 1MB 07/17/20 21:29:08
LeaderHeads-4.0.5.jar 1.18MB 07/17/20 21:29:09
LibsDisguises-10.0.15-Free.jar 768.67kB 07/22/20 12:46:18
LockettePro-2.9.10.jar 85.09kB 07/17/20 21:29:09
LuckPerms-Bukkit-5.1.26.jar 1.33MB 07/17/20 21:54:21
Marriage.jar 176.74kB 07/17/20 21:29:10
Minepacks.jar 1.25MB 07/17/20 21:29:11
MobFarmManager1.5.6.0.jar 264.65kB 07/17/20 21:29:11
Multiverse-Core-2.5.jar 1.65MB 05/13/20 21:37:10
MythicMobs-4.9.1.jar 8.12MB 07/22/20 23:48:50
nuvotifier-2.7.1.jar 2.72MB 07/16/20 03:35:38
PlaceholderAPI-2.10.5.jar 336.11kB 07/17/20 21:29:12
PlugMan.jar 1.35MB 07/17/20 21:29:12
ProtectionStones-2.7.1.jar 506.54kB 07/17/20 21:29:13
ProtocolLib.jar 1.43MB 07/22/20 13:11:51
RandomTeleport-7.9.2.jar 476.73kB 07/17/20 21:29:13
Rankup-3.6.1.jar 128.37kB 07/17/20 21:29:14
SkinsRestorer.jar 7.44MB 07/17/20 21:56:15
TAB v2.7.3.jar 516.15kB 07/17/20 21:29:17
UltimateKits-2.6.5.jar 797.34kB 07/17/20 21:29:
Cracked server and cracked plugins?
EpicCraftingsPlus-6.0.2-Cracked.jar
Ah is the only xd
I somehow don't believe you
We don't support offline server or cracked plugins here
@heavy trail Are you using BungeeCord?
@frigid ember Yeah
π€£π€£π€£π€£π€£π΅οΈββοΈ
Yeah i have skin restorer
Ok, i try remove it
thank you for your help
in the bunge have this issue
Do you guys know if it's possible to check the type of a list? π€
i'm about to go loop thru first element
Type of list or what's in it?
List<Type>
Maybe
i edited a PersistentDataContainer on a BlockState
how can i update the changes to the block itself?
i tried BlockState.update() and it didn't work
Tag me if you find anything I would like to know π
update(true)
oh thanks
How do i check if the player has 5 free slots in their inventory?
how to check if block is liquid or contains liquid?
1.15
still didnt work Fr33styler
block.isLiquid() || block.is...?
So im doing this - java public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (label.equalsIgnoreCase("faction_create")) { if (getConfig().getString("faction.name").contains(args[0])) { sender.sendMessage(ChatColor.RED + "Sorry, this faction name is taken."); } else { sender.sendMessage(ChatColor.GREEN + "You have created the faction " + args[0] + " successfully!"); FactionNum = FactionNum + 1; getConfig().set("faction.name." + FactionNum, args[0]); saveConfig(); } } return false; } } and im getting a null error at line 23 [if (getConfig().getString("faction.name").contains(args[0])) ]. why?
check what getString("faction.name") returns
Wont it return a list of all of the factions?
...which there arent any of at
...means it returns null
How do i fix this?
faction and name?
@frigid ember when i use the command and im giving a name to my faction im still getting the error
but ill check the string from the config
Hey guys I need help with something.
Yβall know when players press the tab key it lists all the players on the server.
Does anyone know how I can disable that?
You can make it empty, not disable it
Hmm ok
Well only show yourself
Ok how do i do that?
How to check if block contains water?
I'm not exactly sure how it works since I've never done it myself but you could take a look at the source code of BungeeTabListPlus and see if you can work something out @hoary idol
Wait @mellow wave Iβm such an idiot I didnβt mean the tab list....
I meant in the command line
hm disable chat?
I donβt want people to be able to see the online players by pressing tab in the Chat
oh
Sorry for the confusion
Yeah that's also possible
?
How do i check if the player has 5 free slots in their inventory?
I have an idea
But it's super generic and it may not be working
can't you do like List#get(0).getClass()
It won't work in empty list of course
so i tried doing this:
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("faction_create")) {
if (getConfig().getString("name") != null || getConfig().getString("faction.name").contains(args[0]) ) {
sender.sendMessage(ChatColor.RED + "Sorry, this faction name is taken.");
}
else {
sender.sendMessage(ChatColor.GREEN + "You have created the faction " + args[0] + " successfully!");
FactionNum = FactionNum + 1;
getConfig().set("faction.name." + FactionNum, args[0]);
saveConfig();
}
}``` and it still doesnt work
still a null
oh
bruh
well
i had the right idea i guess
i checked
both name and faction return config
return null**
so it doesnt matter
Sure
so now the config is like this
faction:
name:
'1': safd
'2': safd
this is great but
i shouldnt be able to make multiple factions with the same name
you could use the faction name as the section instead of FactionNum
How can i make multiple factions otherwise?
I want a way to sort through them
if i just do it with name:
there can only be one faction
a config...
for each faction?
sounds heavy
also, how do i do that?
It is not the bunge, it is the server, it enters my other servers, and this is a server with bunge problems and it still does not work π¦
i trying deleting the plugins
yesterday working fine, today just make a reload
and not working
@frigid ember I figured it out, Thanks!
Yeah.. i didnt even think of making multiple files
Its a great idea
i found this
File f = new File("FILE/PATH/HERE", "FILENAME_HERE.yml");
I want the file path to change automatically
so you dont have to enter it every time
is that possible?
found it
getDataFolder()
hey could someone help me please
so were working on a minecraft server on a linux vps and screen doesnt want to detach
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.
we do that
it doesnt work
and weve tried to reinstall screen
nothing
and there is a screen running
ok thats a lie
let me show u
what is good CMI like plugin
root@server:/srv/ftp/server_spigot/server_spigot# screen -ls
There is a screen on:
21560.pts-0.server (07/23/20 19:36:10) (Attached)
1 Socket in /run/screen/S-root.
ok
so whats happeniong is were runnign screen without screen session active
yes
@frigid ember Yeah is a plugin, now the problem is know what is the plugin hahaa
this is the plugin @frigid ember https://www.spigotmc.org/resources/cmi-270-commands-insane-kits-portals-essentials-economy-mysql-sqlite-much-more.3742/
Hey guys, I never played Factions so I need a small help. My plugin hooks to Factions, and I want to get the Factions name. So for the default Factions plugin (massivecraft) everything is fine: faction.getName(). But now I want to also support SaberFactions. Problem is, there isn't a Faction#getName in SaberFaction. Anyone knows something about this plugin?
Okay thanks
What a quick google, I salute you.
omg so much fork, so much differences π’
SavageFactions != Factions but more close to SaberFactions
?paste
Help anyone https://paste.md-5.net/owiwuluzew.md
Where is the FOOTSTEP particle in 1.16...
wot
:(
no this is plugins
You can ask in SKUnity tho
@sturdy oar i did it already :p
Could someone help me set up my server please
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
trying to learn nms.
have the pf-goals:
this.goalSelector.a(0, new PathfinderGoalFloat(this));
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, EntityIronGolem.class, 1.0D, false));
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntitySpider.class, 1.0D, true));
but what is the 0, 2, and 4 at the beginning for? dont get it
priority
0 = highest priority, will take precedence over others
for instance, that entity would prioritize attacking iron golems over spiders
(or maybe i have that backwards, its been a bit)
ah nice. btw, is there any way to get such infos somewhere? seems like there is no single good help for nms 1.8
reverse engineering and figuring it out yourself
lmao
though we dont advise using 1.8, it's 5 years old
1.14 has shitty combat (my opinion) and it would be dumb to make a pvp bot for 1.14 combat
lmao
you're 5 years out of date, spigot only supports 1.16.1
your opinion on the matter is irrelevant
it was a recommendation, youre on your own if you choose to stay on 1.8
most likely not in the near future. build delay for 1.16 was extended to 3 weeks
at this point id consider 1.16.1 mostly stable. md is likely just waiting on 1.16.2 to make it default
i dont understand their reasoning behind it either
your opinion on the matter is irrelevant
@subtle blade btw we are in 2020, would be new to me if opinions doesnt matter... but if you say so, you're the staff π
pressed for time on .0 is likely the reason
Probably
your view on pvp pertains not at all to what this server supports, vngc
whether or not you like it, the version you are using is not supported
so, no, it does not matter
Doesn't 1.8 have like the best version performance? I mean isn't that why most servers run on it?
i think most servers run 1.8 because of combat
I'm speaking from running my own 1.8 server, 1.12, and 1.14. I've not done 1.16 yet, but I'm about to
Who cares about that, you can fix the swinging, I was under the impression most server run on 1.8 for the performance
I mean sure 1.8 runs better, because it has less stuff
@lone fog doesnt have to be true...
1.12 performance was good
Is*
Not 1.13/14
1.16 should be really good with all the rewritesMojang did
1.15 was pretty bad i think, much guys had problems there
But y'know
Well that's good to know, I guess I'll just have to find out. If 1.16 ends up running really smoothly on my server, I'll probably update everything to 1.16. Most users (At least on my server) join using the latest version. There are still 1.8 players, but I don't think that's the majority by far
then it would'nt be a bad idea
I feel like there will still be 1.8 servers when 1.30 comes out
if they dont add the old combat, that won't end probably
or make a better combat system
Would be sick if they did
1.7 was good lol
Well, the only thing I'd say I miss is the block hitting, and the old enchant glow. And Fast swinging obviously, but plugins fix that so it's less of a concern
Can we not go into the version debate
We're not debating though
It's had every single day and it serves no purpose here
I don't care. It will inevitably turn into one
1.1 best version
alpha best
Honestly yea, alpha is definitely superior
realtalk, the old world generation was so nice lol
I miss the PvP from it, lets be real
Lol, we're messing with you guys, obviously.
yeah i think
dont wanna get a ban, so im outta here xd good evening, or whatever you have atm
That easy to be banned?
idk, won't get that risk
not that easy but you're also having an irrelevant discussion in #help-archived
im lenient on my banning. unless you absolutely deserve it, i'll just tell you off
well idk if its 1.8 related (then just tell me), but
new PathfinderGoalMeleeAttack(this, EntityIronGolem.class, 1.0D, false));
what means the "false" at the end? i think its the same at 1.16 1.15 etc
best to open the constructor, find to what field it's assigned and figure out what it affects
that varies from goal to goal
k
thats what a lot of working with NMS is. going in blind and self-documenting things
its ever-changing, unsupported and mostly unmapped code
anyone know where to find dyna map for paper servers
can it makes some lag If I do a sql SELECT request every 5 seconds (only want to fetch 1 raw)
how do i make spigot not keep the chinks loaded and load them only when in view
any1 knows how to disable or remove the compass thingy from worldedit for opped players?
forgetti how i did it Β―_(γ)_/Β―
E
@EventHandler
public void onPlayerMobInteract(PlayerInteractEntityEvent e) {
if (e.getRightClicked() instanceof Horse) {
Player pl = e.getPlayer();
Entity ent = e.getRightClicked();
ent.setPassenger(pl);
}```
I want to drive a horse without using a saddle
So I made the player a passenger
but I can't seem to find a way to control the movement :/
@frigid ember i have the clearlagg plugn how would i do it in that plugin
@frigid ember this is ouyr server timings https://timings.spigotmc.org/?url=uwaxovebic
Do I have to request the permission to use paramorphism obfuscator?
@frigid ember Do you know how I can make players be able to drive the custom mob
:/
@frigid ember did u take a look at the timings
Say I have an Overworld world named name. If I were to create another world, being an End dimension, adding _the_end to it, thus resulting in name_the_end, would they be linked together?
how do i make spigot use more then 1 cpu core?
ohh ok
theres ways
how do I check if a block is a door and then cast it to Door to use one of its methods? I'm using this but it doesn't get past if (block instanceof Door)
@EventHandler
private void onInteract(PlayerInteractEvent event) {
if (event.getClickedBlock() instanceof Door) {
((Door) event.getClickedBlock()).setOpen(true);
}
}
(1) which Door? there are two.
(2) Block will never be an instance of either Door. depending on which one you use, either its getState().getData() (deprecated in 1.13+) or its getBlockData() will
org.bukkit.material.Door and I'll try event.getClickedBlock().getState().getData() instanceof Door
update
it worked thank u β€οΈ
wtf
does it work? xd
guess ill use that than xd
oof
doesnt exist in .8 :/
wait
is that an event
there is an itemstand inside u :/
ohh xd
but how did you do that? π
why isn't this opening/closing the door? (if its useful info, door is always an iron door)
Door door = (Door) event.getClickedBlock().getState().getData();
door.setOpen(!door.isOpen());
You need to update the block
sorry how would I do that?
oh I might be able to setType(block.getType(), true) actually
BlockState.update();
np
@pastel arrow the door isn't moving still ;c
fuck
the door isn't moving still ;c
Let me see the code please.
@EventHandler
private void onInteract(PlayerInteractEvent event) {
if (event.getClickedBlock().getState().getData() instanceof Door) {
Door door = (Door) event.getClickedBlock().getState().getData();
door.setOpen(!door.isOpen());
event.getClickedBlock().getState().update();
}
}
Add debug. Check if the code is being ran.
@frigid ember ?
can that be done or nahw
yes the code is being ran
edit the message with the debug code and show log.
@EventHandler
private void onInteract(PlayerInteractEvent event) {
Bukkit.getLogger().info("interact");
if (event.getClickedBlock().getState().getData() instanceof Door) {
Bukkit.getLogger().info("clicked door");
Door door = (Door) event.getClickedBlock().getState().getData();
door.setOpen(!door.isOpen());
Bukkit.getLogger().info("tried to open door");
event.getClickedBlock().getState().update();
Bukkit.getLogger().info("update");
}
}
[INFO] interact
[INFO] clicked door
[INFO] tried to open door
[INFO] update
door.update();
not a method
IS manual obfuscation allowed?
I already do that, its opening closing and updating that seems to be the issue
@frigid ember
door.setOpen(!door.isOpen());
blockState.setData(door);
blockState.update();
```Try this...
so i have a map (10752 x 5376) and how can I load in all the chunks so when people travel the TPS doesn't drop below 5 and crash the server. I have so far tried to use plugins such as FastChunkPregenerator and KeepChunks and when I ran the commands it would always crash the server (other info: I am using 1.16.1 and the server uses 6gb of ram)
You need to check if the player is clicking the top half
Weird bug I've found with what you're trying to achieve.
Tf
I came across that, you need to set the block to the bottom block if its door.isTopHalf()
Did you try what I said?
@frigid ember Are you only wanting to do this with a horse?
@frigid ember
No
All entities
please help
But all apart
What are you trying to do here?
sorry internet had a moment
thanks, I think I did something like that before but stopped because it was being glitchy cause I wasn't checking if it was the bottom half, thanks ill try it when I can
ILikeToCode
U asked me this
@frigid ember Are you only wanting to do this with a horse?
Multiple
But horse is 1 of them
sorry I just got back, I'll try it now, thank you for your help π
it works! thank you!
i did, I just realised theres absolutely no difference between Sound.DOOR_OPEN and Sound.DOOR_CLOSE, they're randomized either way
oofrip
is there a way to force a player to stop blocking with the shield
It's a right click yeah?
Probably can listen to the PlayerInteractEvent, check action for right click, check if it's a shield, and then cancel it
hm ok ill look into that
I'm hitting my head against a wall here, this code should search a dispenser and remove one of item (TNT in this case), and return true if it did or false if it didn't
private boolean subtractItem(@NotNull Dispenser d, @NotNull ItemStack item) {
for(int i = 0; i < d.getInventory().getSize(); i++) {
ItemStack temp = d.getInventory().getItem(i);
if(temp == null)
continue;
if(!item.isSimilar(temp))
continue;
int count = temp.getAmount();
if(count <= 0) // Quantities are off by 1, a quantity of 0 means 1 item is in the stack
continue;
count -= 1;
temp.setAmount(count);
return true;
}
return false;
}```
it works fine until there are 2 items left in the dispenser (in the same stack, if they are in different stacks it works fine)
at which point it tries to subtract one, stays with 2 items in the dispenser, and works infinitely (returning true)
you're gonna hit your head against the wall even harder when i tell you there's a method to do all this for you in a single line
private boolean subtractItem(Dispenser dispenser, ItemStack item) {
return dispenser.getInventory().removeItem(item).isEmpty();
}```
oh fun
the ItemStack's amount (ItemStack#getAmount()) is the amount it will try to remove
(removeItem() returns a Map<Integer, ItemStack> of the items it couldn't remove, so isEmpty() just makes sure they were actually removed)
what about it isn't working? how/where are you calling it? need some context here
removeItem(ItemStack) definitely works
basically what im trying to do is when they shield and get hit, it puts the shield on cooldown as if it were hit with an axe.
I'm cancelling the dispense of a TNT and spawning it in custom so I can do tracking on it
so i dont want to prevent them from blocking per se
i want to them to stop blocking
Player#setCooldown(Material), though I don't think you can stop someone from blocking
i already have it put on cooldown, but they can still block when on cooldwon if they were arleady blocking before
ah, there is an isBlocking() https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/HumanEntity.html#isBlocking()
right
i have a feeling that's because the client wouldn't like it
yeah
PIE would prevent you from starting a block but can't stop someone from blocking if they are already
i was thinking of something really jank like removing the shield from their inv and putting it back the next tick
but ill try the packet thing first and see if that works
Just remove Shields completely
ez
You may have to update the state, @worthy pewter
I don't think that's necessary for inventory manip, but that's my only guess
That or one of your conditions earlier in the method aren't being met
@frigid ember wait which one did you try?
it spawns the custom TNT, so it makes it through that method
I would give the dispenser a call to update() if that call was successful, Tyler
That's my only guess
// Subtract item yourself
Dispenser d = (Dispenser) e.getBlock().getState();
MovecraftCombat.getInstance().getLogger().info("Removing: " + e.getItem().getAmount());
e.getItem().setAmount(1);
if(!subtractItem(d, e.getItem()))
return;
d.update(true);```
same thing rip
1.10.2
(bumped the enter on the numpad rip)
anyone here use mongo and could help?
i mean you are 6 majors out of date
I'm well aware
but i don't recall any issues with removeItem()
yeah, removeItem() hasn't been touched since 2012
Does anyone see something wrong with this?
Issue is basically from what I can tell, it's not being called.
I assume it could be an async issue.
the item is being removed though right, Tyler? You said the custom tnt is being spawned, so the condition is being met?
the item is not being removed
that's the issue
the dispenser just gets stuck at 2 items
and forever spawns TNT
Idiot me on that issue BTW, forgetting how I configed my own pl.
I'm wondering if maybe this event is called after the item is consumed and if cancelled the item is re-added
I know dispenser events are strange
ding ding ding
Call your logic 1 tick later
then why did it work for all but 2 items...
BDE are called in numerous different places
it's possible it's handled elsewhere in special cases
if you run your tnt spawning logic on the next tick (just wrap it in a Bukkit.getScheduler().runTask(() -> { });) it should work okay
well here's where the fun begins
I can't guarantee that dispenser will be there next tick
noice
Hey I'm trying to figure out how to add attributes to ItemStacks. I think I need to use the addAttributeModifier() method, but I'm having trouble understanding Attributes and AttributeModifiers. Could anyone help me understand how to do this, perhaps with some quick example code or an explanation?
maybe if there are 2 items subtract 2?
no idea if that works for anything below 1.14
that's kind of what i'm leaning towards tyler, yeah
a tad hacky, but i mean... there's really no other option
Oh do I have to worry about NBT Tags? Is there a way to do it without NBT Tags? NBT Tags continue to confuse me.
No. Attributes aim to wrap them
as does ItemMeta as a whole
Is it easier to change NBT Tags than it is to store information in them? π
no, lol
Haha alright
by using ItemMeta, you are modifying NBT
it's an abstract, version-independent way of doing so
Well after I figure this out I might as well change my Food Spoilage plugin from item lore to NBT tags xD
Definitely gonna need to create some helper methods to abstract out some of this haha
Anyone here willing to code a really simple horse ownership plugin that lets you claim horses and summon/unsummon your horses? π
Thank you for the help
That sounds like an interesting project @wet bronze
I saw a plugin recently that let you store the horse in a saddle.
I'm not sure, I think I saw it in either mechanics or tools and utilities
I think this is what you're talking about
But it's from 2014 : (
Unless anybody here knows how to update plugins
Storing entities in nbt π€
how do i convert Bukkit.getServer().getOnlinePlayers().size() to a double that i can devide by 50 to set as a bossbar progress?
(double)
i feel like i should know this, but HHHWWHHHHAAAAAAATTTTT????
( (double) Bukkit.getServer().getOnlinePlayers().size() ) / 50
I think you could also do the .size() / 50d
anyone now how to make there own command in config using Mycommand
well choco
I think this is impossible in the same tick
if I subtract two from the dispenser, it now has -1 items (which in my understanding should be 0)
then add doesn't do anything
is there some way to trigger the task to run later in the same tick?
not to my knowledge
aight any venturechat experts here?
their docs are garbage and they don't have a discord
ok, I was able to get it working with a task run later
which has issues due to the other plugins I have running, but
anyone know how i can fully load my world
its about 10k x 5k
all the plugins i have used seem to crash
[10:21:15] [Server thread/ERROR]: Could not load 'plugins\LearningPlugin.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:194) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:776) [spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 5, column 1:
t:
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:419) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:124) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:85) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:139) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.yaml.snakeyaml.Yaml.load(Yaml.java:452) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDe
Do not use \t(TAB) for indentation
Your plugin.yml file uses the tab character instead of spaces
YAML does not like tabs
Well, you can put things on new lines, just use spaces instead
Would anyone be willing to update a plugin for me? β€οΈ
commands:
t:
description: "Hello world!"```
like this? name:
version: 1.0
main: test1.Main
commands:
t:
description: "Hello world!"
yes π
The source code is also available
[10:43:14] [Server thread/ERROR]: Could not load 'plugins\LearningPlugin.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: name is not defined
how to fix it?
Anyone? π¦
Again I'm not hiring.
He's using it for a boss bar, not a leveling system ._.
even if you were using it for a leveling system what is wrong with using a double o.O
^
How does the leveling system actually working in Minecraft? Like how much exp is in each level (talking about the level bar above the hotbar). I'm trying to create a point system where it'll show the users points there, but I haven't quite figured it out yet
md_5 nice meet you are you spigot homepack admin
I'll take a look at it now! and it's not level 1 is 7exp and level 2 is somewhere between 11-13exp.
i wish there was a .getLineRaw() or something along those lines to return a string from that sign without any color formatting in it
@quick arch yeah I just found it working on implementing it now!
π
or just do a simple replace function to remove color codes
i mean
have you gotten permission from the person?
pretty sure that doesn't give you source code
you'd have to decompile it
or get the source code from the author
aha thanks im first at plugin so I didn't know.
ah
me too
bad at english
so im using with translation
can i get the plugin Social code
everything ok
i wanna just learn
Hey, anyone here used Java's hibernate before?
== is a reference check of equality, that is it checks if both references point to the same memory address. => equals or less then. =< equals or greater then. <= greater then or equals.
how would i make a /spawn command with mycommand plugin
I feel like a derp π I coded that whole experience until the next level in a method and it turns out when I was searching how to add the exp to a player there is a method to setLevel so all I needed to do was send it the point value
One of my users connected to the server today and found his achievements gone, his inventory gone, and he was spawning at 0,0,0 (original spawn for world). Is this a known issue? Any way to restore his prior player data? Is this a known issue?
How do you mean validate? Can I check something on the server?
What about the player data files?
overridden or overwritten?
He hadn't logged onto the server for about two weeks and then was on a different client computer. I'm wondering if the minecraft authentication server somehow assigned a new UUID to his account. Is that plausible? Then there might be dupe UUID files for him on my server?
I'll check those.
Thank you!
This is weird. Yesterday all these files got backed up. (I deleted the beginning of each UUID for privacy reasons)... Anyone seen this before?
Can someone explain why when parsing RGB chat colors, TextComponent skips 12 chars instead of 6 and only parses every second char?
(fromLegacyText)
@winged sparrow Thanks for answering a question I didn't ask, nor did I want or need the answer to
For anyone wondering, the answer is the weird & symbol is put before every letter of the rgb hex
Don't quite get why
I assume it's for backward compatibility stuff? @fleet crane
Anybody know command in console to print the path of the install data or world info? I have several backups and am having difficulty identifying which one is currently running. Linux server. ps -ef | grep spigot just shows the command to launch, but doesn't show which world is in use.
[03:21:16 warn]: java.lang.NoSuchMethodError: com.mongodb.client.internal.mongoclientdelegate.<init>(lcom/mongodb/connection/cluster;lorg/bson/codecs/configuration/codecregistry;ljava/util/list;ljava/lang/object;lcom/mongodb/client/internal/crypt;)v
could anyone help?
Im integrating mongo in my project, even shaded it
but apparently these methods dont exist
yes its lowercase im sorry
google chrome fucked it
I was trying to help, though I admit I only read TextComponent and color. No need to be so standoffish.
Is there a setting that I can tweat to limit iron-golem spawns?
One of my players' island is full of naturally spawned iron golems, can't figure out why lol
FarmLimiter plugin by filoghost
I know that one but it's paid.
@buoyant path make sure you arent using minimizejar
@lusty basin cat /proc/<process id>/cwd
well, ive updated the API thats from, and it now says bad class: class file has wrong version
is it possibly because its in a higher version of java?
yes
@fleet crane -- that's a directory and it shows various sipgot / minecraft files. 'cat' won't work on it, but ls does.
realpath /proc/<process id>/cwd
So, I have a question that has been asked a billion times, but I am asking, because I dont know the answer, tried googling, didnt me much of an anwer.
The querstion, to upgrade Spigot from 1.15.2 to 1.16.1 is just a matter of switch the jars right?
yes
No need to convert or anything like that?
yes
Yes switch the jars and run your server with --forceUpgrade once
y
not required but good practice
I rather have good pratice
Okay, thank you so much!
I am sure this is going to be to all other future minecraft upates.
Well, the big ones at least
Okay, @fleet crane . That was great. (Thank you!) It showed me a directory that doesn't have spigot in it--
realpath /proc/29975/cwd/
/tmp/mc2/minecraft2
ls /tmp/mc2/minecraft2/
logs origuser.json plugins usercache.json world world_nether world_the_end
I do have spigot in a different directory...
ls /opt/minecraft/spigot*
/opt/minecraft/spigot-1.15.2.jar /opt/minecraft/spigot-1.16.1.jar /opt/minecraft/spigot.yml
How did I start that world where spigot isn't located?
Don't know if this is the right place to ask but where would be the best place to learn to code Minecraft plugins. I know a bit of JavaScript.
because thats how computers work
you can run programs in a place different to where the program is
spigot puts the world in your current directory
which for you is /tmp/mc2/minecraft2
you can use the cd command to change directories
yo whats the best place to learn how to code using the spigot API, i used some crappy outdated tutorials to learn, but now my friend wants to start. what should i send him?
Looking at my history, I typed start.sh without a path prior to it. I was in the /opt/minecraft dir when I ran it, so I think.
ok
you mustve done something related to /tmp/mc2/minecraft2/, spigot doesnt just place files randomly
@frigid ember someone sent me this handy thing to learn java, maybe u can make use of it too https://www.jetbrains.com/academy/
Alright I will look in to it
@frigid ember I think you should learn the basics of java first. There are plenty of tutorials and it wont take long. JavaScript and Java are very different languages so you will need to do that. After that you can check out tutorials:_
https://www.youtube.com/c/TheSourceCodeTutorials/playlists
https://www.codecademy.com/learn/learn-java I was lookin at this one.
looking for some advice:
I'm using events and I need to be able to get the instance of an inventory after an event occurs (in this case i want to check the contents of a user's inventory after selecting a trade using TradeSelectEvent to determine if I want to cancel the event or not.
i dont think actually canceling the event like normal is possible due to the fact events run before the actual event takes place. how should I implement this? googling didn't seem to help me :/
my usage is I would like to cancel the event if they are trying to trade a specific ItemStack
almost every event runs before so that it can be cancelled
if the event ran afterwards cancelling wouldnt work because there would be nothjing to cancel
yes
my question is how could i implement a way to see a user's inventory after an event occurs so I could revert changes if needed
why do you need to see it after
why can you not get the information you need from TradeSelectEvent
using Player.getInventory doesnt work during the TradeSelectEvent because the inventory hasnt actually been updated yet
You could either prevent the selection if forbidden items completely with the InventoryClickEvent
Or check the invs in the InventoryCloseEvent...
if (event.getInventory().getSelectedRecipe().getIngredients().contains(stack)) event.setCancelled(true)
or something along those lines
you're looking at this the wrong way
all the info you need is definitely in the event
Oh its not a custom trade gui...
Anyone know how to add custom items no mods
Hi
Hi can someone help me download the Metrics Plugin, Plugin PermissionsEx because I do not think and I'm trying to use the Plugin VipZero
Please
I'm waiting
I'm Brazilian and I'm using Google Translate Translation should be a little Bad
?
how am I meant to use things coded for newer versions of java with spigot
isnt minecraft capped at java 8
@frigid ember i think this is what you're looking for. PermissionsEX isn't actually on the Spigot resources tab
https://dev.bukkit.org/projects/permissionsex
https://github.com/PEXPlugins/PermissionsEx/releases
That's right, now just missing the Metrics Plugin
Aaah went to see the link but does not have version 1.8
π¦
https://imgur.com/a/oVWqDpc
^ The enchanted books check never returns true; it's not finding an enchanted book even though it SHOULD be an enchanted book
I'm working on adding something that generates a new enchant if an enchanted book has a certain enchant.
I'm getting stuck on this check to find if the result of my trade is an enchanted book so I can swap out the trade
@silent shuttle Hi, and that I need the PermissionEx plugins and Metrics to be able to use VipZero
Okay
You need Vault too
Do you have it
- do you have an economy plugin e.g. Essentials
I don't have
Can u tell what VipZero is? I canβt search Rn because on ipad
Download Vault from bukkit
VipZero is a Vips Plugin for Factions
When executed with a command it gives a Vip to a Player in which he uses the Kits they have seen
Brb
@silent shuttle I don't get it.
@silent shuttle If you can help me I'll be very grateful
anyone using ultimate ktis plugin here?
does ultimatekits.admin
enable thre group that has it to access all kits available?
or not
How do I import the API of another plugin to use in my own?
Is there any way around the server erroring when teleporting between worlds without using runTask()?
runTask allows events to occur inbetween the event teleported from, and the actual teleportation
Help appreciated
I'm trying to figure out if my spigot server was hacked because a bunch of files seem to be missing suddenly. Noticing in the world/region folder, I only have:
ls -al
total 36872
drwxr-xr-x 2 root root 12288 Jun 30 04:35 .
drwxr-xr-x 8 root root 132 Jul 24 05:35 ..
-rw-r--r-- 1 root root 6070272 Jul 24 04:20 r.0.0.mca
-rw-r--r-- 1 root root 6701056 Jul 24 05:35 r.0.-1.mca
-rw-r--r-- 1 root root 5779456 Jul 24 04:00 r.0.-2.mca
-rw-r--r-- 1 root root 6623232 Jul 24 04:20 r.-1.0.mca
-rw-r--r-- 1 root root 6689545 Jul 24 05:35 r.-1.-1.mca
-rw-r--r-- 1 root root 5871236 Jul 24 04:00 r.-1.-2.mca
I prior backup from June 30th showed 485 files in this directory....
Hi there, good morning!
Yesterday, I swapped my spigot server.jar from back when 1.16.1 was just released with a newly built one to get all the changes that have been made in the meantime.
Upon restarting the Server, one of my maps (integrated using MultiVerse where I did not make any changes) was completely wiped and regenerated to its natural state.
What could have caused this and is there a way for me to salvage all the hard work the players had put in?
@lusty basin is it only missing files or has your world rolled back, too?
The directory where I had previously run start.sh doesn't have much in it now.
ls -al
total 8
drwxr-xr-x 7 root root 130 Jul 24 03:42 .
drwxr-xr-x 3 root root 24 Jun 30 02:38 ..
drwxr-xr-x 2 root root 318 Jul 24 03:20 logs
-rw-r--r-- 1 root root 972 Jul 24 03:42 origuser.json
drwxr-xr-x 3 root root 23 Jun 12 05:53 plugins
-rw-r--r-- 1 root root 972 Jul 24 02:36 usercache.json
drwxr-xr-x 8 root root 132 Jul 24 05:50 world
drwxr-xr-x 3 root root 57 Jul 24 05:50 world_nether
drwxr-xr-x 3 root root 56 Jul 24 05:50 world_the_end
Missing spigot and in plugins, I had two previously, now only one. Log files only go back to 7/15.
I'm connecting to the server now to see if old creations are still there.
Upon restarting the Server, one of my maps (integrated using MultiVerse where I did not make any changes) was completely wiped and regenerated to its natural state.
@ancient haven
Found one more map that has been completely reset
2 of 6 maps have been rolled back
@silent shuttle If you can help me I'll be very grateful
@frigid ember yes for sure, im back home
So far, @ancient haven -- my maps are looking correct. But I haven't restarted the server yet. Afraid to try.
Did you not make world backups?
afaik, without any sort of backup, there's no way to recover your data.
although
I could be wrong
but I've had a case where I tried to make a Multiverse world and it regenerated my exact save
are you sure the world files have been rolled back, or is it an error that's causing you to go to a new version of each world?
How would you go about determining that? What I know so far is that the server starts and stops without errors and it loads and saves the rolled back version of the affected worlds. Are there any files in the world directory I could check?
hmm
Seems like a question for the MV discord. I don't know too much about Minecraft worlds.
As a guess, level.dat would be a good place to start.
OK, I found something... I have an old (8. July), manual backup of the world. its region/ folder contains ~450 *.mca files.
The current version only contains ~15 *.mca files
Seems like a question for the MV discord. I don't know too much about Minecraft worlds.
As a guess, level.dat would be a good place to start.
@wise flame
what would I look for in level.dat? opnening in text editor it looks like gibberish to me π
honestly, just the Windows modification date
if Minecraft isn't touching it at all, the level.dat will say a recent time
30 minutes ago when I restarted the server
Huh. The default autosave timer is five minutes
looks like that's when it regenerated
Unless you changed it, it should be within the last five minutes
the server is currently not running, maybe that's why
ah, I see
i know this is not the correct place to ask about this, but, what is the difference between ubuntu desktop, and ubuntu server? Can you still run a properly made server in ubuntu desktop?
how would you guys go about giving a skull a skin in a non server locking way? π€
i've noticed how bad is setOwningPlayer
can i like replace the game profile manually? π€
how to
i like to code
look
How do i fix this mess
im using a premium group plugin
I am using essentials chat instead its built in feature (which is shit)
oh ok, thx
How would I create a new file that stores, for example, player kills and deaths, then puts that new file inside a folder called playerData?
@sage summit There are several aproaches to this.
https://www.spigotmc.org/wiki/config-files/
You could create a single file (which wont scale nice)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
https://hub.spigotmc.org/jira/browse/SPIGOT-6002
Is there any way around the server erroring when teleporting between worlds without using runTask()?
runTask allows events to occur inbetween the event teleported from, and the actual teleportation
Help appreciated
Or you can just write a new .yml / .json / .dat / .bin / .txt (whatever you like) and store per player data
how would i create a new file every time a player joined?
Just like you would normally do with java. As start path you can use Plugin#getDataFolder()
how do i create the folder to put them in?
Like you normally would in java π with mkdir() or mkdirs()
ok, im new to doing stuff with files and java in general
thanks!
File subFolder = new File(plugin.getDataFolder() + File.separator + "data");
if (!subFolder.exists()) {
subFolder.mkdirs();
}
I would recommend instead of subFolder set it to the actual playerFile ex. File playerFile = new File(plugin.getDataFolder() + File.separator + "data", uuid +".yml");, then instead of subFolder.mkdirs() yuo can do playerFile.getParentFile.mkdirs(), Lastly on a seperate line but still in the if statement playerFile.createNewFile() (change !subFolder.exists() to playerFile.exists() as wel)
That just lets u get to the player file easier instead of anothe rif statement to create that file and so forth
Or he just caches the subfolder as a class scope variable... then write a method getPlayerFile(Player player)
return new File(subFolder, player.getUUID().toString() + ".yml");
Like you would normally do instead of writing the whole path new...
Also you never use playerFile.createNewFile() when working with the FileConfiguration api
private val parent = "./data".toPath()
fun getPlayerFile(id: UUID): Path = parent
.also { it.createDirectories() }
.resolve("$id.data")
Where can i see My Posts and How many i have on SpigotMC?
probably in ur profile
Messages?
when using onTabComplete how do I restrict it to only the first argument? i dont see a parameter that gives which argument is being typed
@Override
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
final String firstArg = (args.length > 0) ? args[0].toLowerCase() : "";
return Iterables
.transform(Iterables.filter(ProxyServer.getInstance().getPlayers(), new Predicate<ProxiedPlayer>() {
@Override
public boolean apply(ProxiedPlayer player) {
return player.getName().toLowerCase().startsWith(firstArg);
}
}), new Function<ProxiedPlayer, String>() {
@Override
public String apply(ProxiedPlayer player) {
return player.getName();
}
});
}
check length of the args
Collections.empty*()
I get The method empty() is undefined for the type Collections
isEmpty()
emptyAnyTypeOfCollection
Wait i didnt read waht was going on
what is emptyAnyTypeOfCollection? Is it a method on Collections?
dude
I'm trying to make some custom items and I am creating a custom yml file with it. I am struggling to set a default lore and displayname. currently it is just makes this
weapons:
thunderaxe:
name: []
lore: []
Here are some of the files
https://cdn.discordapp.com/attachments/493232350029807616/736151574920953885/unknown.png
https://cdn.discordapp.com/attachments/493232350029807616/736151607619747840/unknown.png
https://cdn.discordapp.com/attachments/493232350029807616/736151640213815316/unknown.png
So there are a couple of things wrong here...
-
First of all your main class uses a ton of static abuse. Dont do that. Static is a pretty rare keyword that should be used with caution.
You can write >90% of your plugins without a single static keyword. -
A list should always have a type. eg List<String>
-
Your name should not be a List but rather a single String as you cant have multiple lines in a item display name.
-
Your naming conventions are all over the place.
- ClassNameLikeThis
- methodNameLikeThis()
- fieldNameLikeThis
- STATIC_FINAL_LIKE_THIS
You pass instances but never use them.
I think you should rly try to learn a bit more of the java basics before writing more plugins.
what does args[0] mean? and what happens if i use args[1]?
Thats how you access values from an array. Java 101
Or rather programming 101
args[0] will access the first element in the array
so
say i input /command word1 word2
args[0] will output word1 and args [1] will output word2?
Also just remember Java will throw an error if you try to get an index larger than there is in an array.
like a null?
So say you used args[0] on that command and just did /command without the world1, if you don't check the size of args it will throw an IndexOutOfBoundsException.
args.length < 1
It's just an error it throws.
so i can catch it?
Not everything will throw a NullPointerException.
You can catch it, but it would be better to just check the length of args in the first place.
if (args.length < 1) {
return;
}
args[0]
If you use that, it will never run the args[0] if there isn't actually an args[0] as it returns before it.
ohh okay
thanks
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("f") && args[0] == "create") {
if (CheckFile = new File(getDataFolder(), args[1] + ".yml").exists()) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&e&lFlash&a&lPlex &e>>") + ChatColor.RED + "Sorry, this faction name is taken.");
}
else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&e&lFlash&a&lPlex &e>>") + ChatColor.GREEN + "You have created the faction " + args[1] + " successfully!");
File file = new File(getDataFolder(), args[1] + ".yml");
FileConfiguration cfg = YamlConfiguration.loadConfiguration(file);
cfg.set("faction", args[1] + "");
try {
cfg.save(file);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}``` why is this not working? im inputting /f create name and i get nothing
Yeah i replaced it with .equals, sorry
you can compare strings using == if you are sure that it is from string pool
nah it works now
also you don't need to check for label
anyone knows how to make formats like that: formats: default: priority: 9999 permission: 'chm.default' format: '&8%player_name% &7Β» ' but user can create unlimited number of it?```
formats:
default:
priority: 9999
permission: 'chm.default'
format: '&8%player_name% &7Β» '
exmaple1:
priority: 8888
permission: 'chm.example1'
format: '&8%player_name% &8Β» '
just store configuration sections?
a... config?
yeah but i need to somehow check that priority
wdym
if its bigger than other ones
can u provide a use case
??
i don't understand what you want
i want to have in config one default chat format, but make possible to user create other ones
when player have permission and uses bigger priority
and the problem is?
how to check priority
...................................what?
parse chat formats or whatever it is
if is bigger that that other ones
and sort it by priority?
but hey i need for loop for that
do it once?
I have multiple yml files, how can i get a list of thier names?
dir.list()
or if thats not possible i have another idea
class ChatFormat(val priority: Int, val permission: String, val format: String) : Comparable<ChatFormat> {
override fun compareTo(other: ChatFormat): Int = other.priority.compareTo(priority)
override fun toString(): String {
return "ChatFormat(priority=$priority, permission='$permission', format='$format')"
}
}
fun main() {
val formats = arrayOf(
ChatFormat(100, "a.1", "a"),
ChatFormat(200, "a.2", "b")
)
formats.sort()
println(formats.contentToString())
}
kotlin bruh
WHO HERE USES KOTLIN
Kotlin rocks.
Proguard.
And it's gone
Also there are flags for Kotlin's compiler to remove all stuff it will add
Like null checks, etc.
I still prefer Java + lombok
@spring arch thats that solution?
to each his own
or no?
@frigid ember yes that's how I would implement what you want
Someone tf does this meaaaan [13:50:20] [Server thread/ERROR]: Error occurred while enabling TickPlugin v1.0.0 (Is it up to date?) java.lang.NullPointerException: null at me.novato.tickplugin.Main.onEnable(Main.java:51) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[server.jar:git-Spigot-800b93f-8160e29] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:352) [server.jar:git-Spigot-800b93f-8160e29] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:417) [server.jar:git-Spigot-800b93f-8160e29] at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:462) [server.jar:git-Spigot-800b93f-8160e29] at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:376) [server.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:457) [server.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:267) [server.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:784) [server.jar:git-Spigot-800b93f-8160e29] at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
@blissful verge see line 51 of ur plugin
in main.java
if (!cfg.getString("CONFIG_VERSION").equalsIgnoreCase("1.1.0"))
getString returned null
Also dont call me out if is on the same line
@frigid ember parse your sections into data class (ChatFormat in my example) and sort it once
programm it
yep
in java or kotlin eazy
i recommend some bukkit tuts on youtube
or skript maybe
What's a combo minigame?
class ChatFormat(val priority: Int, val permission: String, val format: String) : Comparable<ChatFormat> {
override fun compareTo(other: ChatFormat): Int = other.priority.compareTo(priority)
override fun toString(): String {
return "ChatFormat(priority=$priority, permission='$permission', format='$format')"
}
}
fun main() {
val yaml = YamlConfiguration.loadConfiguration(File("blablabla.yml"))
val formats = yaml.getKeys(false).map { s -> yaml.getConfigurationSection(s) }.map { s ->
ChatFormat(s.getInt("priority"), s.getString("permission"), s.getString("format"))
}.sorted()
val p = org.bukkit.Bukkit.getPlayer(id)
val format = formats.find { p.hasPermission(it.permission) }
}
now the error is weirder
Infinite I think
Every 1 second I think?
Yes
wdym as in combo minigame
@blissful verge Don't create instances of your plugin
wdym
i'm meaning exactly what i siad
@sturdy oar There is a entity bound limit. You can change it i think. Other than that there is no limit.
I dont understand
you create instance of your plugin here at me.novato.tickplugin.events.Ticks.<init>(Ticks.java:16) ~[?:?]
@grim halo yeah I am trying to damage a player each tick, however it doesn't really feel like he's getting damaged often
ty i'll try those
@sturdy oar You can just amnually reduce the health every tick and fire an damage event yourself
bruh
i am doing LivingEntity#damage()
Yes but this will also affect a lot of environmental behavior and might make the game rly hard to play
yeah because
I'd need only my stuff to be able to damage faster
I basically am trying to modify poison speed
yeah i have custom runnable objects
that basically completely override vanilla poison
however I'm limited by the LivingEntity#damage() delay
would I have to use packets?
no
class ChatFormat(val priority: Int, val permission: String, val format: String) : Comparable<ChatFormat> {
override fun compareTo(other: ChatFormat): Int = other.priority.compareTo(priority)
override fun toString(): String {
return "ChatFormat(priority=$priority, permission='$permission', format='$format')"
}
}
fun main() {
val yaml = YamlConfiguration.loadConfiguration(File("blablabla.yml"))
val formats = yaml.getKeys(false).map { s -> yaml.getConfigurationSection(s) }.map { s ->
ChatFormat(s.getInt("priority"), s.getString("permission"), s.getString("format"))
}.sorted()
val p = org.bukkit.Bukkit.getPlayer(id)
val format = formats.find { p.hasPermission(it.permission) }
}
@spring arch i dont understand kotlin π¦
You can send sound packets and make it look like the player is actually losing health every tick.
So -> reduce health -> send sound
Mh ok, i'll have some fun with NMS
You can send a sound packet without nms i think.
yes i can play effects
Spigot does exactly that if you play a sound for a specific player
Just sending a packet
Just call tickPotionEffects more frequently
ticks active potion effect?
and apply it with my own runnables
there is no damage by poison, i call damage() every X ticks
I think this is an issue with Minecraft itself
How would you manually tick the potion effects in spigot?
Only by calling NMS stuff :)
there is a delay between damage
@spring arch so I need NMS to change this?
you're not a verified member
i basically manage poison my own way
whatever
if you still want to use potion normally
you have to create your own effect and override this
https://i.imgur.com/eCa0LDn.png
It's MobEffectList.
Don't know why it's called list lol
@sturdy oar another solution is to set no damage ticks to zero, damage entity, and revert it back to previous value
maybe that's what you want
I'll try some stuff
it's kinda trivial solution
I usually try all Bukkit stuff before going with NMS
Thats what you are supposed to do. NMS only as last resort (unless you write for personal use)
val ticks = p.noDamageTicks
p.noDamageTicks = 0
p.damage(1.0)
p.noDamageTicks = ticks
tbh setNoDamageTicks() is a really confusing name
one would think the entity cannot be damaged if you use it
@grim halo nms is the only way to not shoot yourself
I mean if you need more functions you can always PR ^^
I can't PR, I can't sign the spigot repository thing
