Résolu Quand un item d'armure est équipé, il téléporte vers une dimension
-
Salut, je voudrais savoir s’il est possible de faire en sorte que quand un item d’armure (un casque) de mon mod est équipé, il téléporte le joueur vers une autre dimension (avec l’ID de ma dimension), je sais qu’il faut utiliser le onArmorTick mais après je sais pas comment faire ça, si quelqu’un peux m’aider ce serait top merci d’avance!
-
Salut !
Il faut que tu vérifies si l’item qu’il y a dans le slot d’armure est ton armure comme ça :if(player.inventory.armorItemInSlot(3).getItem() == TonCasque)
où 3 est le slot du casque donc 2 est le plastron, etc jusqu’à 0.
Ensuite tu peux aussi tester pour savoir si tu n’est pas déjà dans la dimension :if(player.dimension != Id_de_ta_dimension)
Puis tu à juste à faire
player.dimension = Id_de_ta_dimension;
.
Voilà -
Salut! Merci beaucoup de ta réponse, j’ai suivi tes indications et j’en arrives a ça :
@Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.NERVE_GEAR_SAO) { if(player.dimension != 25) { player.changeDimension(25); } } } }
J’ai remplacé player.dimension = Id_de_ta_dimension;. par player.changeDimension(Id dim) car il ne se passait rien, mais la quand j’équipe mon casque il se passe bel et bien quelque chose je suis téléporté mais le jeu crash que faire
-
Bonsoir,
Dire que le jeu crash sans fournir le rapport de crash ne nous aide pas beaucoup à comprendre ton problème -
@robin4002 Salut, effectivement c’est très bête de ma part excusez moi voici le crash report, merci de l’aide que vous m’apportez malgré mes gaffes :
net.minecraft.util.ReportedException: Ticking player at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:212) ~[NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) ~[IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_241] Caused by: java.lang.NullPointerException at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) ~[Teleporter.class:?] at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:39) ~[Teleporter.class:?] at net.minecraft.world.Teleporter.placeEntity(Teleporter.java:443) ~[Teleporter.class:?] at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:762) ~[PlayerList.class:?] at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:662) ~[PlayerList.class:?] at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) ~[EntityPlayerMP.class:?] at net.minecraft.entity.Entity.changeDimension(Entity.java:2911) ~[Entity.class:?] at blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:45) ~[NerveGearSAO.class:?] at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:413) ~[InventoryPlayer.class:?] at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:575) ~[EntityPlayer.class:?] at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2405) ~[EntityLivingBase.class:?] at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) ~[EntityPlayer.class:?] at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) ~[EntityPlayerMP.class:?] at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) ~[NetHandlerPlayServer.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) ~[NetworkDispatcher$1.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) ~[NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) ~[NetworkSystem.class:?] ... 5 more [22:13:12] [Server thread/ERROR] [minecraft/MinecraftServer]: This crash report has been saved to: C:\Users\Mathys\Desktop\Logiciels\Mod Minecraft\SwordArtOffline\run\.\crash-reports\crash-2020-04-28_22.13.12-server.txt [22:13:12] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [22:13:12] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [22:13:12] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [22:13:12] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld [22:13:12] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 4/28/20 10:13 PM Description: Ticking player java.lang.NullPointerException: Ticking player at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:39) at net.minecraft.world.Teleporter.placeEntity(Teleporter.java:443) at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:762) at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:662) at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) at net.minecraft.entity.Entity.changeDimension(Entity.java:2911) at blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:45) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:413) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:575) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2405) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) at java.lang.Thread.run(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:39) at net.minecraft.world.Teleporter.placeEntity(Teleporter.java:443) at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:762) at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:662) at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) at net.minecraft.entity.Entity.changeDimension(Entity.java:2911) at blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:45) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:413) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:575) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2405) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) -- Player being ticked -- Details: Entity Type: null (net.minecraft.entity.player.EntityPlayerMP) Entity ID: 806 Entity Name: Player588 Entity's Exact location: 105.00, 66.00, -44.00 Entity's Block location: World: (105,66,-44), Chunk: (at 9,4,4 in 6,-3; contains blocks 96,0,-48 to 111,255,-33), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1) Entity's Momentum: 0.00, -0.08, 0.00 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@de8cfbc Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) at java.lang.Thread.run(Unknown Source) -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_241, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 734054024 bytes (700 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 12 FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:------ |:--------- |:------------ |:-------------------------------- |:--------- | | LCHIJA | minecraft | 1.12.2 | minecraft.jar | None | | LCHIJA | mcp | 9.42 | minecraft.jar | None | | LCHIJA | FML | 8.0.99.99 | forgeSrc-1.12.2-14.23.5.2847.jar | None | | LCHIJA | forge | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None | | LCHIJA | sao | Alpha | bin | None | Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Player Count: 1 / 8; [EntityPlayerMP['Player588'/806, l='New World', x=105.00, y=66.00, z=-44.00]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' [22:13:12] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2020-04-28_22.13.12-server.txt [22:13:12] [Client thread/INFO] [FML]: Waiting for the server to terminate/save. [22:13:12] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/SAO [22:13:14] [Server thread/INFO] [FML]: Unloading dimension 0 [22:13:14] [Server thread/INFO] [FML]: Unloading dimension 25 [22:13:14] [Server thread/INFO] [FML]: Applying holder lookups [22:13:14] [Server thread/INFO] [FML]: Holder lookups applied [22:13:14] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded. [22:13:14] [Client thread/INFO] [FML]: Server terminated. [22:13:14] [Client Shutdown Thread/INFO] [minecraft/MinecraftServer]: Stopping server AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
-
blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:45)
ici tu as une npe donc je pense que tu dois verif si l’emplacement n’est pas null -
@DailyCraft a dit dans Quand un item d'armure est équipé, il téléporte vers une dimension :
blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:45)
ici tu as une npe donc je pense que tu dois verif si l’emplacement n’est pas nullOkay merci, ça provient de cette ligne :
player.changeDimension(25);
-
alors l’id n’existe pas
J’ai jamais fait de dimensions mais tu peut pas faire Dimensions.MA_DIMENSION.getID() ou un truc comme ça
-
@DailyCraft J’ai fais ce que tu as dit : player.changeDimension(DimensionInit.SAO.getId()); et j’ai encore un crash /:
Merci de l’aides que tu m’apportes!
crash report :[22:35:53] [Server thread/INFO] [FML]: Loading dimension 25 (New World) (net.minecraft.server.integrated.IntegratedServer@4debfc4f) [22:35:57] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.util.ReportedException: Ticking player at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:212) ~[NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) ~[IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_241] Caused by: java.lang.NullPointerException at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) ~[Teleporter.class:?] at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:39) ~[Teleporter.class:?] at net.minecraft.world.Teleporter.placeEntity(Teleporter.java:443) ~[Teleporter.class:?] at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:762) ~[PlayerList.class:?] at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:662) ~[PlayerList.class:?] at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) ~[EntityPlayerMP.class:?] at net.minecraft.entity.Entity.changeDimension(Entity.java:2911) ~[Entity.class:?] at blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:46) ~[NerveGearSAO.class:?] at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:413) ~[InventoryPlayer.class:?] at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:575) ~[EntityPlayer.class:?] at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2405) ~[EntityLivingBase.class:?] at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) ~[EntityPlayer.class:?] at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) ~[EntityPlayerMP.class:?] at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) ~[NetHandlerPlayServer.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) ~[NetworkDispatcher$1.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) ~[NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) ~[NetworkSystem.class:?] ... 5 more [22:35:57] [Server thread/ERROR] [minecraft/MinecraftServer]: This crash report has been saved to: C:\Users\Mathys\Desktop\Logiciels\Mod Minecraft\SwordArtOffline\run\.\crash-reports\crash-2020-04-28_22.35.57-server.txt [22:35:57] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [22:35:57] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [22:35:57] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ---- // You're mean. Time: 4/28/20 10:35 PM Description: Ticking player java.lang.NullPointerException: Ticking player at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:39) at net.minecraft.world.Teleporter.placeEntity(Teleporter.java:443) at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:762) at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:662) at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) at net.minecraft.entity.Entity.changeDimension(Entity.java:2911) at blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:46) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:413) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:575) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2405) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) at java.lang.Thread.run(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:39) at net.minecraft.world.Teleporter.placeEntity(Teleporter.java:443) at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:762) at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:662) at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) at net.minecraft.entity.Entity.changeDimension(Entity.java:2911) at blueziks.sao.objects.tools.NerveGearSAO.onArmorTick(NerveGearSAO.java:46) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:413) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:575) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2405) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) -- Player being ticked -- Details: Entity Type: null (net.minecraft.entity.player.EntityPlayerMP) Entity ID: 2423 Entity Name: Player813 Entity's Exact location: 254.00, 72.00, 250.00 Entity's Block location: World: (254,72,250), Chunk: (at 14,4,10 in 15,15; contains blocks 240,0,240 to 255,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Entity's Momentum: 0.00, -0.08, 0.00 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@6b4901b Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) at java.lang.Thread.run(Unknown Source) -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_241, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 568573256 bytes (542 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 12 FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:------ |:--------- |:------------ |:-------------------------------- |:--------- | | LCHIJA | minecraft | 1.12.2 | minecraft.jar | None | | LCHIJA | mcp | 9.42 | minecraft.jar | None | | LCHIJA | FML | 8.0.99.99 | forgeSrc-1.12.2-14.23.5.2847.jar | None | | LCHIJA | forge | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None | | LCHIJA | sao | Alpha | bin | None | Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Player Count: 1 / 8; [EntityPlayerMP['Player813'/2423, l='New World', x=254.00, y=72.00, z=250.00]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' [22:35:57] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2020-04-28_22.35.57-server.txt [22:35:57] [Client thread/INFO] [FML]: Waiting for the server to terminate/save. [22:35:57] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [22:35:57] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld [22:35:58] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/SAO [22:35:59] [Server thread/INFO] [FML]: Unloading dimension 0 [22:35:59] [Server thread/INFO] [FML]: Unloading dimension 25 [22:35:59] [Server thread/INFO] [FML]: Applying holder lookups [22:35:59] [Server thread/INFO] [FML]: Holder lookups applied [22:35:59] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded. [22:35:59] [Client thread/INFO] [FML]: Server terminated. [22:35:59] [Client Shutdown Thread/INFO] [minecraft/MinecraftServer]: Stopping server AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
-
net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136)
ok en fait la je crois que il cherche un portail dans la dimension mais il en trouve pas donc je pense que tu te trompe juste de méthode à utiliser -
faut pas utiliser ça parce que c’est assez spécifique à minecraft, fais juste
player.dimension = 25
-
@DailyCraft Merci! Je devrais créer un bloc portail ou alors essayer une autre méthode même si j’en vois pas personnellement malgré beaucoup de recherches
-
@Eno_gamer10 a dit dans Quand un item d'armure est équipé, il téléporte vers une dimension :
player.dimension = 25
Merci de l’aide, je viens de faire le test et quand j’équipe l’armure il ne se passe rien néanmoins dans la console il se passe tout de même quelque chose :
[22:43:19] [Server thread/INFO] [FML]: Loading dimension 25 (New World) (net.minecraft.server.integrated.IntegratedServer@7ab11cdb) -
Effectivement après quelque recherche player.changeDimension s’attend à la présence d’un portail.
Il faut utiliser la fonction transferPlayerToDimension de la classe PlayerList.
-
@robin4002 Merci de ta réponse, si j’ai bien compris je dois créer un bloc téléporteur puis utiliser cette fonction?
EDIT : Ah non enfaite j’ai peut être pas besoin du bloc téléporteur -
@robin4002 Malgré de nombreux essais je reste toujours bloqué je ne sais pas quoi faire /:
Je suis parvenu a ça : (0 90 0 sont les cordonnées ou le personnage est tp mais j’aimerais qu’ils sois tp au spawn point)
j’aimerais également que l’item se casse des que le joueur est tp car je crois qu’il est tp à l’infini@Override public void onArmorTick(World worldIn, EntityPlayer playerIn, ItemStack itemStack) { if(playerIn.inventory.armorItemInSlot(3).getItem() == ItemInit.NERVE_GEAR_SAO) { if (!worldIn.isRemote) { ((EntityLivingBase)playerIn).addPotionEffect(new PotionEffect(MobEffects.HEALTH_BOOST, 100, 2)); Teleport.teleportToDimension((EntityPlayer)playerIn, 25, 0, 90, 0); playerIn.setPositionAndUpdate(x, y, z); } } }
-
Non, il est pas tp à l’infini car tu vérifie si avant de le tp, il n’est pas déjà dans la dimension
PS : que tu as enlever, donc j’ai rien dit
-
@DailyCraft Ouais exact, je viens de le remettre d’ailleurs, j’en suis à ça :
@Override public void onArmorTick(World worldIn, EntityPlayer playerIn, ItemStack itemStack) { if(playerIn.inventory.armorItemInSlot(3).getItem() == ItemInit.NERVE_GEAR_SAO) { if (!worldIn.isRemote) { if(playerIn.dimension != 25) { ((EntityLivingBase)playerIn).addPotionEffect(new PotionEffect(MobEffects.HEALTH_BOOST, 100, 2)); Teleport.teleportToDimension((EntityPlayer)playerIn, 25, 0, 90, 0); playerIn.setPositionAndUpdate(x, y, z); } } } } }
Je suis bel et bien téléporté dans la dimension sans problème! Il me reste juste 2 problèmes mineurs : j’aimerais que l’on soit tp au spawn point de la dimension et non en 0 ; 0 et j’aimerais si cela est possible que quand j’arrives dans la dimension, le casque soit détruit donc je poursuis mes recherches, Merci beaucoup de l’aide que vous m’apportez!
-
Update : Je viens de faire ça :
@Override public void onArmorTick(World worldIn, EntityPlayer playerIn, ItemStack itemStack) { if(playerIn.inventory.armorItemInSlot(3).getItem() == ItemInit.NERVE_GEAR_SAO) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (!worldIn.isRemote) { if(playerIn.dimension != 25) { ((EntityLivingBase)playerIn).addPotionEffect(new PotionEffect(MobEffects.HEALTH_BOOST, 100, 2)); Teleport.teleportToDimension((EntityPlayer)playerIn, 25, x, y, z); playerIn.setPositionAndUpdate(x, y, z); } } } } }
J’ai essayé avec l’overworld pour voir, le spawn point de ma map était : -95 70 221 mais en équipant le casque j’arrive assez proche mais pas aux coordonnées identiques : -100 64 224 que faire svpl?
-
C’est pasplayerIn.getBedSpawnLocation()
?PS : oui mais avec bukkit